CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Attributes

stats_t< T > Class Template Reference

#include <ErrorPropogationTypes.h>

List of all members.

Public Member Functions

T error () const
T error2 () const
stats_t inverse () const
T operator() () const
stats_t operator*= (const stats_t &R)
stats_t operator*= (const T &r)
stats_t operator+= (const stats_t &R)
stats_t operator+= (const T &r)
stats_t operator-= (const stats_t &R)
stats_t operator-= (const T &r)
stats_t operator/= (const stats_t &R)
stats_t operator/= (const T &r)
bool operator< (const stats_t &R) const
bool operator< (const count_t &R) const
bool operator== (const count_t &R) const
bool operator== (const stats_t &R) const
T relative_error () const
T sigmaFrom (const T &x) const
 stats_t (count_t c)
 stats_t ()
 stats_t (T q, T e2)

Static Public Member Functions

static stats_t from_relative_uncertainty2 (T q, T re2)

Private Attributes

T err2
T value

Detailed Description

template<class T>
class stats_t< T >

Definition at line 33 of file ErrorPropogationTypes.h.


Constructor & Destructor Documentation

template<class T>
stats_t< T >::stats_t ( ) [inline]

Definition at line 43 of file ErrorPropogationTypes.h.

Referenced by stats_t< T >::from_relative_uncertainty2(), and stats_t< T >::inverse().

: value(0), err2(1) {}
template<class T>
stats_t< T >::stats_t ( count_t  c) [inline]

Definition at line 44 of file ErrorPropogationTypes.h.

: value(c()), err2(c.error2()) {}
template<class T>
stats_t< T >::stats_t ( T  q,
T  e2 
) [inline]

Definition at line 45 of file ErrorPropogationTypes.h.

: value(q), err2(e2) {}

Member Function Documentation

template<class T>
T stats_t< T >::error ( ) const [inline]

Definition at line 67 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and mathSSE::sqrt().

Referenced by stats_t< T >::sigmaFrom().

{return sqrt(err2);}
template<class T>
T stats_t< T >::error2 ( ) const [inline]
template<class T>
static stats_t stats_t< T >::from_relative_uncertainty2 ( T  q,
T  re2 
) [inline, static]

Definition at line 46 of file ErrorPropogationTypes.h.

References stats_t< T >::stats_t().

{ return stats_t(q,q*q*re2);}
template<class T>
stats_t stats_t< T >::inverse ( ) const [inline]
template<class T>
T stats_t< T >::operator() ( ) const [inline]

Definition at line 65 of file ErrorPropogationTypes.h.

References stats_t< T >::value.

{return value;}
template<class T>
stats_t stats_t< T >::operator*= ( const stats_t< T > &  R) [inline]

Definition at line 55 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and stats_t< T >::value.

{ err2 = R.err2*value*value + err2*R.value*R.value;        value *= R.value;  return *this;}
template<class T>
stats_t stats_t< T >::operator*= ( const T r) [inline]

Definition at line 60 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, csvReporter::r, and stats_t< T >::value.

{ value *= r; err2 *= r*r; return *this;}
template<class T>
stats_t stats_t< T >::operator+= ( const T r) [inline]

Definition at line 58 of file ErrorPropogationTypes.h.

References csvReporter::r, and stats_t< T >::value.

{ value += r; return *this;}
template<class T>
stats_t stats_t< T >::operator+= ( const stats_t< T > &  R) [inline]

Definition at line 53 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and stats_t< T >::value.

{ value += R.value;   err2 += R.err2; return *this;}
template<class T>
stats_t stats_t< T >::operator-= ( const T r) [inline]

Definition at line 59 of file ErrorPropogationTypes.h.

References csvReporter::r, and stats_t< T >::value.

{ value -= r; return *this;}
template<class T>
stats_t stats_t< T >::operator-= ( const stats_t< T > &  R) [inline]

Definition at line 54 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and stats_t< T >::value.

{ value -= R.value;   err2 += R.err2; return *this;}
template<class T>
stats_t stats_t< T >::operator/= ( const stats_t< T > &  R) [inline]

Definition at line 56 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and stats_t< T >::value.

{ value /= R.value;  err2 = (err2 + value*value*R.err2) / (R.value*R.value);  return *this;}
template<class T>
stats_t stats_t< T >::operator/= ( const T r) [inline]

Definition at line 61 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, csvReporter::r, and stats_t< T >::value.

{ value /= r; err2 /= r*r; return *this;}
template<class T>
bool stats_t< T >::operator< ( const stats_t< T > &  R) const [inline]

Definition at line 48 of file ErrorPropogationTypes.h.

References stats_t< T >::value.

{ return value < R.value ;}
template<class T>
bool stats_t< T >::operator< ( const count_t R) const [inline]

Definition at line 49 of file ErrorPropogationTypes.h.

References dttmaxenums::R, and stats_t< T >::value.

{ return value < R()     ;}
template<class T>
bool stats_t< T >::operator== ( const count_t R) const [inline]

Definition at line 51 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, count_t::error2(), dttmaxenums::R, and stats_t< T >::value.

{ return value == R()     && err2 == R.error2();}
template<class T>
bool stats_t< T >::operator== ( const stats_t< T > &  R) const [inline]

Definition at line 50 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and stats_t< T >::value.

{ return value == R.value && err2 == R.err2;}
template<class T>
T stats_t< T >::relative_error ( ) const [inline]

Definition at line 68 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, mathSSE::sqrt(), and stats_t< T >::value.

{return sqrt(err2)/value;}
template<class T>
T stats_t< T >::sigmaFrom ( const T x) const [inline]

Definition at line 69 of file ErrorPropogationTypes.h.

References stats_t< T >::error(), and stats_t< T >::value.

{return fabs(value-x)/error();}

Member Data Documentation

template<class T>
T stats_t< T >::err2 [private]
template<class T>
T stats_t< T >::value [private]