Public Types | Public Member Functions | Private Attributes | Friends

cmtk::ValueSequence< T > Class Template Reference
[cmtkBase Library]

Class for computing characteristic values of number sequences. More...

#include <cmtkValueSequence.h>

Collaboration diagram for cmtk::ValueSequence< T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef ValueSequence< T > Self
 This class.

Public Member Functions

 ValueSequence ()
 Default constructor.
void Reset ()
 Reset all computations.
void Proceed (const T v)
 Proceed with the next number in the sequence.
double GetMinimum () const
 Return minimum of all values.
double GetMaximum () const
 Return maximum of all values.
double GetMinimumAbs () const
 Return minimum of all absolute values.
double GetMaximumAbs () const
 Return maximum of all absolute values.
int GetNValues () const
 Return total number of values.
double GetVariance (const bool unbiased=true) const
 Return variance of all values.
double GetSum () const
 Return sum of all values.
double GetSumOfSquares () const
 Return sum of squres of all values.
double GetAverage () const
 Return average value.
double GetAverageAbs () const
 Return average value.
ValueSequence< T > & operator= (const ValueSequence< T > &other)
 Assignment operator.

Private Attributes

Sum
 Sum of all values.
SumAbs
 Sum of all absolute values.
SumOfSquares
 Sum of the squares of all values.
int NValues
 Number of values.
Minimum
 Minimum value so far.
Maximum
 Maximum value so far.
MinimumAbs
 Minimum absolute value so far.
MaximumAbs
 Maximum absolute value so far.

Friends

template<class TT >
ValueSequence< TT > operator+ (const ValueSequence< TT > &a, const ValueSequence< TT > &b)
 Allow addition operator direct access.

Detailed Description

template<class T = float>
class cmtk::ValueSequence< T >

Class for computing characteristic values of number sequences.

Instances of this class take a sequence of (real) numbers via calls to the Proceed() member function. After last last number in the sequence, the object can be queried for minimum and maximum values (both absolute and standard), variance, and average value. Further calls to Proceed() are allowed, thus enabling incremental computations.

Note:
This class performs a lot of potentially unnecessary computations if, for example, only the sum of values is to be computed. If you need efficient evaluation of more elementary expressions, you are encouraged to implement these directly; this present class is merely a convenience tool.

Definition at line 59 of file cmtkValueSequence.h.


Member Typedef Documentation

template<class T = float>
typedef ValueSequence<T> cmtk::ValueSequence< T >::Self

This class.

Definition at line 63 of file cmtkValueSequence.h.


Constructor & Destructor Documentation

template<class T = float>
cmtk::ValueSequence< T >::ValueSequence (  ) [inline]

Default constructor.

Definition at line 66 of file cmtkValueSequence.h.


Member Function Documentation

template<class T = float>
double cmtk::ValueSequence< T >::GetAverage (  ) const [inline]

Return average value.

Definition at line 125 of file cmtkValueSequence.h.

template<class T = float>
double cmtk::ValueSequence< T >::GetAverageAbs (  ) const [inline]

Return average value.

Definition at line 128 of file cmtkValueSequence.h.

template<class T = float>
double cmtk::ValueSequence< T >::GetMaximum (  ) const [inline]

Return maximum of all values.

Definition at line 100 of file cmtkValueSequence.h.

template<class T = float>
double cmtk::ValueSequence< T >::GetMaximumAbs (  ) const [inline]

Return maximum of all absolute values.

Definition at line 106 of file cmtkValueSequence.h.

template<class T = float>
double cmtk::ValueSequence< T >::GetMinimum (  ) const [inline]

Return minimum of all values.

Definition at line 97 of file cmtkValueSequence.h.

template<class T = float>
double cmtk::ValueSequence< T >::GetMinimumAbs (  ) const [inline]

Return minimum of all absolute values.

Definition at line 103 of file cmtkValueSequence.h.

template<class T = float>
int cmtk::ValueSequence< T >::GetNValues (  ) const [inline]

Return total number of values.

Definition at line 109 of file cmtkValueSequence.h.

template<class T = float>
double cmtk::ValueSequence< T >::GetSum (  ) const [inline]

Return sum of all values.

Definition at line 119 of file cmtkValueSequence.h.

template<class T = float>
double cmtk::ValueSequence< T >::GetSumOfSquares (  ) const [inline]

Return sum of squres of all values.

Definition at line 122 of file cmtkValueSequence.h.

template<class T = float>
double cmtk::ValueSequence< T >::GetVariance ( const bool  unbiased = true ) const [inline]

Return variance of all values.

Definition at line 112 of file cmtkValueSequence.h.

template<class T = float>
void cmtk::ValueSequence< T >::Proceed ( const T  v ) [inline]

Proceed with the next number in the sequence.

Definition at line 79 of file cmtkValueSequence.h.

template<class T = float>
void cmtk::ValueSequence< T >::Reset (  ) [inline]

Reset all computations.

Definition at line 72 of file cmtkValueSequence.h.


Friends And Related Function Documentation

template<class T = float>
template<class TT >
ValueSequence<TT> operator+ ( const ValueSequence< TT > &  a,
const ValueSequence< TT > &  b 
) [friend]

Allow addition operator direct access.


Member Data Documentation

template<class T = float>
T cmtk::ValueSequence< T >::Maximum [private]

Maximum value so far.

Definition at line 150 of file cmtkValueSequence.h.

Referenced by cmtk::operator+(), and cmtk::ValueSequence< T >::operator=().

template<class T = float>
T cmtk::ValueSequence< T >::MaximumAbs [private]

Maximum absolute value so far.

Definition at line 156 of file cmtkValueSequence.h.

Referenced by cmtk::operator+(), and cmtk::ValueSequence< T >::operator=().

template<class T = float>
T cmtk::ValueSequence< T >::Minimum [private]

Minimum value so far.

Definition at line 147 of file cmtkValueSequence.h.

Referenced by cmtk::operator+(), and cmtk::ValueSequence< T >::operator=().

template<class T = float>
T cmtk::ValueSequence< T >::MinimumAbs [private]

Minimum absolute value so far.

Definition at line 153 of file cmtkValueSequence.h.

Referenced by cmtk::operator+(), and cmtk::ValueSequence< T >::operator=().

template<class T = float>
int cmtk::ValueSequence< T >::NValues [private]

Number of values.

Definition at line 144 of file cmtkValueSequence.h.

Referenced by cmtk::operator+(), and cmtk::ValueSequence< T >::operator=().

template<class T = float>
T cmtk::ValueSequence< T >::Sum [private]

Sum of all values.

Definition at line 135 of file cmtkValueSequence.h.

Referenced by cmtk::operator+(), and cmtk::ValueSequence< T >::operator=().

template<class T = float>
T cmtk::ValueSequence< T >::SumAbs [private]

Sum of all absolute values.

Definition at line 138 of file cmtkValueSequence.h.

Referenced by cmtk::operator+(), and cmtk::ValueSequence< T >::operator=().

template<class T = float>
T cmtk::ValueSequence< T >::SumOfSquares [private]

Sum of the squares of all values.

Definition at line 141 of file cmtkValueSequence.h.

Referenced by cmtk::operator+(), and cmtk::ValueSequence< T >::operator=().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines