MongoDB  2.7.0
Public Member Functions | List of all members
mongo::BasicEstimators< Sample > Class Template Reference

Collects count, minimum and maximum, calculates mean and standard deviation. More...

#include <descriptive_stats.h>

Inheritance diagram for mongo::BasicEstimators< Sample >:
mongo::SummaryEstimators< Sample, NumQuantiles >

Public Member Functions

BasicEstimatorsoperator<< (const Sample sample)
 Update estimators with another observed value.
 
size_t count () const
 
double mean () const
 
double stddev () const
 
Sample min () const
 
Sample max () const
 
void appendBasicToBSONObjBuilder (BSONObjBuilder &b) const
 Appends the basic estimators to the provided BSONObjBuilder.
 

Detailed Description

template<class Sample>
class mongo::BasicEstimators< Sample >

Collects count, minimum and maximum, calculates mean and standard deviation.

The 'Sample' template parameter is the type of the samples. It does not affect the calculated mean and standard deviation as all values are converted to double. However, setting the correct sample type prevents unnecessary casting or precision loss for min and max.

Member Function Documentation

template<class Sample >
size_t mongo::BasicEstimators< Sample >::count ( ) const
inline
Returns
number of observations so far
template<class Sample >
Sample mongo::BasicEstimators< Sample >::max ( ) const
inline
Returns
maximum observed value so far NOTE: exact.
template<class Sample >
double mongo::BasicEstimators< Sample >::mean ( ) const
inline
Returns
mean of the observations seen so far NOTE: exact (within the limits of IEEE floating point precision).
template<class Sample >
Sample mongo::BasicEstimators< Sample >::min ( ) const
inline
Returns
minimum observed value so far NOTE: exact.
template<class Sample >
double mongo::BasicEstimators< Sample >::stddev ( ) const
inline
Returns
standard deviation of the observations so far NOTE: exact (within the limits of IEEE floating point precision).

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