|
sigma
1.0.0
|
Models an unceratin variable. More...
#include <uncertain.hpp>
Public Types | |
| using | my_t = Uncertain<ValueType> |
| Type of the instance. | |
| using | value_t = ValueType |
| The numeric type of the variable. | |
| using | dep_sd_t = value_t |
| The type of a standard deviation this depends on. | |
| using | dep_sd_ptr = std::shared_ptr<dep_sd_t> |
| A pointer to a dependency of this variable. | |
| using | deps_map_t = std::unordered_map<dep_sd_ptr, value_t> |
| A map of dependencies and their contributions to the uncertainty. | |
Public Member Functions | |
| Uncertain (value_t mean=0.0, value_t sd=0.0, value_t threshold=std::numeric_limits< value_t >::epsilon()) | |
| Construct an uncertain value from mean and standard deviation. | |
| value_t | mean () const |
| Get the mean value of the variable. | |
| value_t | sd () const |
| Get the standard deviation of the variable. | |
| const deps_map_t & | deps () const |
| Get the dependencies of the variable. | |
| value_t | threshold () const |
| Access the zero threshold. | |
Friends | |
| template<typename T> | |
| class | detail_::Setter |
Related Symbols | |
(Note that these are not member symbols.) | |
| template<typename ValueType> | |
| std::ostream & | operator<< (std::ostream &os, const Uncertain< ValueType > &u) |
| Overload stream insertion to print uncertain variable. | |
| template<typename ValueType1, typename ValueType2> | |
| bool | operator== (const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs) |
| Compare two uncertain variables for equality. | |
| template<typename ValueType1, typename ValueType2> | |
| bool | operator!= (const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs) |
| Compare two uncertain variables for inequality. | |
| template<typename ValueType1, typename ValueType2> | |
| bool | operator< (const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs) |
| Whether one uncertain variable is less than another. | |
| template<typename ValueType1, typename ValueType2> | |
| bool | operator> (const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs) |
| Whether one uncertain variable is greater than another. | |
| template<typename ValueType1, typename ValueType2> | |
| bool | operator<= (const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs) |
| Whether one uncertain variable is less than or equal to another. | |
| template<typename ValueType1, typename ValueType2> | |
| bool | operator>= (const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs) |
| Whether one uncertain variable is greater than or equal to another. | |
Models an unceratin variable.
In this context, an uncertain variable is one that is dependent on one or more independent variables. It has a mean value and standard deviation. This class also keeps track of the variables that each instance is dependent upon and the contribution of that variable to the uncertainty of this instance.
| ValueType | The type of the value and standard deviation |
| sigma::Uncertain< ValueType >::Uncertain | ( | value_t | mean = 0.0, |
| value_t | sd = 0.0, | ||
| value_t | threshold = std::numeric_limits<value_t>::epsilon() ) |
Construct an uncertain value from mean and standard deviation.
Effectively, this creates a value that is a function of a single independent variable.
| mean | The average value of the variable |
| sd | The standard deviation of the variable |
| threshold | The threshold for values to be considered zero |
| none | No throw guarantee |
|
inline |
Get the dependencies of the variable.
| none | No throw guarantee |
|
inline |
Get the mean value of the variable.
| none | No throw guarantee |
|
inline |
Get the standard deviation of the variable.
| none | No throw guarantee |
|
inline |
Access the zero threshold.
| none | No throw guarantee |
A friendly class used by functions to manipulate the private members of a variable that is being updated
|
Compare two uncertain variables for inequality.
| ValueType | The numerical type of the variable |
| lhs | The first variable |
| rhs | The second variable |
|
Whether one uncertain variable is less than another.
Compares the mean values of the two variables
| ValueType | The numerical type of the variable |
| lhs | The first variable |
| rhs | The second variable |
lhs is less than rhs
|
Overload stream insertion to print uncertain variable.
| ValueType | The numerical type of the variable |
| os | The ostream to write to |
| u | The uncertain variable to write |
| std::ios_base::failure | if anything goes wrong while writing. Weak throw guarantee. |
|
Whether one uncertain variable is less than or equal to another.
| ValueType | The numerical type of the variable |
| lhs | The first variable |
| rhs | The second variable |
lhs is less than or equal to rhs
|
Compare two uncertain variables for equality.
| ValueType | The numerical type of the variable |
| lhs | The first variable |
| rhs | The second variable |
|
Whether one uncertain variable is greater than another.
Compares the mean values of the two variables
| ValueType | The numerical type of the variable |
| lhs | The first variable |
| rhs | The second variable |
lhs is greater than rhs
|
Whether one uncertain variable is greater than or equal to another.
| ValueType | The numerical type of the variable |
| lhs | The first variable |
| rhs | The second variable |
lhs is greater than or equal to rhs