These operators enable seamless arithmetic between UncertainValue objects and scalar or AD (Automatic Differentiation) types.
More...
|
| template<typename FP , typename T > |
| bool | mio::operator> (const UncertainValue< FP > &lhs, const T &rhs) |
| |
| template<typename FP , typename T > |
| bool | mio::operator< (const UncertainValue< FP > &lhs, const T &rhs) |
| |
| template<typename FP , typename T > |
| bool | mio::operator>= (const UncertainValue< FP > &lhs, const T &rhs) |
| |
| template<typename FP , typename T > |
| bool | mio::operator<= (const UncertainValue< FP > &lhs, const T &rhs) |
| |
| template<typename FP , typename T > |
| bool | mio::operator== (const UncertainValue< FP > &lhs, const T &rhs) |
| |
| template<typename FP , typename T > |
| bool | mio::operator!= (const UncertainValue< FP > &lhs, const T &rhs) |
| |
|
| template<typename FP , typename T > |
| bool | mio::operator> (const T &lhs, const UncertainValue< FP > &rhs) |
| |
| template<typename FP , typename T > |
| bool | mio::operator< (const T &lhs, const UncertainValue< FP > &rhs) |
| |
| template<typename FP , typename T > |
| bool | mio::operator>= (const T &lhs, const UncertainValue< FP > &rhs) |
| |
| template<typename FP , typename T > |
| bool | mio::operator<= (const T &lhs, const UncertainValue< FP > &rhs) |
| |
| template<typename FP , typename T > |
| bool | mio::operator== (const T &lhs, const UncertainValue< FP > &rhs) |
| |
| template<typename FP , typename T > |
| bool | mio::operator!= (const T &lhs, const UncertainValue< FP > &rhs) |
| |
These operators enable seamless arithmetic between UncertainValue objects and scalar or AD (Automatic Differentiation) types.
Template parameter T:
- T is any type convertible to FP (the floating-point type of UncertainValue).
- This includes scalars and AD types, as long as they can be cast to FP.
Why needed:
- UncertainValue is often used with both plain scalars (e.g., double, float, int) and AD types (e.g., active_type, AD expression templates).
- Without these operators and templated constructors, assigning or operating on UncertainValue with AD expressions or scalars would fail, as the compiler cannot automatically convert complex AD expressions to UncertainValue.
◆ Type
template<typename FP = ScalarType>
◆ deserialize()
template<typename FP = ScalarType>
template<class IOContext >
◆ draw_sample()
template<typename FP = ScalarType>
Sets the value by sampling from the distribution and returns the new value.
If no distribution is set, the value is not changed.
◆ get_distribution() [1/2]
template<typename FP = ScalarType>
Returns the parameter distribution.
If it is not set, a nullptr is returned.
◆ get_distribution() [2/2]
template<typename FP = ScalarType>
Returns the parameter distribution.
If it is not set, a nullptr is returned.
◆ operator const FP &()
template<typename FP = ScalarType>
◆ operator FP &()
template<typename FP = ScalarType>
Conversion to scalar reference by returning the scalar contained in UncertainValue.
◆ operator!=() [1/3]
template<typename FP , typename T >
| bool mio::operator!= |
( |
const T & |
lhs, |
|
|
const UncertainValue< FP > & |
rhs |
|
) |
| |
|
inline |
◆ operator!=() [2/3]
template<typename FP , typename T >
| bool mio::operator!= |
( |
const UncertainValue< FP > & |
lhs, |
|
|
const T & |
rhs |
|
) |
| |
|
inline |
◆ operator!=() [3/3]
◆ operator*() [1/3]
template<typename FP , typename T >
◆ operator*() [2/3]
template<typename FP , typename T >
◆ operator*() [3/3]
◆ operator*=()
◆ operator+() [1/3]
template<typename FP , typename T >
◆ operator+() [2/3]
template<typename FP , typename T >
◆ operator+() [3/3]
◆ operator+=()
◆ operator-() [1/3]
template<typename FP , typename T >
◆ operator-() [2/3]
template<typename FP , typename T >
◆ operator-() [3/3]
◆ operator-=()
◆ operator/() [1/3]
template<typename FP , typename T >
◆ operator/() [2/3]
template<typename FP , typename T >
◆ operator/() [3/3]
◆ operator/=()
◆ operator<() [1/3]
template<typename FP , typename T >
| bool mio::operator< |
( |
const T & |
lhs, |
|
|
const UncertainValue< FP > & |
rhs |
|
) |
| |
|
inline |
◆ operator<() [2/3]
template<typename FP , typename T >
| bool mio::operator< |
( |
const UncertainValue< FP > & |
lhs, |
|
|
const T & |
rhs |
|
) |
| |
|
inline |
◆ operator<() [3/3]
◆ operator<<()
template<typename FP >
| std::ostream& mio::operator<< |
( |
std::ostream & |
os, |
|
|
const UncertainValue< FP > & |
uv |
|
) |
| |
|
inline |
◆ operator<=() [1/3]
template<typename FP , typename T >
| bool mio::operator<= |
( |
const T & |
lhs, |
|
|
const UncertainValue< FP > & |
rhs |
|
) |
| |
|
inline |
◆ operator<=() [2/3]
template<typename FP , typename T >
| bool mio::operator<= |
( |
const UncertainValue< FP > & |
lhs, |
|
|
const T & |
rhs |
|
) |
| |
|
inline |
◆ operator<=() [3/3]
◆ operator=() [1/3]
template<typename FP = ScalarType>
◆ operator=() [2/3]
template<typename FP = ScalarType>
◆ operator=() [3/3]
template<typename FP = ScalarType>
template<typename T >
Assign a scalar of any type convertible to FP to this UncertainValue.
The contained scalar is updated, while the distribution remains unchanged. Supports scalars and AD (Automatic Differentiation) types that can be cast to FP.
◆ operator==() [1/3]
template<typename FP , typename T >
| bool mio::operator== |
( |
const T & |
lhs, |
|
|
const UncertainValue< FP > & |
rhs |
|
) |
| |
|
inline |
◆ operator==() [2/3]
template<typename FP , typename T >
| bool mio::operator== |
( |
const UncertainValue< FP > & |
lhs, |
|
|
const T & |
rhs |
|
) |
| |
|
inline |
◆ operator==() [3/3]
◆ operator>() [1/3]
template<typename FP , typename T >
| bool mio::operator> |
( |
const T & |
lhs, |
|
|
const UncertainValue< FP > & |
rhs |
|
) |
| |
|
inline |
◆ operator>() [2/3]
template<typename FP , typename T >
| bool mio::operator> |
( |
const UncertainValue< FP > & |
lhs, |
|
|
const T & |
rhs |
|
) |
| |
|
inline |
◆ operator>() [3/3]
◆ operator>=() [1/3]
template<typename FP , typename T >
| bool mio::operator>= |
( |
const T & |
lhs, |
|
|
const UncertainValue< FP > & |
rhs |
|
) |
| |
|
inline |
◆ operator>=() [2/3]
template<typename FP , typename T >
| bool mio::operator>= |
( |
const UncertainValue< FP > & |
lhs, |
|
|
const T & |
rhs |
|
) |
| |
|
inline |
◆ operator>=() [3/3]
◆ serialize()
template<typename FP = ScalarType>
template<class IOContext >
◆ set_distribution()
template<typename FP = ScalarType>
Sets the distribution of the value.
The function uses copy semantics, i.e. it copies the distribution object.
◆ UncertainValue() [1/5]
template<typename FP = ScalarType>
◆ UncertainValue() [2/5]
template<typename FP = ScalarType>
◆ UncertainValue() [3/5]
template<typename FP = ScalarType>
◆ UncertainValue() [4/5]
template<typename FP = ScalarType>
template<typename T >
Create an UncertainValue from a scalar of any type convertible to FP.
This constructor allows initializing UncertainValue with scalars or AD (Automatic Differentiation) types that can be cast to FP. The distribution remains unset.
◆ UncertainValue() [5/5]
template<typename FP = ScalarType>
◆ value()
template<typename FP = ScalarType>
Conversion to scalar by returning the scalar contained in UncertainValue.
◆ m_dist
template<typename FP = ScalarType>
◆ m_value
template<typename FP = ScalarType>