CFEL - ASG Software Suite
2.5.0
CASS
|
statistics calculator for a median More...
#include <statistics_calculator.hpp>
Public Types | |
typedef Type | value_type |
define the value type More... | |
typedef std::vector< value_type > | container_type |
Public Member Functions | |
MedianCalculator () | |
default constructor More... | |
void | addDatum (const value_type &datum) |
add a datum to the distribution More... | |
template<class InputIterator > | |
void | addDistribution (InputIterator first, InputIterator last) |
add a number of dati to the distribution More... | |
value_type | median () const |
retrieve the median of the distribution More... | |
void | reset () |
reset the statistics More... | |
Static Public Member Functions | |
static value_type | median (const container_type &container) |
calculate the mean of a container_type container More... | |
Private Attributes | |
container_type | _container |
the current mean value More... | |
statistics calculator for a median
adds the datums to an internal vector, which is sorted using nth_element when getting the median.
type | of the values for the average, defines the precision |
Definition at line 471 of file statistics_calculator.hpp.
typedef std::vector<value_type> cass::MedianCalculator< Type >::container_type |
Definition at line 476 of file statistics_calculator.hpp.
typedef Type cass::MedianCalculator< Type >::value_type |
define the value type
Definition at line 475 of file statistics_calculator.hpp.
|
inline |
default constructor
resets the values.
Definition at line 482 of file statistics_calculator.hpp.
References cass::CummulativeStatisticsNoOutlier< Type >::reset().
|
inline |
add a datum to the distribution
datum | The datum to be added |
Definition at line 491 of file statistics_calculator.hpp.
References cass::CummulativeStatisticsNoOutlier< Type >::_container.
|
inline |
add a number of dati to the distribution
Adds all elements between first and last to the distribution, but not the last
first | The first in the range to be added |
last | The element after last to be added |
Definition at line 505 of file statistics_calculator.hpp.
References cass::CummulativeStatisticsNoOutlier< Type >::addDatum().
Referenced by cass::pp333::medianCalc(), and cass::pp82::medianCalc().
|
inline |
retrieve the median of the distribution
uses median(const container_type &container) to calc the median
Definition at line 517 of file statistics_calculator.hpp.
References cass::CummulativeStatisticsNoOutlier< Type >::_container.
Referenced by cass::pp333::medianCalc(), and cass::pp82::medianCalc().
|
inlinestatic |
calculate the mean of a container_type container
a static function so that one can use it without having an object of this class.
copy the container, sort the copied container and retrieve the central element
container | the container from whos values the median should be calculated |
Definition at line 540 of file statistics_calculator.hpp.
|
inline |
reset the statistics
Definition at line 523 of file statistics_calculator.hpp.
References cass::CummulativeStatisticsNoOutlier< Type >::_container.
|
private |
the current mean value
Definition at line 551 of file statistics_calculator.hpp.