tlx
Loading...
Searching...
No Matches
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
 
 AggregateMinMax (const Type &min, const Type &max) noexcept
 initializing constructor
 
AggregateMinMaxadd (const Type &value) noexcept
 add a value to the running aggregation
 
const Typemin () const noexcept
 return minimum over all values aggregated
 
const Typemax () const noexcept
 return maximum over all values aggregated
 
Type span () const noexcept
 return maximum - minimum over all values aggregated
 
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) const noexcept
 operator + to combine two AggregateMinMax<>
 
AggregateMinMaxoperator+= (const AggregateMinMax &a) noexcept
 operator += to combine two AggregateMinMax<>
 
template<typename Archive >
void serialize (Archive &archive)
 serialization method for cereal.
 

Private Attributes

Type min_
 minimum value
 
Type max_
 maximum value
 

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

◆ Type

template<typename Type_ >
using Type = Type_

Definition at line 30 of file aggregate_min_max.hpp.

Constructor & Destructor Documentation

◆ AggregateMinMax() [1/2]

template<typename Type_ >
AggregateMinMax ( )
default

default constructor

◆ AggregateMinMax() [2/2]

template<typename Type_ >
AggregateMinMax ( const Type min,
const Type max 
)
inlinenoexcept

initializing constructor

Definition at line 36 of file aggregate_min_max.hpp.

Member Function Documentation

◆ add()

template<typename Type_ >
AggregateMinMax & add ( const Type value)
inlinenoexcept

add a value to the running aggregation

Definition at line 40 of file aggregate_min_max.hpp.

◆ max()

template<typename Type_ >
const Type & max ( ) const
inlinenoexcept

return maximum over all values aggregated

Definition at line 50 of file aggregate_min_max.hpp.

◆ min()

template<typename Type_ >
const Type & min ( ) const
inlinenoexcept

return minimum over all values aggregated

Definition at line 47 of file aggregate_min_max.hpp.

◆ operator+()

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

operator + to combine two AggregateMinMax<>

Definition at line 62 of file aggregate_min_max.hpp.

◆ operator+=()

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

operator += to combine two AggregateMinMax<>

Definition at line 69 of file aggregate_min_max.hpp.

◆ serialize()

template<typename Type_ >
template<typename Archive >
void serialize ( Archive &  archive)
inline

serialization method for cereal.

Definition at line 77 of file aggregate_min_max.hpp.

◆ set_max()

template<typename Type_ >
void set_max ( const Type v)
inlinenoexcept

change currently aggregated minimum

Definition at line 59 of file aggregate_min_max.hpp.

◆ set_min()

template<typename Type_ >
void set_min ( const Type v)
inlinenoexcept

change currently aggregated minimum

Definition at line 56 of file aggregate_min_max.hpp.

◆ span()

template<typename Type_ >
Type span ( ) const
inlinenoexcept

return maximum - minimum over all values aggregated

Definition at line 53 of file aggregate_min_max.hpp.

Member Data Documentation

◆ max_

template<typename Type_ >
Type max_
private

maximum value

Definition at line 86 of file aggregate_min_max.hpp.

◆ min_

template<typename Type_ >
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: