Thrill  0.1
AggregateMinMax< Type_ > Class Template Reference

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.

#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...
 
AggregateMinMaxadd (const Type &value) noexcept
 add a value to the running aggregation More...
 
const Typemax () const noexcept
 return maximum over all values aggregated More...
 
const Typemin () const noexcept
 return minimum over all values aggregated More...
 
AggregateMinMax operator+ (const AggregateMinMax &a) const noexcept
 operator + to combine two AggregateMinMax<> More...
 
AggregateMinMaxoperator+= (const AggregateMinMax &a) noexcept
 operator += to combine two AggregateMinMax<> More...
 
template<typename Archive >
void serialize (Archive &archive)
 serialization method for cereal. More...
 
void set_max (const Type &v) noexcept
 change currently aggregated minimum More...
 
void set_min (const Type &v) noexcept
 change currently aggregated minimum More...
 
Type span () const noexcept
 return maximum - minimum over all values aggregated More...
 

Private Attributes

Type max_ = std::numeric_limits<Type>::lowest()
 maximum value More...
 
Type min_ = std::numeric_limits<Type>::max()
 minimum value More...
 

Member Typedef Documentation

◆ Type

using Type = Type_

Definition at line 30 of file aggregate_min_max.hpp.

Constructor & Destructor Documentation

◆ AggregateMinMax() [1/2]

AggregateMinMax ( )
default

default constructor

Referenced by AggregateMinMax< Type_ >::operator+().

◆ AggregateMinMax() [2/2]

AggregateMinMax ( const Type min,
const Type max 
)
inlinenoexcept

initializing constructor

Definition at line 36 of file aggregate_min_max.hpp.

Member Function Documentation

◆ add()

AggregateMinMax& add ( const Type value)
inlinenoexcept

add a value to the running aggregation

Definition at line 40 of file aggregate_min_max.hpp.

References max(), AggregateMinMax< Type_ >::max_, min(), AggregateMinMax< Type_ >::min_, and gen_data::value.

◆ max()

const Type& max ( ) const
inlinenoexcept

return maximum over all values aggregated

Definition at line 50 of file aggregate_min_max.hpp.

References AggregateMinMax< Type_ >::max_.

◆ min()

const Type& min ( ) const
inlinenoexcept

return minimum over all values aggregated

Definition at line 47 of file aggregate_min_max.hpp.

References AggregateMinMax< Type_ >::min_.

◆ operator+()

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

operator + to combine two AggregateMinMax<>

Definition at line 62 of file aggregate_min_max.hpp.

References AggregateMinMax< Type_ >::AggregateMinMax(), max(), AggregateMinMax< Type_ >::max_, min(), and AggregateMinMax< Type_ >::min_.

◆ operator+=()

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

operator += to combine two AggregateMinMax<>

Definition at line 69 of file aggregate_min_max.hpp.

References max(), AggregateMinMax< Type_ >::max_, min(), and AggregateMinMax< Type_ >::min_.

◆ serialize()

void serialize ( Archive &  archive)
inline

serialization method for cereal.

Definition at line 77 of file aggregate_min_max.hpp.

References AggregateMinMax< Type_ >::max_, and AggregateMinMax< Type_ >::min_.

◆ set_max()

void set_max ( const Type v)
inlinenoexcept

change currently aggregated minimum

Definition at line 59 of file aggregate_min_max.hpp.

References AggregateMinMax< Type_ >::max_.

◆ set_min()

void set_min ( const Type v)
inlinenoexcept

change currently aggregated minimum

Definition at line 56 of file aggregate_min_max.hpp.

References AggregateMinMax< Type_ >::min_.

◆ span()

Type span ( ) const
inlinenoexcept

return maximum - minimum over all values aggregated

Definition at line 53 of file aggregate_min_max.hpp.

References AggregateMinMax< Type_ >::max_, and AggregateMinMax< Type_ >::min_.

Member Data Documentation

◆ max_

◆ min_


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