aern2-mp-0.1.2.0: Multi-precision floats via MPFR

Copyright(c) Michal Konecny
LicenseBSD3
Maintainermikkonecny@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell98

AERN2.MP.Enclosure

Contents

Description

Enclosure classes and operations.

Synopsis

Documentation

class IsBall t where #

Minimal complete definition

centre, centreAsBallAndRadius, updateRadius

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.

class IsInterval i e where #

Minimal complete definition

fromEndpoints, endpoints

Methods

fromEndpoints :: e -> e -> i #

endpoints :: i -> (e, e) #

intervalFunctionByEndpoints #

Arguments

:: (IsInterval t t, HasEqCertainly t t) 
=> (t -> t)

fThin: a version of f that works well on thin intervals

-> t -> t

f on *large* intervals

Computes a *monotone* ball function f on intervals using the interval endpoints.

intervalFunctionByEndpointsUpDown #

Arguments

:: IsInterval t e 
=> (e -> e)

fDown: a version of f working on endpoints, rounded down

-> (e -> e)

fUp: a version of f working on endpoints, rounded up

-> t -> t

f on intervals rounding *outwards*

Computes a *monotone* ball function f on intervals using the interval endpoints.

class CanTestContains dom e where #

Minimal complete definition

contains

Methods

contains #

Arguments

:: dom
dom
-> e
e
-> Bool 

Test if e is inside dom.

Instances
CanTestContains MPBall Int # 
Instance details

Defined in AERN2.MP.UseMPFR.Ball.Type

Methods

contains :: MPBall -> Int -> Bool #

CanTestContains MPBall Integer # 
Instance details

Defined in AERN2.MP.UseMPFR.Ball.Type

Methods

contains :: MPBall -> Integer -> Bool #

CanTestContains MPBall Rational # 
Instance details

Defined in AERN2.MP.UseMPFR.Ball.Type

Methods

contains :: MPBall -> Rational -> Bool #

CanTestContains MPBall Dyadic # 
Instance details

Defined in AERN2.MP.UseMPFR.Ball.Type

Methods

contains :: MPBall -> Dyadic -> Bool #

CanTestContains MPBall MPBall # 
Instance details

Defined in AERN2.MP.UseMPFR.Ball.Type

Methods

contains :: MPBall -> MPBall -> Bool #

class CanMapInside dom e where #

Minimal complete definition

mapInside

Methods

mapInside #

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.

class CanIntersectAsymmetric e1 e2 where #

Minimal complete definition

intersect

Associated Types

type IntersectionType e1 e2 #

Methods

intersect :: e1 -> e2 -> IntersectionType e1 e2 #

Instances
CanIntersectAsymmetric Bool Bool # 
Instance details

Defined in AERN2.MP.Enclosure

Associated Types

type IntersectionType Bool Bool :: * #

CanIntersectAsymmetric MPBall MPBall # 
Instance details

Defined in AERN2.MP.UseMPFR.Ball.Comparisons

Associated Types

type IntersectionType MPBall MPBall :: * #

(CanIntersectAsymmetric Bool b, CanEnsureCE es b, CanEnsureCE es (IntersectionType Bool b), SuitableForCE es) => CanIntersectAsymmetric Bool (CollectErrors es b) # 
Instance details

Defined in AERN2.MP.Enclosure

Associated Types

type IntersectionType Bool (CollectErrors es b) :: * #

(CanIntersectAsymmetric MPBall b, CanEnsureCE es b, CanEnsureCE es (IntersectionType MPBall b), SuitableForCE es) => CanIntersectAsymmetric MPBall (CollectErrors es b) # 
Instance details

Defined in AERN2.MP.UseMPFR.Ball.Comparisons

Associated Types

type IntersectionType MPBall (CollectErrors es b) :: * #

(CanIntersectAsymmetric a b, CanEnsureCN a, IntersectionType a b ~ EnsureCN a, CanEnsureCN (EnsureCN a), CanEnsureCN b, EnsureCN b ~ EnsureCN a) => CanIntersectAsymmetric (Maybe a) (Maybe b) # 
Instance details

Defined in AERN2.MP.Enclosure

Associated Types

type IntersectionType (Maybe a) (Maybe b) :: * #

Methods

intersect :: Maybe a -> Maybe b -> IntersectionType (Maybe a) (Maybe b) #

(CanIntersectAsymmetric (Maybe a) b, CanEnsureCE es b, CanEnsureCE es (IntersectionType (Maybe a) b), SuitableForCE es) => CanIntersectAsymmetric (Maybe a) (CollectErrors es b) # 
Instance details

Defined in AERN2.MP.Enclosure

Associated Types

type IntersectionType (Maybe a) (CollectErrors es b) :: * #

(CanIntersectAsymmetric a Bool, CanEnsureCE es a, CanEnsureCE es (IntersectionType a Bool), SuitableForCE es) => CanIntersectAsymmetric (CollectErrors es a) Bool # 
Instance details

Defined in AERN2.MP.Enclosure

Associated Types

type IntersectionType (CollectErrors es a) Bool :: * #

(CanIntersectAsymmetric a MPBall, CanEnsureCE es a, CanEnsureCE es (IntersectionType a MPBall), SuitableForCE es) => CanIntersectAsymmetric (CollectErrors es a) MPBall # 
Instance details

Defined in AERN2.MP.UseMPFR.Ball.Comparisons

Associated Types

type IntersectionType (CollectErrors es a) MPBall :: * #

(CanIntersectAsymmetric a (Maybe b), CanEnsureCE es a, CanEnsureCE es (IntersectionType a (Maybe b)), SuitableForCE es) => CanIntersectAsymmetric (CollectErrors es a) (Maybe b) # 
Instance details

Defined in AERN2.MP.Enclosure

Associated Types

type IntersectionType (CollectErrors es a) (Maybe b) :: * #

(CanIntersectAsymmetric e1 e2, SuitableForCE es, CanEnsureCE es e1, CanEnsureCE es e2, CanEnsureCE es (IntersectionType e1 e2)) => CanIntersectAsymmetric (CollectErrors es e1) (CollectErrors es e2) # 
Instance details

Defined in AERN2.MP.Enclosure

Associated Types

type IntersectionType (CollectErrors es e1) (CollectErrors es e2) :: * #

class CanUnionAsymmetric e1 e2 where #

Minimal complete definition

union

Associated Types

type UnionType e1 e2 #

Methods

union :: e1 -> e2 -> UnionType e1 e2 #

Instances
CanUnionAsymmetric MPBall MPBall # 
Instance details

Defined in AERN2.MP.UseMPFR.Ball.Comparisons

Associated Types

type UnionType MPBall MPBall :: * #

(CanUnionAsymmetric MPBall b, CanEnsureCE es b, CanEnsureCE es (UnionType MPBall b), SuitableForCE es) => CanUnionAsymmetric MPBall (CollectErrors es b) # 
Instance details

Defined in AERN2.MP.UseMPFR.Ball.Comparisons

Associated Types

type UnionType MPBall (CollectErrors es b) :: * #

(CanUnionAsymmetric e1 e2, CanEnsureCN e1, CanEnsureCN e2, CanEnsureCN (UnionType e1 e2)) => CanUnionAsymmetric (CN e1) (CN e2) # 
Instance details

Defined in AERN2.MP.Enclosure

Associated Types

type UnionType (CN e1) (CN e2) :: * #

Methods

union :: CN e1 -> CN e2 -> UnionType (CN e1) (CN e2) #

(CanUnionAsymmetric a MPBall, CanEnsureCE es a, CanEnsureCE es (UnionType a MPBall), SuitableForCE es) => CanUnionAsymmetric (CollectErrors es a) MPBall # 
Instance details

Defined in AERN2.MP.UseMPFR.Ball.Comparisons

Associated Types

type UnionType (CollectErrors es a) MPBall :: * #

(Arrow to, CanUnionAsymmetric e1 e2) => CanUnionAsymmetric (to Accuracy e1) (to Accuracy e2) # 
Instance details

Defined in AERN2.MP.Enclosure

Associated Types

type UnionType (to Accuracy e1) (to Accuracy e2) :: * #

Methods

union :: to Accuracy e1 -> to Accuracy e2 -> UnionType (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) #

Orphan instances

(CanUnionCNSameType t, CanEnsureCN t) => HasIfThenElse (Maybe Bool) t # 
Instance details

Associated Types

type IfThenElseType (Maybe Bool) t :: * #

Methods

ifThenElse :: Maybe Bool -> t -> t -> IfThenElseType (Maybe Bool) t #