Copyright | (c) Michal Konecny |
---|---|
License | BSD3 |
Maintainer | [email protected] |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
AERN2.MP.Accuracy
Description
A type for measuring the accuracy of an enclosing set, roughly corresponding to the maximum absolute error in some distance metric approximately measured in bits.
Synopsis
- data Accuracy
- bits :: ConvertibleExactly t Accuracy => t -> Accuracy
- fromAccuracy :: Accuracy -> Integer
- class HasAccuracy a where
- getAccuracy :: a -> Accuracy
- getFiniteAccuracy :: a -> Accuracy
- ac2prec :: Accuracy -> Precision
- iterateUntilAccurate :: HasAccuracy t => Accuracy -> (Precision -> Maybe t) -> [(Precision, Maybe t)]
- convergentList2seqByAccuracy :: HasAccuracy t => [t] -> Accuracy -> t
- seqByPrecision2seqByAccuracy :: HasAccuracy t => (Precision -> t) -> Accuracy -> t
- setPrecisionAtLeastAccuracy :: (HasPrecision t, CanSetPrecision t) => Accuracy -> t -> t
- class ShowWithAccuracy t where
- showWithAccuracy :: Accuracy -> t -> String
- class HasApproximate t where
- type Approximate t
- getApproximate :: Accuracy -> t -> Approximate t
Documentation
A non-negative Double value to serve as an error bound. Arithmetic is rounded towards +infinity.
Constructors
NoInformation | |
Exact |
Instances
fromAccuracy :: Accuracy -> Integer Source #
class HasAccuracy a where Source #
Minimal complete definition
Methods
getAccuracy :: a -> Accuracy Source #
getFiniteAccuracy :: a -> Accuracy Source #
Return accuracy, except when the element is Exact, return its nominal Precision dressed as Accuracy. This function is useful when we have a convergent sequence where all elements happen to be actually equal to the limit and we need the property that the sequence elements keep improving.
default getFiniteAccuracy :: HasPrecision a => a -> Accuracy Source #
Instances
HasAccuracy Kleenean Source # | |
Defined in AERN2.MP.Accuracy Methods getAccuracy :: Kleenean -> Accuracy Source # getFiniteAccuracy :: Kleenean -> Accuracy Source # | |
HasAccuracy MPBall Source # | |
Defined in AERN2.MP.Ball.Type | |
HasAccuracy Dyadic Source # | |
Defined in AERN2.MP.Dyadic | |
HasAccuracy ErrorBound Source # | |
Defined in AERN2.MP.ErrorBound Methods getAccuracy :: ErrorBound -> Accuracy Source # | |
HasAccuracy Rational Source # | |
Defined in AERN2.MP.Accuracy Methods getAccuracy :: Rational -> Accuracy Source # getFiniteAccuracy :: Rational -> Accuracy Source # | |
HasAccuracy Integer Source # | |
Defined in AERN2.MP.Accuracy | |
HasAccuracy Bool Source # | |
Defined in AERN2.MP.Accuracy | |
HasAccuracy Int Source # | |
Defined in AERN2.MP.Accuracy | |
HasAccuracy t => HasAccuracy (Complex t) Source # | |
Defined in AERN2.MP.Accuracy Methods getAccuracy :: Complex t -> Accuracy Source # getFiniteAccuracy :: Complex t -> Accuracy Source # | |
HasAccuracy t => HasAccuracy (Maybe t) Source # | |
Defined in AERN2.MP.Accuracy | |
HasAccuracy t => HasAccuracy [t] Source # | |
Defined in AERN2.MP.Accuracy | |
(HasAccuracy a, CanBeErrors es) => HasAccuracy (CollectErrors es a) Source # | |
Defined in AERN2.MP.Accuracy Methods getAccuracy :: CollectErrors es a -> Accuracy Source # getFiniteAccuracy :: CollectErrors es a -> Accuracy Source # |
iterateUntilAccurate :: HasAccuracy t => Accuracy -> (Precision -> Maybe t) -> [(Precision, Maybe t)] Source #
convergentList2seqByAccuracy :: HasAccuracy t => [t] -> Accuracy -> t Source #
seqByPrecision2seqByAccuracy :: HasAccuracy t => (Precision -> t) -> Accuracy -> t Source #
setPrecisionAtLeastAccuracy :: (HasPrecision t, CanSetPrecision t) => Accuracy -> t -> t Source #
Change the precision so that it is at least as high as the supplied accuracy (assuming the accuracy is finite).
class ShowWithAccuracy t where Source #
Methods
showWithAccuracy :: Accuracy -> t -> String Source #
Instances
ShowWithAccuracy MPBall Source # | |
Defined in AERN2.MP.Ball.Type |
class HasApproximate t where Source #
An unsafe approximation of an enclosure or exact value, useful mainly for showing something brief and readable to humans.
Associated Types
type Approximate t Source #
Methods
getApproximate :: Accuracy -> t -> Approximate t Source #
Instances
HasApproximate MPBall Source # | |||||
Defined in AERN2.MP.Ball.Type Associated Types
Methods getApproximate :: Accuracy -> MPBall -> Approximate MPBall Source # |