|
| template<typename T> |
| boost_interval_t< T > | to_boost_ (const Interval< T > &a) |
| | Convert a sigma::Interval into the boost interval it wraps.
|
| template<typename T> |
| Interval< T > | from_boost_ (const boost_interval_t< T > &x) |
| | Convert a boost interval into a sigma::Interval.
|
| template<typename T> |
| void | assert_within_unit_ (const Interval< T > &a, bool open, const std::string &name) |
| | Throws unless every value in a lies in the unit interval.
|
| template<typename T> |
| boost_interval_t< T > | to_boost_ (const GeneralInterval< T > &a) |
| | Convert a sigma::GeneralInterval into a boost interval.
|
| template<typename T> |
| GeneralInterval< T > | general_from_boost_ (const boost_interval_t< T > &x, bool left_open=false, bool right_open=false) |
| | Convert a boost interval into a sigma::GeneralInterval.
|
| template<typename T> |
| void | assert_within_unit_ (const GeneralInterval< T > &a, bool open, const std::string &name) |
| | Throws unless every value in a lies in the unit interval.
|
| template<typename T> |
| std::pair< bool, bool > | integer_pow_openness_ (const GeneralInterval< T > &a, long long n) |
| | The openness of the bounds of pow(a, n) for a positive integer n.
|
| template<typename T, typename U> |
| boost_interval_t< T > | exponent_interval_ (const U &exp) |
| | The exponent of a non-integer pow(), as an interval.
|
| template<typename IntervalType> |
| Triplex< IntervalType > | make_triplex_ (IntervalType bounds, typename IntervalType::value_t nominal) |
| | Assembles a triplex from the result of an operation.
|
| template<typename IntervalType, typename BoundsFunction, typename NominalFunction> |
| Triplex< IntervalType > | apply_unary_ (const Triplex< IntervalType > &a, BoundsFunction &&bounds_fxn, NominalFunction &&nominal_fxn) |
| | Applies a unary function to a triplex.
|
| template<typename T> |
| void | inplace_unary (Uncertain< T > &c, T mean, T dcda) |
| | Generalized Inplace Unary Changes.
|
| template<typename T> |
| Uncertain< T > | unary_result (const Uncertain< T > &a, T mean, T dcda) |
| | Generalized Unary Changes.
|
| template<typename T> |
| void | inplace_binary (Uncertain< T > &c, const Uncertain< T > &b, T mean, T dcda, T dcdb) |
| | Generalized Inplace Binary Changes.
|
| template<typename FunctionType, typename NumericType> |
| NumericType | numeric_derivative (FunctionType f, NumericType a) |
| | Compute the numeric derivative of a function.
|
The namespace that contains the implementation details of the library.
This is the namespace details not intended for user interaction.
template<typename T>
| void sigma::detail_::assert_within_unit_ |
( |
const GeneralInterval< T > & | a, |
|
|
bool | open, |
|
|
const std::string & | name ) |
Throws unless every value in a lies in the unit interval.
The openness-aware counterpart of the Interval overload. Whether a bound at plus or minus one is in domain depends on both open and the openness of that bound, since an open bound is not a value the interval contains: \( (-1, 1) \) is an acceptable argument to the inverse hyperbolic tangent, and \( [-1, 1] \) is not.
- Template Parameters
-
| T | The value type of the interval. |
- Parameters
-
| [in] | a | The interval to check. Must not be empty. |
| [in] | open | Is the domain the open unit interval? False for the closed one. |
| [in] | name | The name of the function being checked, for the error message. |
- Exceptions
-
| std::domain_error | if a contains a value outside the domain. Strong throw guarantee. |
| std::domain_error | if a is empty. Strong throw guarantee. |
template<typename T>
| void sigma::detail_::assert_within_unit_ |
( |
const Interval< T > & | a, |
|
|
bool | open, |
|
|
const std::string & | name ) |
Throws unless every value in a lies in the unit interval.
Code factorization for the three functions whose domain is the unit interval: arcsine and arccosine take the closed \( [-1, 1] \), and the inverse hyperbolic tangent the open \( (-1, 1) \). The bounds of a are members of it, so for the open domain a bound at plus or minus one is out of domain.
- Template Parameters
-
| T | The value type of the interval. |
- Parameters
-
| [in] | a | The interval to check. Must not be empty. |
| [in] | open | Is the domain the open unit interval? False for the closed one. |
| [in] | name | The name of the function being checked, for the error message. |
- Exceptions
-
| std::domain_error | if a contains a value outside the domain. Strong throw guarantee. |
| std::domain_error | if a is empty. Strong throw guarantee. |
template<typename T, typename U>
The exponent of a non-integer pow(), as an interval.
Converting exp to the interval's value type may not be exact, e.g., when a double exponent is applied to an IFloat. When it is not, the exponent is widened to the pair of representable values bracketing it so the enclosure remains valid.
- Template Parameters
-
| T | The value type of the interval. |
| U | The numeric type of the exponent. |
- Parameters
-
| [in] | exp | The exponent to convert. |
- Returns
- An interval containing
exp.
- Exceptions
-
template<typename IntervalType>
| Triplex< IntervalType > sigma::detail_::make_triplex_ |
( |
IntervalType | bounds, |
|
|
typename IntervalType::value_t | nominal ) |
Assembles a triplex from the result of an operation.
Every operation on a triplex computes its bounds and its nominal value separately and then hands them to this function, which applies the widening rule: a finite nominal that is not a member of bounds widens bounds to include it. The nominal value itself is never moved. A non-finite nominal is kept as is and bounds are left alone, so the result does not satisfy the class invariant, which is exactly what happens in ordinary floating point.
- Template Parameters
-
| IntervalType | The interval type of the triplex. |
- Parameters
-
| [in] | bounds | The bounds the interval operation produced. |
| [in] | nominal | The nominal value the scalar operation produced. |
- Returns
- The triplex with nominal value
nominal and bounds bounds, widened if needed.
- Exceptions
-