| Copyright | (c) Michal Konecny |
|---|---|
| License | BSD3 |
| Maintainer | mikkonecny@gmail.com |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell98 |
AERN2.MP.Enclosure
Contents
Description
Enclosure classes and operations.
Synopsis
- class IsBall t where
- type CentreType t
- class IsInterval i e where
- intervalFunctionByEndpoints :: (IsInterval t t, HasEqCertainly t t) => (t -> t) -> t -> t
- intervalFunctionByEndpointsUpDown :: IsInterval t e => (e -> e) -> (e -> e) -> t -> t
- class CanTestContains dom e where
- class CanMapInside dom e where
- specCanMapInside :: (CanMapInside d e, CanTestContains d e, Arbitrary d, Arbitrary e, Show d, Show e) => T d -> T e -> Spec
- class CanIntersectAsymmetric e1 e2 where
- type IntersectionType e1 e2
- type CanIntersect e1 e2 = (CanIntersectAsymmetric e1 e2, CanIntersectAsymmetric e1 e2, IntersectionType e1 e2 ~ IntersectionType e2 e1)
- type CanIntersectCNBy e1 e2 = (CanIntersect e1 e2, IntersectionType e1 e2 ~ EnsureCN e1, CanIntersect (EnsureCN e1) e2, IntersectionType (EnsureCN e1) e2 ~ EnsureCN e1)
- type CanIntersectCNSameType e1 = (CanIntersectCNBy e1 e1, CanIntersect (EnsureCN e1) (EnsureCN e1), IntersectionType (EnsureCN e1) (EnsureCN e1) ~ EnsureCN e1)
- class CanUnionAsymmetric e1 e2 where
- type UnionType e1 e2
- type CanUnion e1 e2 = (CanUnionAsymmetric e1 e2, CanUnionAsymmetric e1 e2, UnionType e1 e2 ~ UnionType e2 e1)
- type CanUnionCNBy e1 e2 = (CanUnion e1 e2, UnionType e1 e2 ~ EnsureCN e1, CanUnion (EnsureCN e1) e2, UnionType (EnsureCN e1) e2 ~ EnsureCN e1)
- type CanUnionCNSameType e1 = (CanUnionCNBy e1 e1, CanUnion (EnsureCN e1) (EnsureCN e1), UnionType (EnsureCN e1) (EnsureCN e1) ~ EnsureCN e1)
Documentation
Minimal complete definition
Associated Types
type CentreType t #
Methods
centre :: t -> CentreType t #
centreAsBallAndRadius :: t -> (t, ErrorBound) #
centreAsBall :: t -> t #
radius :: t -> ErrorBound #
updateRadius :: (ErrorBound -> ErrorBound) -> t -> t #
makeExactCentre :: IsBall t => t -> t #
When the radius of the ball is implicitly contributed to by imprecision in the centre (eg if the centre is a polynomial with inexact coefficients), move all that imprecision to the explicit radius, making the centre exact. This may lose some information, but as a ball is equivalent to the original. For MPBall this function is pointless because it is equivalent to the identity.
Instances
| IsBall MPBall # | |
Defined in AERN2.MP.UseMPFR.Ball.Type Associated Types type CentreType MPBall :: * # Methods centre :: MPBall -> CentreType MPBall # centreAsBallAndRadius :: MPBall -> (MPBall, ErrorBound) # centreAsBall :: MPBall -> MPBall # radius :: MPBall -> ErrorBound # updateRadius :: (ErrorBound -> ErrorBound) -> MPBall -> MPBall # makeExactCentre :: MPBall -> MPBall # | |
class IsInterval i e where #
Minimal complete definition
Instances
| IsInterval MPBall MPFloat # | |
| IsInterval MPBall MPBall # | |
Arguments
| :: (IsInterval t t, HasEqCertainly t t) | |
| => (t -> t) |
|
| -> t -> t |
|
Computes a *monotone* ball function f on intervals using the interval endpoints.
intervalFunctionByEndpointsUpDown #
Arguments
| :: IsInterval t e | |
| => (e -> e) |
|
| -> (e -> e) |
|
| -> t -> t |
|
Computes a *monotone* ball function f on intervals using the interval endpoints.
class CanTestContains dom e where #
Minimal complete definition
class CanMapInside dom e where #
Minimal complete definition
Methods
Arguments
| :: dom | dom |
| -> e | e |
| -> e |
Return some value contained in dom.
The returned value does not have to equal the given e
even if e is already inside dom.
All elements of dom should be covered with roughly the same probability
when calling this function for evenly distributed e's.
This function is intended mainly for generating values inside dom
for randomised tests.
specCanMapInside :: (CanMapInside d e, CanTestContains d e, Arbitrary d, Arbitrary e, Show d, Show e) => T d -> T e -> Spec #
class CanIntersectAsymmetric e1 e2 where #
Minimal complete definition
Associated Types
type IntersectionType e1 e2 #
Methods
intersect :: e1 -> e2 -> IntersectionType e1 e2 #
Instances
type CanIntersect e1 e2 = (CanIntersectAsymmetric e1 e2, CanIntersectAsymmetric e1 e2, IntersectionType e1 e2 ~ IntersectionType e2 e1) #
type CanIntersectCNBy e1 e2 = (CanIntersect e1 e2, IntersectionType e1 e2 ~ EnsureCN e1, CanIntersect (EnsureCN e1) e2, IntersectionType (EnsureCN e1) e2 ~ EnsureCN e1) #
type CanIntersectCNSameType e1 = (CanIntersectCNBy e1 e1, CanIntersect (EnsureCN e1) (EnsureCN e1), IntersectionType (EnsureCN e1) (EnsureCN e1) ~ EnsureCN e1) #
class CanUnionAsymmetric e1 e2 where #
Minimal complete definition
Instances
| CanUnionAsymmetric MPBall MPBall # | |
| (CanUnionAsymmetric MPBall b, CanEnsureCE es b, CanEnsureCE es (UnionType MPBall b), SuitableForCE es) => CanUnionAsymmetric MPBall (CollectErrors es b) # | |
Defined in AERN2.MP.UseMPFR.Ball.Comparisons Associated Types type UnionType MPBall (CollectErrors es b) :: * # Methods union :: MPBall -> CollectErrors es b -> UnionType MPBall (CollectErrors es b) # | |
| (CanUnionAsymmetric e1 e2, CanEnsureCN e1, CanEnsureCN e2, CanEnsureCN (UnionType e1 e2)) => CanUnionAsymmetric (CN e1) (CN e2) # | |
| (CanUnionAsymmetric a MPBall, CanEnsureCE es a, CanEnsureCE es (UnionType a MPBall), SuitableForCE es) => CanUnionAsymmetric (CollectErrors es a) MPBall # | |
Defined in AERN2.MP.UseMPFR.Ball.Comparisons Associated Types type UnionType (CollectErrors es a) MPBall :: * # Methods union :: CollectErrors es a -> MPBall -> UnionType (CollectErrors es a) MPBall # | |
| (Arrow to, CanUnionAsymmetric e1 e2) => CanUnionAsymmetric (to Accuracy e1) (to Accuracy e2) # | |
type CanUnion e1 e2 = (CanUnionAsymmetric e1 e2, CanUnionAsymmetric e1 e2, UnionType e1 e2 ~ UnionType e2 e1) #
type CanUnionCNBy e1 e2 = (CanUnion e1 e2, UnionType e1 e2 ~ EnsureCN e1, CanUnion (EnsureCN e1) e2, UnionType (EnsureCN e1) e2 ~ EnsureCN e1) #
type CanUnionCNSameType e1 = (CanUnionCNBy e1 e1, CanUnion (EnsureCN e1) (EnsureCN e1), UnionType (EnsureCN e1) (EnsureCN e1) ~ EnsureCN e1) #
Orphan instances
| (CanUnionCNSameType t, CanEnsureCN t) => HasIfThenElse (Maybe Bool) t # | |
Associated Types type IfThenElseType (Maybe Bool) t :: * # Methods ifThenElse :: Maybe Bool -> t -> t -> IfThenElseType (Maybe Bool) t # | |