tlx
AggregateMinMax< Type_ > Class Template Reference

Calculate running aggregate statistics: feed it with values, and it will keep the minimum and the maximum values. More...

#include <aggregate_min_max.hpp>

Public Types

using Type = Type_
 

Public Member Functions

 AggregateMinMax ()=default
 default constructor More...
 
 AggregateMinMax (const Type &min, const Type &max) noexcept
 initializing constructor More...
 
AggregateMinMax & add (const Type &value) noexcept
 add a value to the running aggregation More...
 
const Type & min () const noexcept
 return minimum over all values aggregated More...
 
const Type & max () const noexcept
 return maximum over all values aggregated More...
 
Type span () const noexcept
 return maximum - minimum over all values aggregated More...
 
void set_min (const Type &v) noexcept
 change currently aggregated minimum More...
 
void set_max (const Type &v) noexcept
 change currently aggregated minimum More...
 
AggregateMinMax operator+ (const AggregateMinMax &a) const noexcept
 operator + to combine two AggregateMinMax<> More...
 
AggregateMinMax & operator+= (const AggregateMinMax &a) noexcept
 operator += to combine two AggregateMinMax<> More...
 
template<typename Archive >
void serialize (Archive &archive)
 serialization method for cereal. More...
 

Private Attributes

Type min_
 minimum value More...
 
Type max_
 maximum value More...
 

Detailed Description

template<typename Type_>
class tlx::AggregateMinMax< Type_ >

Calculate running aggregate statistics: feed it with values, and it will keep the minimum and the maximum values.

Definition at line 27 of file aggregate_min_max.hpp.

Member Typedef Documentation

using Type = Type_

Definition at line 30 of file aggregate_min_max.hpp.

Constructor & Destructor Documentation

AggregateMinMax ( )
default

default constructor

AggregateMinMax ( const Type &  min,
const Type &  max 
)
inlinenoexcept

initializing constructor

Definition at line 36 of file aggregate_min_max.hpp.

Member Function Documentation

AggregateMinMax& add ( const Type &  value)
inlinenoexcept

add a value to the running aggregation

Definition at line 40 of file aggregate_min_max.hpp.

const Type& max ( ) const
inlinenoexcept

return maximum over all values aggregated

Definition at line 50 of file aggregate_min_max.hpp.

const Type& min ( ) const
inlinenoexcept

return minimum over all values aggregated

Definition at line 47 of file aggregate_min_max.hpp.

AggregateMinMax operator+ ( const AggregateMinMax< Type_ > &  a) const
inlinenoexcept

operator + to combine two AggregateMinMax<>

Definition at line 62 of file aggregate_min_max.hpp.

AggregateMinMax& operator+= ( const AggregateMinMax< Type_ > &  a)
inlinenoexcept

operator += to combine two AggregateMinMax<>

Definition at line 69 of file aggregate_min_max.hpp.

void serialize ( Archive &  archive)
inline

serialization method for cereal.

Definition at line 77 of file aggregate_min_max.hpp.

void set_max ( const Type &  v)
inlinenoexcept

change currently aggregated minimum

Definition at line 59 of file aggregate_min_max.hpp.

void set_min ( const Type &  v)
inlinenoexcept

change currently aggregated minimum

Definition at line 56 of file aggregate_min_max.hpp.

Type span ( ) const
inlinenoexcept

return maximum - minimum over all values aggregated

Definition at line 53 of file aggregate_min_max.hpp.

Member Data Documentation

Type max_
private

maximum value

Definition at line 86 of file aggregate_min_max.hpp.

Type min_
private

minimum value

Definition at line 83 of file aggregate_min_max.hpp.


The documentation for this class was generated from the following file: