Class for computing characteristic values of number sequences. More...
#include <cmtkValueSequence.h>
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 | |
T | Sum |
Sum of all values. | |
T | SumAbs |
Sum of all absolute values. | |
T | SumOfSquares |
Sum of the squares of all values. | |
int | NValues |
Number of values. | |
T | Minimum |
Minimum value so far. | |
T | Maximum |
Maximum value so far. | |
T | MinimumAbs |
Minimum absolute value so far. | |
T | 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. |
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.
Definition at line 59 of file cmtkValueSequence.h.
typedef ValueSequence<T> cmtk::ValueSequence< T >::Self |
This class.
Definition at line 63 of file cmtkValueSequence.h.
cmtk::ValueSequence< T >::ValueSequence | ( | ) | [inline] |
Default constructor.
Definition at line 66 of file cmtkValueSequence.h.
double cmtk::ValueSequence< T >::GetAverage | ( | ) | const [inline] |
Return average value.
Definition at line 125 of file cmtkValueSequence.h.
double cmtk::ValueSequence< T >::GetAverageAbs | ( | ) | const [inline] |
Return average value.
Definition at line 128 of file cmtkValueSequence.h.
double cmtk::ValueSequence< T >::GetMaximum | ( | ) | const [inline] |
Return maximum of all values.
Definition at line 100 of file cmtkValueSequence.h.
double cmtk::ValueSequence< T >::GetMaximumAbs | ( | ) | const [inline] |
Return maximum of all absolute values.
Definition at line 106 of file cmtkValueSequence.h.
double cmtk::ValueSequence< T >::GetMinimum | ( | ) | const [inline] |
Return minimum of all values.
Definition at line 97 of file cmtkValueSequence.h.
double cmtk::ValueSequence< T >::GetMinimumAbs | ( | ) | const [inline] |
Return minimum of all absolute values.
Definition at line 103 of file cmtkValueSequence.h.
int cmtk::ValueSequence< T >::GetNValues | ( | ) | const [inline] |
Return total number of values.
Definition at line 109 of file cmtkValueSequence.h.
double cmtk::ValueSequence< T >::GetSum | ( | ) | const [inline] |
Return sum of all values.
Definition at line 119 of file cmtkValueSequence.h.
double cmtk::ValueSequence< T >::GetSumOfSquares | ( | ) | const [inline] |
Return sum of squres of all values.
Definition at line 122 of file cmtkValueSequence.h.
double cmtk::ValueSequence< T >::GetVariance | ( | const bool | unbiased = true ) |
const [inline] |
Return variance of all values.
Definition at line 112 of file cmtkValueSequence.h.
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.
void cmtk::ValueSequence< T >::Reset | ( | ) | [inline] |
Reset all computations.
Definition at line 72 of file cmtkValueSequence.h.
ValueSequence<TT> operator+ | ( | const ValueSequence< TT > & | a, |
const ValueSequence< TT > & | b | ||
) | [friend] |
Allow addition operator direct access.
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=().
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=().
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=().
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=().
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=().
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=().
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=().
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=().