Estimate< T, U > Class Template Reference

Estimates with a value, $ x $, and a variance, $ \sigma^2 $. More...

#include <Estimate.h>

Public Types

typedef T val_type
 
typedef U var_type
 

Public Member Functions

 Estimate (T _val=0, U _var=0)
 Construct from a value, $ x $, and its variance, $ \sigma_x^2 $.
 
template<typename V , typename W >
 Estimate (const Estimate< V, W > &d)
 Construct from another Estimate.
 
template<typename V , typename W >
 Estimate (const MeanEstimate< V, W > &m)
 Construct from MeanEstimate.
 
template<typename V , typename W >
 Estimate (const MeanRadian< V, W > &m)
 Construct from MeanRadian.
 
const Estimateoperator= (const Estimate &d)
 Assignment operator.
 
void set_value (const T &t)
 Set the value.
 
get_value () const
 Get the value.
 
void set_variance (const U &u)
 Set the variance.
 
get_variance () const
 Get the variance.
 
void set_error (const U &u)
 Set the error.
 
get_error () const
 Get the error.
 
T & operator[] (unsigned)
 Array access to value.
 
operator[] (unsigned) const
 Array access to value.
 
const Estimateoperator+= (const Estimate &d)
 Addition operator.
 
const Estimateoperator-= (const Estimate &d)
 Subtraction operator.
 
const Estimateoperator*= (const Estimate &d)
 Multiplication operator. More...
 
const Estimateoperator/= (const Estimate &d)
 Division operator.
 
bool operator== (const Estimate &d) const
 Equality operator.
 
bool operator!= (const Estimate &d) const
 Inequality operator.
 
bool operator< (const Estimate &d) const
 Comparison operator.
 
bool operator> (const Estimate &d) const
 Comparison operator.
 
const Estimate inverse () const
 Inversion operator. More...
 

Public Attributes

val
 The value, $ x $.
 
var
 The variance of the value, $ \sigma_x^2 $.
 

Friends

const Estimate operator+ (Estimate a, const Estimate &b)
 
const Estimate operator- (Estimate a, const Estimate &b)
 
const Estimate operator* (Estimate a, const Estimate &b)
 
const Estimate operator/ (Estimate a, const Estimate &b)
 
const Estimate operator- (Estimate a)
 Negation operator.
 
const Estimate exp (const Estimate &u)
 See http://mathworld.wolfram.com/ErrorPropagation.html Equation (15)
 
const Estimate log (const Estimate &u)
 See http://mathworld.wolfram.com/ErrorPropagation.html Equation (17)
 
const Estimate sqrt (const Estimate &u)
 $ {\partial\over\partial x} x^{1\over2} = {1\over2}x^{-{1\over2}} $
 
const Estimate sin (const Estimate &u)
 $ \left({\partial\sin x\over\partial x}\right)^2 = (1-\sin^2x) $
 
const Estimate cos (const Estimate &u)
 $ \left({\partial\cos x\over\partial x}\right)^2 = (1-\cos^2x) $
 
const Estimate atan (const Estimate &u)
 $ {\partial\over\partial x} \tan^-1 (x) = (1+x^2)^{-1} $
 
const Estimate atan2 (const Estimate &s, const Estimate &c)
 $ {\partial\over\partial x} \tan^-1 (x) = (1+x^2)^{-1} $
 
const Estimate sinh (const Estimate &u)
 $ \left({\partial\sinh x\over\partial x}\right)^2 = (1+\sinh^2x) $
 
const Estimate cosh (const Estimate &u)
 $ \left({\partial\cosh x\over\partial x}\right)^2 = (\cosh^2x-1) $
 
const Estimate atanh (const Estimate &u)
 $ {\partial\over\partial x} \tanh^-1 (x) = (1-x^2)^{-1} $
 
int isfinite (const Estimate &u)
 
int isinf (const Estimate &u)
 
int isnan (const Estimate &u)
 
const T abs (const Estimate &u)
 
const Estimate copysign (const Estimate &u, const Estimate &v)
 

Detailed Description

template<typename T, typename U = T>
class Estimate< T, U >

Estimates with a value, $ x $, and a variance, $ \sigma^2 $.

Where $ y = f (x_1, x_2, ... x_n) $, then $ \sigma_y^2 = \sum_{i=1}^n ({\partial f \over \partial x_i})^2\sigma_i^2 $

See http://mathworld.wolfram.com/ErrorPropagation.html

Member Function Documentation

◆ inverse()

template<typename T, typename U = T>
const Estimate Estimate< T, U >::inverse ( ) const
inline

Inversion operator.

Where $ r=1/x $, $ \sigma_r=r^2\sigma_x/x^2 = \sigma_x/x^4 $

Referenced by Estimate< double >::operator/=().

◆ operator*=()

template<typename T, typename U = T>
const Estimate& Estimate< T, U >::operator*= ( const Estimate< T, U > &  d)
inline

Multiplication operator.

Where $ r=x*y $, $\sigma^2_r = y^2\sigma^2_x + x^2\sigma^2_y$

Referenced by Estimate< double >::operator/=().


The documentation for this class was generated from the following file:

Generated using doxygen 1.8.14