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.
static uint_pair max()
return an uint_pair instance containing the largest value possible
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
AggregateMinMax(const Type &min, const Type &max) noexcept
initializing constructor
static uint_pair min()
return an uint_pair instance containing the smallest value possible
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