AERN-Real-0.9.7.1: arbitrary precision interval arithmetic for approximating exact real numbers

Portabilityportable
Stabilityexperimental
Maintainermik@konecny.aow.cz

Data.Number.ER.Real.DomainBox

Description

Abstractions of the Box datatype, often used to represent sections of multi-dimensional function domains.

To be imported qualified, usually with prefix DBox.

VariableID(..) and DomainBox are usually imported separately and not qualified.

Synopsis

Documentation

class Ord varid => VariableID varid whereSource

A class abstracting a type of variable identifiers for axes in function domains, polynomials etc.

Methods

newVarID :: Set varid -> varidSource

defaultVar :: varidSource

showVar :: varid -> StringSource

Instances

class VariableID varid => DomainBox box varid val | box -> varid val, varid val -> box whereSource

A class abstracting a type of many-dimensional points, intervals or anything indexed by a subset of dimensions.

More generally, this class abstracts most of Data.Map.Map.

Methods

noinfo :: boxSource

isNoinfo :: box -> BoolSource

unary :: val -> boxSource

constructor using defaultVar

singleton :: varid -> val -> boxSource

toList :: box -> [(varid, val)]Source

fromList :: [(varid, val)] -> boxSource

toAscList :: box -> [(varid, val)]Source

fromAscList :: [(varid, val)] -> boxSource

insert :: varid -> val -> box -> boxSource

insertWith :: (val -> val -> val) -> varid -> val -> box -> boxSource

delete :: varid -> box -> boxSource

member :: varid -> box -> BoolSource

notMember :: varid -> box -> BoolSource

union :: box -> box -> boxSource

unionWith :: (val -> val -> val) -> box -> box -> boxSource

keys :: box -> [varid]Source

elems :: box -> [val]Source

filter :: (val -> Bool) -> box -> boxSource

fold :: (val -> a -> a) -> a -> box -> aSource

foldWithKey :: (varid -> val -> a -> a) -> a -> box -> aSource

zipWith :: (val -> val -> a) -> box -> box -> [(varid, a)]Source

for all variables that appear in both boxes, apply the function and add the result to the list

zipWithDefault :: val -> (val -> val -> a) -> box -> box -> [(varid, a)]Source

For all variables that appear in either of the two boxes, apply the function and add the result to the list.

Supply the default value when the variable is missing from either box.

zipWithDefaultSecond :: val -> (val -> val -> a) -> box -> box -> [(varid, a)]Source

For all variables that appear in the first box, apply the function and add the result to the list.

Supply the default value when the variable is missing from the second box.

findWithDefault :: val -> varid -> box -> valSource

lookupSource

Arguments

:: String

identification of caller location to use in error messages

-> varid 
-> box 
-> val 

Pick the extents of a single variable in a domain box. If there is no information for this variable, assume the variable ranges over the whole real line.

Instances

Show val => DomainBox (Box val) VarID val 

class (DomainBox box1 varid val1, DomainBox box2 varid val2) => DomainBoxMappable box1 box2 varid val1 val2 whereSource

A class linking two domain box types that share the index type so that boxes of the two types can be converted etc.

Methods

map :: (val1 -> val2) -> box1 -> box2Source

mapWithKey :: (varid -> val1 -> val2) -> box1 -> box2Source

intersectionWith :: (val1 -> val2 -> val1) -> box1 -> box2 -> box1Source

difference :: box1 -> box2 -> box1Source

Instances

(Show val1, Show val2) => DomainBoxMappable (Box val1) (Box val2) VarID val1 val2 

class DomainBox box varid ira => DomainIntBox box varid ira | box -> varid ira, varid ira -> box whereSource

A class abstracting a type of many-dimensional intervals.

Methods

compatible :: box -> box -> BoolSource

Check whether the two domains specify the same interval for each variable that they share.

unifySource

Arguments

:: String

identification of caller location to use in error messages

-> box 
-> box 
-> box 

Assuming that two domains are compatible, take the most information from both of the domains about the ranges of variables.

bestSplit :: box -> (varid, ira)Source

Find the variable with the largest interval and return it together with the default splitting point in its domain.

split :: box -> varid -> ira -> (box, box)Source

classifyPositionSource

Arguments

:: box

domain d1

-> box

domain d2

-> (Bool, Bool, Bool, Bool)

Answers to these (mutually exclusive) questions:

  • is d1 outside and not touching d2?
  • is d1 outside and touching d2?
  • is d1 intersecting and not inside d2?
  • is d1 inside d2?

Instances

ERIntApprox ira => DomainIntBox (Box ira) VarID ira