statistic helper classes

test-cases
modified grid importance for better trap-detection
This commit is contained in:
2016-10-01 13:17:14 +02:00
parent 729340031d
commit 51c0945e12
15 changed files with 343 additions and 64 deletions

40
math/stats/Minimum.h Normal file
View File

@@ -0,0 +1,40 @@
#ifndef STATS_MINIMUM_H
#define STATS_MINIMUM_H
namespace Stats {
template <typename Scalar> class Minimum {
private:
const Scalar START = +999999999;
Scalar curMin;
public:
/** ctor */
Minimum() : curMin(START) {
;
}
/** is a valid minimum available? */
inline bool isValid() const {
return curMin != START;
}
/** add a new value */
void add(const Scalar val) {
if (val < curMin) {curMin = val;}
}
/** get the current value */
Scalar get() const {
Assert::notEqual(curMin, START, "add() values first!");
return curMin;
}
};
}
#endif // STATS_MINIMUM_H