Portability | portable |
---|---|
Stability | experimental |
Maintainer | mik@konecny.aow.cz |
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.
- class Ord varid => VariableID varid where
- newVarID :: Set varid -> varid
- defaultVar :: varid
- showVar :: varid -> String
- class VariableID varid => DomainBox box varid val | box -> varid val, varid val -> box where
- noinfo :: box
- isNoinfo :: box -> Bool
- unary :: val -> box
- singleton :: varid -> val -> box
- toList :: box -> [(varid, val)]
- fromList :: [(varid, val)] -> box
- toAscList :: box -> [(varid, val)]
- fromAscList :: [(varid, val)] -> box
- insert :: varid -> val -> box -> box
- insertWith :: (val -> val -> val) -> varid -> val -> box -> box
- delete :: varid -> box -> box
- member :: varid -> box -> Bool
- notMember :: varid -> box -> Bool
- union :: box -> box -> box
- unionWith :: (val -> val -> val) -> box -> box -> box
- keys :: box -> [varid]
- elems :: box -> [val]
- filter :: (val -> Bool) -> box -> box
- fold :: (val -> a -> a) -> a -> box -> a
- foldWithKey :: (varid -> val -> a -> a) -> a -> box -> a
- zipWith :: (val -> val -> a) -> box -> box -> [(varid, a)]
- zipWithDefault :: val -> (val -> val -> a) -> box -> box -> [(varid, a)]
- zipWithDefaultSecond :: val -> (val -> val -> a) -> box -> box -> [(varid, a)]
- findWithDefault :: val -> varid -> box -> val
- lookup :: String -> varid -> box -> val
- class (DomainBox box1 varid val1, DomainBox box2 varid val2) => DomainBoxMappable box1 box2 varid val1 val2 where
- map :: (val1 -> val2) -> box1 -> box2
- mapWithKey :: (varid -> val1 -> val2) -> box1 -> box2
- intersectionWith :: (val1 -> val2 -> val1) -> box1 -> box2 -> box1
- difference :: box1 -> box2 -> box1
- class DomainBox box varid ira => DomainIntBox box varid ira | box -> varid ira, varid ira -> box where
Documentation
class Ord varid => VariableID varid whereSource
A class abstracting a type of variable identifiers for axes in function domains, polynomials etc.
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
.
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
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
:: 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.
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.
map :: (val1 -> val2) -> box1 -> box2Source
mapWithKey :: (varid -> val1 -> val2) -> box1 -> box2Source
intersectionWith :: (val1 -> val2 -> val1) -> box1 -> box2 -> box1Source
difference :: box1 -> box2 -> box1Source
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.
compatible :: box -> box -> BoolSource
Check whether the two domains specify the same interval for each variable that they share.
:: 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.
ERIntApprox ira => DomainIntBox (Box ira) VarID ira |