Portability | portable |
---|---|
Stability | experimental |
Maintainer | mik@konecny.aow.cz |
Approximation of a real functions with rectangular domains.
To be imported qualified, usually with the synonym FA.
- class (ERApprox fa, ERIntApprox fa, ERIntApprox domra, ERIntApprox ranra, DomainBox box varid domra) => ERFnApprox box varid domra ranra fa | fa -> box varid domra ranra where
- check :: String -> fa -> fa
- domra2ranra :: fa -> domra -> ranra
- ranra2domra :: fa -> ranra -> domra
- getDegree :: fa -> Int
- setMaxDegree :: Int -> fa -> fa
- getMaxDegree :: fa -> Int
- getSize :: fa -> Int
- setMaxSize :: Int -> fa -> fa
- getMaxSize :: fa -> Int
- getVariables :: fa -> [varid]
- getBestPrecision :: fa -> Precision
- getRangeApprox :: fa -> ranra
- tuple :: [fa] -> fa
- getTupleSize :: fa -> Int
- applyTupleFn :: ([fa] -> [fa]) -> fa -> fa
- volume :: fa -> ranra
- scale :: ranra -> fa -> fa
- partialIntersect :: EffortIndex -> box -> fa -> fa -> fa
- intersectMeasureImprovement :: EffortIndex -> fa -> fa -> (fa, ranra)
- eval :: box -> fa -> [ranra]
- partialEval :: box -> fa -> fa
- composeNonDecreasing :: fa -> varid -> fa -> fa
- composeNonIncreasing :: fa -> varid -> fa -> fa
- class (ERFnApprox box varid domra ranra fa, DomainIntBox box varid domra) => ERFnDomApprox box varid domra ranra fa | fa -> box varid domra ranra where
- bottomApprox :: box -> Int -> fa
- const :: box -> [ranra] -> fa
- proj :: box -> varid -> fa
- dom :: fa -> box
- bisect :: varid -> Maybe domra -> fa -> (fa, fa)
- unBisect :: varid -> (fa, fa) -> fa
- integrate :: EffortIndex -> fa -> varid -> box -> domra -> fa -> fa
- integrateUnary :: EffortIndex -> fa -> domra -> domra -> [ranra] -> fa
- integrateMeasureImprovement :: EffortIndex -> fa -> varid -> box -> domra -> fa -> (fa, fa)
- integrateMeasureImprovementUnary :: EffortIndex -> fa -> domra -> domra -> fa -> (fa, fa)
- bisectUnbisectDepth :: ERFnDomApprox box varid domra ranra fa => Int -> fa -> fa
- keyPointsConsistencyCheck :: ERFnDomApprox box varid domra ranra fa => (box -> ranra) -> fa -> [(box, ranra, ranra)]
- keyPointsPointwiseConsistencyCheck :: ERFnDomApprox box varid domra ranra fa => ([ranra] -> ranra) -> [fa] -> fa -> [(box, ranra, ranra)]
- class (ERIntApprox domra, ERApproxApprox ranraa, DomainBox box varid domra) => ERFnApproxApprox box varid domra ranraa fa | fa -> box varid domra ranraa where
- evalAA :: box -> fa -> [ranraa]
Documentation
class (ERApprox fa, ERIntApprox fa, ERIntApprox domra, ERIntApprox ranra, DomainBox box varid domra) => ERFnApprox box varid domra ranra fa | fa -> box varid domra ranra whereSource
A class of types that approximate first-order real functions
R^n -> R^m
using some type of graph enclosures. The domains
of the functions can be neither specified nor investigated
by operations in this class.
This class extends ERApprox
so that we could perform point-wise
operations on the functions.
This class is associated with:
- two real number types (instances of
ERIntApprox
) for working with parts of the function's domain and range; - a type of boxes indexed by variables (instance of
DomainBox
) for working with multiple-dimension function domains.
:: String | indentification of caller location for easier debugging |
-> fa | |
-> fa |
Check internal consistency and report problem if any.
:: fa | this parameter is not used except for type checking |
-> domra | |
-> ranra |
:: fa | this parameter is not used except for type checking |
-> ranra | |
-> domra |
Get the internal degree of quality (usually polynomial degree) of the approximation.
setMaxDegree :: Int -> fa -> faSource
Set an upper bound on the degree of this function approximation.
This reduces the degree immediately if necessary and also affects all operations performed with this value later.
May also set the maximum size of the approximations to a default based on the degree and the dimension of this enclosure.
getMaxDegree :: fa -> IntSource
Get the current uppend bound on the degree associated with this function approximation.
Get the internal size of the approximation (usually number of polynomial terms).
setMaxSize :: Int -> fa -> faSource
Set an upper bound on the size of this function approximation.
This reduces the size immediately if necessary and also affects all operations performed with this value later.
getMaxSize :: fa -> IntSource
Get the current uppend bound on the size associated with this function approximation.
getVariables :: fa -> [varid]Source
List all variables that are actually used in the approximation.
getBestPrecision :: fa -> PrecisionSource
Give a close upper bound of the precision of the range at the best approximated point in the domain.
getRangeApprox :: fa -> ranraSource
Find some upper and lower bounds of the function over [-1,1]^n
.
Combine several functions with the same domain into one tuple function.
getTupleSize :: fa -> IntSource
Reveal how many functions are bundled together.
applyTupleFn :: ([fa] -> [fa]) -> fa -> faSource
Modify a tuple of functions in a way that does not treat the tuple elements uniformly.
Find close upper and lower bounds of the volume of the entire enclosure. A negative volume means that the enclosure is certainly inconsistent.
scale :: ranra -> fa -> faSource
Multiply a function approximation by a real number approximation.
:: EffortIndex | |
-> box | the subdomain; defined by clipping the range of some variables |
-> fa | the enclosure to be used on the subdomain (but defined on the whole domain) |
-> fa | function to improve by intersecting its subdomain |
-> fa |
Intersect one approximation by another but only on a box within its domain.
intersectMeasureImprovementSource
:: EffortIndex | |
-> fa | |
-> fa | |
-> (fa, ranra) | enclosure intersection and measurement of improvement analogous to the one
returned by pointwise |
Intersect two enclosures and measure the global improvement as one number.
(Use intersectMeasureImprovement
defined in module Data.Number.ER.Real.Approx
to measure the improvement using a function enclosure.)
eval :: box -> fa -> [ranra]Source
Evaluate the function at the given point.
partialEval :: box -> fa -> faSource
Fix some variables in the function to the given exact values.
:: fa | enclosure of |
-> varid | variable |
-> fa | enclosure of |
-> fa | enclosure of BEWARE: Enclosure is probably incorrect where values of
|
A simple and limited composition of functions applicable only when the range-defining function is non-decreasing.
:: fa | enclosure of |
-> varid | variable |
-> fa | enclosure of |
-> fa | enclosure of BEWARE: Enclosure is probably incorrect where values of
|
A simple and limited composition of functions applicable only when the range-defining function is non-increasing.
(ERUnitFnBaseElementary boxb boxra varid b ra fb, Show varid, Show boxra) => ERFnApprox boxra varid ra ra (ERFnInterval fb) | |
ERFnDomApprox box varid domra ranra fa => ERFnApprox box varid domra ranra (ERFnTuple fa) | |
(ERUnitFnBaseElementary boxb boxra varid b ra fb, ERUnitFnBaseIElementary boxb boxra varid b ra fb, Show varid, Show boxra) => ERFnApprox boxra varid ra ra (ERFnIntervalOI fb) | |
(ERFnDomApprox box varid domra ranra fa, VariableID varid, Show box) => ERFnApprox box varid domra ranra (ERFnDomEdgesApprox varid fa) | |
(ERUnitFnApprox box varid domra ranra ufa, DomainBoxMappable dtrbox box varid (DomTransl domra) domra, DomainIntBox box varid domra, Show varid, Show box, DomainBoxMappable box dtrbox varid domra (DomTransl domra), Eq dtrbox, Ord dtrbox) => ERFnApprox box varid domra ranra (ERFnDomTranslApprox dtrbox varid ufa domra) | |
(ERFnDomApprox box varid domra ranra fa, ERIntApprox fa, DomainBoxMappable box box varid domra domra, Show box) => ERFnApprox box varid domra ranra (ERFnPiecewise box varid domra fa) |
class (ERFnApprox box varid domra ranra fa, DomainIntBox box varid domra) => ERFnDomApprox box varid domra ranra fa | fa -> box varid domra ranra whereSource
This class extends ERFnApprox
by:
- making the domain of the function enclosure available for inspection;
- allowing the construction of basic function enclosures where the domain has to be specified.
:: box | the domain of the function |
-> Int | how many functions are bundled in this tuple |
-> fa |
A function enclosure with no information about the function's values.
const :: box -> [ranra] -> faSource
Construct a constant enclosure for a tuple of functions.
proj :: box -> varid -> faSource
Construct the exact enclosure for a projection function (ie a variable).
Return the domain of the function enclosure.
:: varid | variable (axis) to split on |
-> Maybe domra | where exactly to split (this has to be exact) |
-> fa | |
-> (fa, fa) |
Split the domain into two halves, yoelding two function enclosures.
:: varid | variable (axis) to glue on |
-> (fa, fa) | |
-> fa |
Merge function enclosures with neighbouring domains.
:: EffortIndex | how hard to try |
-> fa | function to integrate |
-> varid |
|
-> box | integration range |
-> domra | origin in terms of |
-> fa | values at origin |
-> fa |
Safely integrate a R^n -> R^m
function enclosure
with some initial condition (origin and function at origin).
:: EffortIndex | how hard to try |
-> fa | unary function to integrate |
-> domra | integration range |
-> domra | origin |
-> [ranra] | values at origin |
-> fa |
Safely integrate a R -> R^m
function enclosure.
integrateMeasureImprovementSource
:: EffortIndex | how hard to try |
-> fa | function to integrate |
-> varid | variable to integrate by |
-> box | integration domain |
-> domra | a sub-domain with relevant new information - either about initial value(s) or about derivative |
-> fa | approximation to result, including initial value(s) |
-> (fa, fa) | improved result and measurement of improvement analogous to the one
returned by pointwise |
Safely integrate a R^n -> R^m
function enclosure
intersecting it with a prior enclosure for the result.
The prior enclosure could contains one of more initial value.
integrateMeasureImprovementUnarySource
:: EffortIndex | how hard to try |
-> fa | unary function to integrate |
-> domra | integration domain |
-> domra | a sub-domain with relevant new information - either about initial value(s) or about derivative |
-> fa | approximation to result, including initial value(s) |
-> (fa, fa) | improved result and measurement of improvement analogous to the one
returned by pointwise |
Safely integrate a R -> R^m
function enclosure
intersecting it with a prior enclosure for the result.
The prior enclosure could contains one of more initial value.
ERFnDomApprox box varid domra ranra fa => ERFnDomApprox box varid domra ranra (ERFnTuple fa) | |
(ERFnDomApprox box varid domra ranra fa, VariableID varid, Show box) => ERFnDomApprox box varid domra ranra (ERFnDomEdgesApprox varid fa) | |
(ERUnitFnApprox box varid domra ranra ufa, DomainIntBox box varid domra, Show varid, Show box, DomainBoxMappable dtrbox box varid (DomTransl domra) domra, DomainBoxMappable box dtrbox varid domra (DomTransl domra), Eq dtrbox, Ord dtrbox) => ERFnDomApprox box varid domra ranra (ERFnDomTranslApprox dtrbox varid ufa domra) | |
(ERFnDomApprox box varid domra ranra fa, ERIntApprox fa, Show box, DomainBoxMappable box box varid domra domra) => ERFnDomApprox box varid domra ranra (ERFnPiecewise box varid domra fa) |
:: ERFnDomApprox box varid domra ranra fa | |
=> Int | required depth of bisection |
-> fa | |
-> fa |
Recursively perform a number of bisections and then glue the bits back together.
This way we can ensure that a piece-wise enclosure has a partition that goes to at least the given depth.
keyPointsConsistencyCheckSource
:: ERFnDomApprox box varid domra ranra fa | |
=> (box -> ranra) | function |
-> fa | alleged approximation of |
-> [(box, ranra, ranra)] |
Check that a function approximation is consistent with a real function that is meant to compute the same function.
The result of this function is the list of points in which the consistency check failed. The result of the operation is also included both for the real number version and the function approximation version.
keyPointsPointwiseConsistencyCheckSource
:: ERFnDomApprox box varid domra ranra fa | |
=> ([ranra] -> ranra) | function |
-> [fa] | approximations of input functions |
-> fa | alleged approximation of |
-> [(box, ranra, ranra)] |
Check that a pointwise operation previously performed on function approximations is consistent with the same operation performed on selected points in the domain of these functions. The selected points are the centres of all faces of all dimensions, which includes the corners.
The result of this function is the list of points in which the consistency check failed. The result of the operation is also included both for the real number version and the function approximation version.
class (ERIntApprox domra, ERApproxApprox ranraa, DomainBox box varid domra) => ERFnApproxApprox box varid domra ranraa fa | fa -> box varid domra ranraa whereSource
A class of types that approximate function enclosures of first-order real functions
R^n -> R^m
eg using a pair of function enclosures. The domains
of the functions can be neither specified nor investigated
by operations in this class.
This class extends ERApproxApprox
so that we could perform point-wise
operations on the function enclosures.
This class is associated with:
- a real number type (instance of
ERIntApprox
) for working with parts of the function's domain - a real number approximation approximation for approximating the function enclosure range at an individual point or uniformly over many points;
- a type of boxes indexed by variables (instance of
DomainBox
) for working with multiple-dimension function domains.
(DomainBoxMappable box dtrbox varid domra (DomTransl domra), ERFnApproxApprox box varid domra ranraa ufa) => ERFnApproxApprox box varid domra ranraa (ERFnDomTranslApprox dtrbox varid ufa domra) | |
(ERUnitFnBaseEncl boxb boxra varid b ra fb, ERUnitFnBaseIEncl boxb boxra varid b ra fb) => ERFnApproxApprox boxra varid ra (ERApproxOI ra) (ERFnIntervalOI fb) |