| Copyright | (c) Michal Konecny |
|---|---|
| License | BSD3 |
| Maintainer | mikkonecny@gmail.com |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell98 |
AERN2.MP.Accuracy
Description
A type for roughly measuring the accuracy of an enclosure.
Synopsis
- data Accuracy
- bits :: ConvertibleExactly t Accuracy => t -> Accuracy
- fromAccuracy :: Accuracy -> Integer
- class HasAccuracy a where
- getAccuracy :: a -> Accuracy
- class HasAccuracyGuide a where
- getAccuracyGuide :: a -> Accuracy
- class HasAccuracyGuide a => CanSetAccuracyGuide a where
- setAccuracyGuide :: Accuracy -> a -> a
- adjustAccuracyGuide :: CanSetAccuracyGuide a => (Accuracy -> Accuracy) -> a -> a
- getFiniteAccuracy :: (HasAccuracy t, HasPrecision t) => t -> Accuracy
- ac2prec :: Accuracy -> Precision
- class CanReduceSizeUsingAccuracyGuide t where
- reduceSizeUsingAccuracyGuide :: Accuracy -> t -> t
- specCanReduceSizeUsingAccuracyGuide :: (CanReduceSizeUsingAccuracyGuide t, HasEqCertainly t t, Arbitrary t, Show t) => T t -> Spec
- iterateUntilAccurate :: HasAccuracy t => Accuracy -> (Precision -> Maybe t) -> [(Precision, Maybe t)]
- convergentList2CauchySeq :: HasAccuracy t => [t] -> Accuracy -> t
- seqByPrecision2CauchySeq :: HasAccuracy t => (Precision -> t) -> Accuracy -> t
- setPrecisionAtLeastAccuracy :: CanSetPrecision t => Accuracy -> t -> t
- 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
bits :: ConvertibleExactly t Accuracy => t -> Accuracy #
fromAccuracy :: Accuracy -> Integer #
class HasAccuracy a where #
Methods
getAccuracy :: a -> Accuracy #
Instances
class HasAccuracyGuide a where #
Methods
getAccuracyGuide :: a -> Accuracy #
class HasAccuracyGuide a => CanSetAccuracyGuide a where #
Methods
setAccuracyGuide :: Accuracy -> a -> a #
adjustAccuracyGuide :: CanSetAccuracyGuide a => (Accuracy -> Accuracy) -> a -> a #
getFiniteAccuracy :: (HasAccuracy t, HasPrecision t) => t -> Accuracy #
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.
class CanReduceSizeUsingAccuracyGuide t where #
Methods
reduceSizeUsingAccuracyGuide :: Accuracy -> t -> t #
Instances
| CanReduceSizeUsingAccuracyGuide MPBall # | |
Defined in AERN2.MP.Ball.Type Methods reduceSizeUsingAccuracyGuide :: Accuracy -> MPBall -> MPBall # | |
specCanReduceSizeUsingAccuracyGuide :: (CanReduceSizeUsingAccuracyGuide t, HasEqCertainly t t, Arbitrary t, Show t) => T t -> Spec #
iterateUntilAccurate :: HasAccuracy t => Accuracy -> (Precision -> Maybe t) -> [(Precision, Maybe t)] #
convergentList2CauchySeq :: HasAccuracy t => [t] -> Accuracy -> t #
seqByPrecision2CauchySeq :: HasAccuracy t => (Precision -> t) -> Accuracy -> t #
setPrecisionAtLeastAccuracy :: CanSetPrecision t => Accuracy -> t -> t #
Change the precision so that it is at least as high as the supplied accuracy (assuming the accuracy is finite).
class HasApproximate t where #
An unsafe approximation of an enclosure or exact value, useful mainly for showing something brief and readable to humans.
Associated Types
type Approximate t #
Methods
getApproximate :: Accuracy -> t -> Approximate t #
Instances
| HasApproximate MPBall # | |
Defined in AERN2.MP.Ball.Type Associated Types type Approximate MPBall :: Type # Methods getApproximate :: Accuracy -> MPBall -> Approximate MPBall # | |