11 #ifndef TLX_MATH_AGGREGATE_MIN_MAX_HEADER 12 #define TLX_MATH_AGGREGATE_MIN_MAX_HEADER 26 template <
typename Type_>
76 template <
typename Archive>
86 Type max_ = std::numeric_limits<Type>::lowest();
93 #endif // !TLX_MATH_AGGREGATE_MIN_MAX_HEADER void serialize(Archive &archive)
serialization method for cereal.
const Type & max() const noexcept
return maximum over all values aggregated
const Type & min() const noexcept
return minimum over all values aggregated
Type span() const noexcept
return maximum - minimum over all values aggregated
AggregateMinMax operator+(const AggregateMinMax &a) const noexcept
operator + to combine two AggregateMinMax<>
AggregateMinMax()=default
default constructor
static uint32_t min(uint32_t x, uint32_t y)
AggregateMinMax(const Type &min, const Type &max) noexcept
initializing constructor
void set_min(const Type &v) noexcept
change currently aggregated minimum
void set_max(const Type &v) noexcept
change currently aggregated minimum
AggregateMinMax & operator+=(const AggregateMinMax &a) noexcept
operator += to combine two AggregateMinMax<>
Calculate running aggregate statistics: feed it with values, and it will keep the minimum and the max...
AggregateMinMax & add(const Type &value) noexcept
add a value to the running aggregation