wavelength 1.0.0
Loading...
Searching...
No Matches
StatsAccumulator Class Reference

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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ StatsAccumulator()

StatsAccumulator::StatsAccumulator ( )

Construct a collector with no samples.

Ghidra address:
NTSC-U/C: 0x002930f0
Ghidra address:
PAL: 0x0029cab8

Member Function Documentation

◆ AddSample()

void StatsAccumulator::AddSample ( float fSample)

Add a sample.

Parameters
fSampleThe sample.
Ghidra address:
NTSC-U/C: 0x00293120
Ghidra address:
PAL: 0x0029cae8

◆ GetMedian()

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.

Returns
The median.
Ghidra address:
NTSC-U/C: 0x002932f0
Ghidra address:
PAL: 0x0029ccb8

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