| 34 | class Stat { |
| 35 | public: |
| 36 | void UpdateStat(ValueType v) { |
| 37 | if (count_ == 0) { |
| 38 | first_ = v; |
| 39 | } |
| 40 | |
| 41 | newest_ = v; |
| 42 | max_ = std::max(v, max_); |
| 43 | min_ = std::min(v, min_); |
| 44 | ++count_; |
| 45 | sum_ += v; |
| 46 | squared_sum_ += static_cast<HighPrecisionValueType>(v) * v; |
| 47 | } |
| 48 | |
| 49 | void Reset() { new (this) Stat<ValueType, HighPrecisionValueType>(); } |
| 50 |
no test coverage detected