|
wavelength 1.0.0
|
Collector of float samples that reports their median. More...
#include <statsaccumulator.h>
Public Member Functions | |
| StatsAccumulator () | |
| Construct a collector with no samples. | |
| void | AddSample (float fSample) |
| Add a sample. | |
| float | GetMedian () |
| Report the median of the samples. | |
Collector of float samples that reports their median.
The class is not polymorphic and has no RTTI. The name is inferred. The object records the smallest sample, the largest sample, the sum, and every sample.
| StatsAccumulator::StatsAccumulator | ( | ) |
Construct a collector with no samples.
| void StatsAccumulator::AddSample | ( | float | fSample | ) |
Add a sample.
| fSample | The sample. |
| float StatsAccumulator::GetMedian | ( | ) |
Report the median of the samples.
The samples are sorted first unless mSorted is set, and mSorted is never set. For an even count the two samples averaged are those at half the count and the one after it.