Copyright | (c) Michal Konecny |
---|---|
License | BSD3 |
Maintainer | mikkonecny@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
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.
Instances
fromAccuracy :: Accuracy -> Integer Source #
class HasAccuracy a where Source #
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
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 #
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.
type Approximate t Source #
getApproximate :: Accuracy -> t -> Approximate t Source #
Instances
HasApproximate MPBall Source # | |
Defined in AERN2.MP.Ball.Type type Approximate MPBall Source # getApproximate :: Accuracy -> MPBall -> Approximate MPBall Source # |