![]() |
VR-Forces 4.8 Class Documentation
|
class DtAverager: More...
Public Member Functions | |
| DtAverager () | |
| Default constructor; assumes a maximum population of 100 samples. More... | |
| DtAverager (unsigned int maxPopulation) | |
| DtAverager (const DtAverager &orig) | |
| copy constructor More... | |
| DtAverager & | operator= (const DtAverager &orig) |
| assignment operator More... | |
| virtual | ~DtAverager () |
| destructor More... | |
| virtual double | sampleMean () const |
| Compute (if needed) and retrieve the sum of the samples divided by the current population size. More... | |
| virtual double | sampleMedian () const |
| Compute (if needed) by sorting samples and finding the middle value (or average of two middle values for an even population. More... | |
| virtual double | sampleStandardDeviation () const |
| Compute (if needed) the sample standard deviation. More... | |
| virtual double | sampleMinimum () const |
| Find (if needed) the sample maximum; note that this is found as a side effect of sampleMedian(), so if both are desired, call that first. More... | |
| virtual double | sampleMaximum () const |
| Find (if needed) the sample minumum; note that this is found as a side effect of sampleMedian(), so if both are desired, call that first. More... | |
| virtual void | addSample (double sample) |
| Add a sample to the population. This calls invalidateStatistics(). More... | |
| virtual double | lastSample () const |
| virtual unsigned int | maxPopulationSize () const |
| Retrieve the maximum population size. More... | |
| virtual void | setMaxPopulationSize (unsigned int maxPopulation) |
| Set the maximum population size. This invalidates the current population. More... | |
| virtual void | invalidatePopulation () |
| Clear all existing samples. More... | |
| virtual std::vector< double > & | samples () |
| A pointer to the array of samples. More... | |
| virtual const std::vector < double > & | samples () const |
| virtual unsigned int | currentSampleIndex () const |
| Index which points to the most recent sample in the array. More... | |
| virtual unsigned int | currentPopulationSize () const |
| Current population size. More... | |
Protected Member Functions | |
| virtual void | invalidateStatistics () |
| Mark all cached statistics as invalid, forcing them to be recomputed the next time they are accessed. More... | |
| virtual void | validateStatistics () |
| Reset all the cached flags as true. More... | |
| void | resetStatistics () |
class DtAverager:
DtAverager maintains a cyclical population of the N most recent samples and can, on command, compute the mean, median, standard deviation, minimum and maximum values of the population. N may be changed, and all samples may be invalidated to restart the process.
| DtAverager::DtAverager | ( | ) |
Default constructor; assumes a maximum population of 100 samples.
| DtAverager::DtAverager | ( | const DtAverager & | orig | ) |
copy constructor
|
virtual |
destructor
| DtAverager& DtAverager::operator= | ( | const DtAverager & | orig | ) |
assignment operator
|
virtual |
Compute (if needed) and retrieve the sum of the samples divided by the current population size.
|
virtual |
Compute (if needed) by sorting samples and finding the middle value (or average of two middle values for an even population.
|
virtual |
Compute (if needed) the sample standard deviation.
|
virtual |
Find (if needed) the sample maximum; note that this is found as a side effect of sampleMedian(), so if both are desired, call that first.
|
virtual |
Find (if needed) the sample minumum; note that this is found as a side effect of sampleMedian(), so if both are desired, call that first.
|
virtual |
Add a sample to the population. This calls invalidateStatistics().
|
virtual |
Retrieve the maximum population size.
Once the population reaches this size, old samples are removed as new ones are added.
Set the maximum population size. This invalidates the current population.
|
virtual |
Clear all existing samples.
|
virtual |
A pointer to the array of samples.
|
virtual |
Index which points to the most recent sample in the array.
|
protectedvirtual |
Mark all cached statistics as invalid, forcing them to be recomputed the next time they are accessed.
|
protectedvirtual |
Reset all the cached flags as true.
|
protected |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |