6#include <unordered_map>
32template<
typename ValueType>
48 using deps_map_t = std::unordered_map<dep_sd_ptr, value_t>;
122template<
typename ValueType>
125 m_deps_.emplace(std::make_shared<dep_sd_t>(
sd),
value_t{1.0});
142template<
typename ValueType>
144 os << u.
mean() <<
"+/-" << u.
sd();
158template<
typename ValueType1,
typename ValueType2>
161 if constexpr(!std::is_same_v<ValueType1, ValueType2>) {
164 if(lhs.
mean() != rhs.
mean())
return false;
165 if(lhs.
sd() != rhs.
sd())
return false;
166 if(lhs.
deps() != rhs.
deps())
return false;
181template<
typename ValueType1,
typename ValueType2>
184 return !(lhs == rhs);
199template<
typename ValueType1,
typename ValueType2>
217template<
typename ValueType1,
typename ValueType2>
233template<
typename ValueType1,
typename ValueType2>
236 return (lhs == rhs) || (lhs < rhs);
249template<
typename ValueType1,
typename ValueType2>
252 return (lhs == rhs) || (lhs > rhs);
Models an unceratin variable.
Definition uncertain.hpp:33
std::ostream & operator<<(std::ostream &os, const Uncertain< ValueType > &u)
Overload stream insertion to print uncertain variable.
Definition uncertain.hpp:143
bool operator<=(const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs)
Whether one variable is less than or equal to another.
Definition uncertain.hpp:234
bool operator>(const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs)
Whether one variable is greater than another.
Definition uncertain.hpp:218
Uncertain(value_t mean, value_t sd)
Construct an uncertain value from mean and standard deviation.
Definition uncertain.hpp:123
value_t mean() const
Definition uncertain.hpp:82
bool operator>=(const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs)
Whether one variable is greater than or equal to another.
Definition uncertain.hpp:250
value_t dep_sd_t
Definition uncertain.hpp:42
bool operator<(const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs)
Whether one variable is less than another.
Definition uncertain.hpp:200
const deps_map_t & deps() const
Get the dependencies of the variable.
Definition uncertain.hpp:98
Uncertain< float > my_t
Definition uncertain.hpp:36
Uncertain() noexcept=default
Default ctor.
bool operator==(const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs)
Compare two variables for equality.
Definition uncertain.hpp:159
bool operator!=(const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs)
Compare two variables for inequality.
Definition uncertain.hpp:182
float value_t
Definition uncertain.hpp:39
std::unordered_map< dep_sd_ptr, value_t > deps_map_t
Definition uncertain.hpp:48
value_t sd() const
Definition uncertain.hpp:90
std::shared_ptr< dep_sd_t > dep_sd_ptr
Definition uncertain.hpp:45
Modifies an unceratin variable.
Definition setter.hpp:20
The namespace that contains the implementation details of the library.
Definition operation_common.hpp:10
The primary namespace for the sigma library.
Definition operation_common.hpp:10
Uncertain< double > UDouble
Typedef for an uncertain double.
Definition uncertain.hpp:259
Uncertain< float > UFloat
Typedef for an uncertain float.
Definition uncertain.hpp:256
Uncertain< T > abs(const Uncertain< T > &a)
Absolute Value.
Definition basic.ipp:9