7#include <unordered_map>
33template<
typename ValueType>
49 using deps_map_t = std::unordered_map<dep_sd_ptr, value_t>;
122template<
typename ValueType>
128 m_deps_.emplace(std::make_shared<dep_sd_t>(m_sd_),
value_t{1.0});
146template<
typename ValueType>
148 os << u.
mean() <<
"+/-" << u.
sd();
162template<
typename ValueType1,
typename ValueType2>
165 if constexpr(!std::is_same_v<ValueType1, ValueType2>) {
168 if(lhs.
mean() != rhs.
mean())
return false;
169 if(lhs.
sd() != rhs.
sd())
return false;
170 if(lhs.
deps() != rhs.
deps())
return false;
186template<
typename ValueType1,
typename ValueType2>
189 return !(lhs == rhs);
204template<
typename ValueType1,
typename ValueType2>
222template<
typename ValueType1,
typename ValueType2>
238template<
typename ValueType1,
typename ValueType2>
241 return (lhs == rhs) || (lhs < rhs);
254template<
typename ValueType1,
typename ValueType2>
257 return (lhs == rhs) || (lhs > rhs);
Models an unceratin variable.
Definition uncertain.hpp:34
std::ostream & operator<<(std::ostream &os, const Uncertain< ValueType > &u)
Overload stream insertion to print uncertain variable.
Definition uncertain.hpp:147
bool operator<=(const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs)
Whether one uncertain variable is less than or equal to another.
Definition uncertain.hpp:239
bool operator>(const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs)
Whether one uncertain variable is greater than another.
Definition uncertain.hpp:223
value_t mean() const
Definition uncertain.hpp:71
bool operator>=(const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs)
Whether one uncertain variable is greater than or equal to another.
Definition uncertain.hpp:255
value_t dep_sd_t
Definition uncertain.hpp:43
bool operator<(const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs)
Whether one uncertain variable is less than another.
Definition uncertain.hpp:205
const deps_map_t & deps() const
Get the dependencies of the variable.
Definition uncertain.hpp:87
Uncertain< float > my_t
Definition uncertain.hpp:37
bool operator==(const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs)
Compare two uncertain variables for equality.
Definition uncertain.hpp:163
bool operator!=(const Uncertain< ValueType1 > &lhs, const Uncertain< ValueType2 > &rhs)
Compare two uncertain variables for inequality.
Definition uncertain.hpp:187
float value_t
Definition uncertain.hpp:40
std::unordered_map< dep_sd_ptr, value_t > deps_map_t
Definition uncertain.hpp:49
value_t sd() const
Definition uncertain.hpp:79
std::shared_ptr< dep_sd_t > dep_sd_ptr
Definition uncertain.hpp:46
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.
Definition uncertain.hpp:123
value_t threshold() const
Definition uncertain.hpp:95
Modifies an unceratin variable.
Definition setter.hpp:20
The namespace that contains the implementation details of the library.
The primary namespace for the sigma library.
Definition affine.hpp:12
Uncertain< double > UDouble
Typedef for an uncertain double.
Definition uncertain.hpp:264
Affine< T > abs(const Affine< T > &a)
Absolute Value of an affine form.
Definition basic.ipp:8
Uncertain< float > UFloat
Typedef for an uncertain float.
Definition uncertain.hpp:261
Components for compatibility with Eigen.
Convenience header for uncertain value operations.