statistics: add min and max operations for numerical types

This makes sense and is easy to implement.

Suggested-by: Peter Zaal <peter.zaal@gmail.com>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-01-10 19:07:29 +01:00 committed by Dirk Hohndel
parent bd26d8407f
commit 0efcbb0eb6
2 changed files with 23 additions and 12 deletions

View file

@ -26,6 +26,8 @@ enum class StatsOperation : int {
Mean,
TimeWeightedMean,
Sum,
Min,
Max,
Invalid
};
@ -36,6 +38,8 @@ struct StatsOperationResults {
double mean;
double timeWeightedMean;
double sum;
double min;
double max;
StatsOperationResults(); // Initialize to invalid (e.g. no dives)
bool isValid() const;
double get(StatsOperation op) const;