Portability | portable |
---|---|
Stability | experimental |
Maintainer | mik@konecny.aow.cz |
A class abstracting function arithmetic with directed rounding. It is used to describe a boundary for an approximation to a real function on the interval [-1,1]^n.
To be imported qualified, usually with the synonym UFB.
Documentation
class (ERRealBase b, ERIntApprox ra, Fractional ufb, Ord ufb, DomainBox boxb varid b, DomainIntBox boxra varid ra) => ERUnitFnBase boxb boxra varid b ra ufb | ufb -> boxb boxra varid b ra whereSource
:: String | indentification of caller location for easier debugging |
-> ufb | |
-> ufb |
Check internal consistency of the function and report problem if any.
getGranularity :: ufb -> GranularitySource
setMinGranularity :: Granularity -> ufb -> ufbSource
setGranularity :: Granularity -> ufb -> ufbSource
Construct a constant function.
:: b | value at 0 |
-> Map varid b | ascent of each base vector |
-> ufb |
Construct an affine function.
scale :: b -> ufb -> (ufb, ufb)Source
Multiply a function by a scalar, rounding downwards and upwards.
scaleApprox :: ra -> ufb -> (ufb, ufb)Source
Multiply a function by an approximation of a scalar, rounding downwards and upwards.
scaleApproxDown :: ra -> ufb -> ufbSource
Multiply a function by an approximation of a scalar, rounding downwards.
scaleApproxUp :: ra -> ufb -> ufbSource
Multiply a function by an approximation of a scalar, rounding upwards.
Get the degree of this particular function.
If the function is a polynomial, this function should return its degree.
reduceDegree :: Int -> ufb -> (ufb, ufb)Source
Decrease the degree of function approximation, rounding pointwise downwards and upwards.
reduceDegreeDown :: Int -> ufb -> ufbSource
Decrease the degree of function approximation, rounding pointwise downwards.
reduceDegreeUp :: Int -> ufb -> ufbSource
Decrease the degree of function approximation, rounding pointwise upwards.
:: varid | variable to integrate by |
-> ufb | p(x) |
-> (ufb, ufb) |
Approximate the integral of p (with 0 at 0) from below and from above.
:: varid | variable to integrate by |
-> ufb | p(x) |
-> ufb |
Approximate the integral of p (with 0 at 0) from below.
:: varid | variable to integrate by |
-> ufb | p(x) |
-> ufb |
Approximate the integral of p (with 0 at 0) from above.
:: [varid] | axes to include in the measuring domain |
-> ufb | |
-> (b, b) |
Measure the volume between a function
and the zero hyperplane on the domain [-1,1]^n
.
upperBound :: EffortIndex -> ufb -> bSource
Find an upper bound of the function over [-1,1]^n
.
lowerBound :: EffortIndex -> ufb -> bSource
Find a lower bound of the function over [-1,1]^n
.
:: Int | max degree for result |
-> ufb | p(x) |
-> (ufb, ufb) |
Approximate the function max(0,p(x)) from below and from above.
:: Int | max degree for result |
-> EffortIndex | |
-> ufb | p(x) |
-> (ufb, ufb) |
Approximate the function 1/p(x) from below and from above.
recipDown :: Int -> EffortIndex -> ufb -> ufbSource
Approximate the function 1/p(x) from below.
recipUp :: Int -> EffortIndex -> ufb -> ufbSource
Approximate the function 1/p(x) from above.
:: Int | max degree for result |
-> ufb | p_1(x) |
-> ufb | p_2(x) |
-> (ufb, ufb) |
Approximate the function max(p_1(x),p_2(x)) from below and from above.
:: Int | max degree for result |
-> ufb | p_1(x) |
-> ufb | p_2(x) |
-> ufb |
Approximate the function max(p_1(x),p_2(x)) from below.
:: Int | max degree for result |
-> ufb | p_1(x) |
-> ufb | p_2(x) |
-> ufb |
Approximate the function max(p_1(x),p_2(x)) from above.
:: Int | max degree for result |
-> ufb | p_1(x) |
-> ufb | p_2(x) |
-> (ufb, ufb) |
Approximate the function min(p_1(x),p_2(x)) from below and from above.
:: Int | max degree for result |
-> ufb | p_1(x) |
-> ufb | p_2(x) |
-> ufb |
Approximate the function min(p_1(x),p_2(x)) from below.
:: Int | max degree for result |
-> ufb | p_1(x) |
-> ufb | p_2(x) |
-> ufb |
Approximate the function min(p_1(x),p_2(x)) from above.
:: Int | max degree for result |
-> EffortIndex | how hard to try when approximating exp as a polynomial |
-> ufb | p(x) |
-> (ufb, ufb) |
Approximate sqrt(p(x))
from below and from above.
:: Int | max degree for result |
-> EffortIndex | how hard to try when approximating exp as a polynomial |
-> ufb | p(x) |
-> (ufb, ufb) |
Approximate exp(p(x))
from below and from above.
:: Int | max degree for result |
-> EffortIndex | how hard to try when approximating log as a polynomial |
-> ufb | p(x) |
-> (ufb, ufb) |
Approximate log(p(x))
from below and from above.
:: Int | max degree for result |
-> EffortIndex | how hard to try when approximating sin as a polynomial |
-> ufb | p(x) |
-> (ufb, ufb) |
Approximate sin(p(x))
from below and from above.
:: Int | max degree for result |
-> EffortIndex | how hard to try when approximating cos as a polynomial |
-> ufb | p(x) |
-> (ufb, ufb) |
Approximate cos(p(x))
from below and from above.
eval :: boxb -> ufb -> (b, b)Source
Evaluate at a point, rounding upwards and downwards.
evalDown :: boxb -> ufb -> bSource
Evaluate at a point, rounding downwards.
evalUp :: boxb -> ufb -> bSource
Evaluate at a point, rounding downwards.
evalApprox :: boxra -> ufb -> raSource
Safely evaluate at a point using a real number approximation for both the point and the result.
partialEvalApprox :: boxra -> ufb -> (ufb, ufb)Source
Partially evaluate at a lower-dimensional point given using a real number approximation. Approximate the resulting function from below and from above.
partialEvalApproxDown :: boxra -> ufb -> ufbSource
Partially evaluate at a lower-dimensional point given using a real number approximation. Approximate the resulting function from below.
partialEvalApproxUp :: boxra -> ufb -> ufbSource
Partially evaluate at a lower-dimensional point given using a real number approximation. Approximate the resulting function from above.
:: Int | max degree for result |
-> ufb | function |
-> Map varid ufb | variables to substitute and for each variable |
-> (ufb, ufb) | upper and lower bounds of |
Compose two functions, rounding upwards and downwards
provided each f_v
ranges within the domain [-1,1]
.
:: Int | max degree for result |
-> ufb | function |
-> Map varid ufb | variables to substitute and for each variable |
-> ufb | a lower bound of |
Compose two functions, rounding downwards
provided each f_v
ranges within the domain [-1,1]
.
:: Int | max degree for result |
-> ufb | function |
-> Map varid ufb | variables to substitute and for each variable |
-> ufb | an upper bound of |
Compose two functions, rounding upwards
provided each f_v
ranges within the domain [-1,1]
.
:: ufb | this parameter is not used except for type checking |
-> ra | |
-> (b, b) |
Convert from the interval type to the base type. (The types are determined by the given example function.)
:: ufb | this parameter is not used except for type checking |
-> (b, b) | |
-> ra |
Convert from the base type to the interval type. (The types are determined by the given example function.)
(ERRealBase rb, RealFrac rb, DomainBox box varid Int, Ord box, DomainBoxMappable boxb boxbb varid rb [(rb, rb)], DomainBoxMappable boxra boxras varid (ERInterval rb) [ERInterval rb], DomainIntBox boxra varid (ERInterval rb)) => ERUnitFnBase boxb boxra varid rb (ERInterval rb) (ERChebPoly box rb) |