Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Aggregate< Type_ > Class Template Reference

Detailed Description

template<typename Type_>
class thrill::common::Aggregate< Type_ >

Calculate running aggregate statistics: feed it with values, and it will keep the minimum, the maximum, the average, the value number, and the standard deviation is values.

Definition at line 31 of file aggregate.hpp.

#include <aggregate.hpp>

Public Types

using Type = Type_
 

Public Member Functions

 Aggregate ()=default
 default constructor More...
 
 Aggregate (size_t count, const double &mean, const double nvar, const Type &min, const Type &max) noexcept
 initializing constructor More...
 
AggregateAdd (const Type &value) noexcept
 add a value to the running aggregation More...
 
double Average () const noexcept
 return the average over all values aggregated More...
 
double Avg () const noexcept
 return the average over all values aggregated More...
 
size_t Count () const noexcept
 return number of values aggregated More...
 
const TypeMax () const noexcept
 return maximum over all values aggregated More...
 
double Mean () const noexcept
 return the average over all values aggregated More...
 
const TypeMin () const noexcept
 return minimum over all values aggregated More...
 
Aggregate operator+ (const Aggregate &a) const noexcept
 operator + More...
 
Aggregateoperator+= (const Aggregate &a) noexcept
 operator += More...
 
double StandardDeviation (size_t ddof=1) const
 return the standard deviation of all values aggregated More...
 
double StDev (size_t ddof=1) const
 return the standard deviation of all values aggregated More...
 
template<typename Archive >
void ThrillSerialize (Archive &ar) const
 serialization with Thrill's serializer More...
 
const Type Total () const
 return sum over all values aggregated More...
 

Static Public Member Functions

template<typename Archive >
static Aggregate ThrillDeserialize (Archive &ar)
 deserialization with Thrill's serializer More...
 

Static Public Attributes

static constexpr size_t thrill_fixed_size
 
static constexpr bool thrill_is_fixed_size = true
 

Private Member Functions

double merged_means (const Aggregate &a) const noexcept
 
double merged_variance (const Aggregate &other) const noexcept
 

Private Attributes

size_t count_ = 0
 number of values aggregated More...
 
Type max_ = std::numeric_limits<Type>::lowest()
 maximum value More...
 
double mean_ = 0
 mean of values More...
 
Type min_ = std::numeric_limits<Type>::max()
 minimum value More...
 
double nvar_ = 0.0
 approximate count * variance; stddev = sqrt(nvar / (count-1)) More...
 

Member Typedef Documentation

using Type = Type_

Definition at line 34 of file aggregate.hpp.

Constructor & Destructor Documentation

Aggregate ( )
default

default constructor

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

Aggregate ( size_t  count,
const double &  mean,
const double  nvar,
const Type min,
const Type max 
)
inlinenoexcept

initializing constructor

Definition at line 40 of file aggregate.hpp.

Member Function Documentation

double Average ( ) const
inlinenoexcept

return the average over all values aggregated

Definition at line 72 of file aggregate.hpp.

References Aggregate< Type_ >::mean_.

Referenced by Aggregate< Type_ >::Avg(), and Aggregate< Type_ >::Mean().

double Avg ( ) const
inlinenoexcept

return the average over all values aggregated

Definition at line 75 of file aggregate.hpp.

References Aggregate< Type_ >::Average().

size_t Count ( ) const
inlinenoexcept

return number of values aggregated

Definition at line 65 of file aggregate.hpp.

References Aggregate< Type_ >::count_.

const Type& Max ( ) const
inlinenoexcept

return maximum over all values aggregated

Definition at line 84 of file aggregate.hpp.

References Aggregate< Type_ >::max_.

double Mean ( ) const
inlinenoexcept

return the average over all values aggregated

Definition at line 78 of file aggregate.hpp.

References Aggregate< Type_ >::Average().

double merged_means ( const Aggregate< Type_ > &  a) const
inlineprivatenoexcept
double merged_variance ( const Aggregate< Type_ > &  other) const
inlineprivatenoexcept
const Type& Min ( ) const
inlinenoexcept

return minimum over all values aggregated

Definition at line 81 of file aggregate.hpp.

References Aggregate< Type_ >::min_.

double StandardDeviation ( size_t  ddof = 1) const
inline

return the standard deviation of all values aggregated

Definition at line 87 of file aggregate.hpp.

References Aggregate< Type_ >::count_, and Aggregate< Type_ >::nvar_.

Referenced by Aggregate< Type_ >::StDev().

double StDev ( size_t  ddof = 1) const
inline

return the standard deviation of all values aggregated

Definition at line 96 of file aggregate.hpp.

References Aggregate< Type_ >::StandardDeviation().

static Aggregate ThrillDeserialize ( Archive &  ar)
inlinestatic

deserialization with Thrill's serializer

Definition at line 132 of file aggregate.hpp.

References Aggregate< Type_ >::count_, Aggregate< Type_ >::max_, Aggregate< Type_ >::mean_, Aggregate< Type_ >::min_, and Aggregate< Type_ >::nvar_.

void ThrillSerialize ( Archive &  ar) const
inline

serialization with Thrill's serializer

Definition at line 122 of file aggregate.hpp.

References Aggregate< Type_ >::count_, Aggregate< Type_ >::max_, Aggregate< Type_ >::mean_, Aggregate< Type_ >::min_, and Aggregate< Type_ >::nvar_.

const Type Total ( ) const
inline

return sum over all values aggregated

Definition at line 69 of file aggregate.hpp.

References Aggregate< Type_ >::count_, and Aggregate< Type_ >::mean_.

Member Data Documentation

double nvar_ = 0.0
private
constexpr size_t thrill_fixed_size
static
Initial value:
=
sizeof(size_t) + 2 * sizeof(double) + 2 * sizeof(Type)

Definition at line 143 of file aggregate.hpp.

constexpr bool thrill_is_fixed_size = true
static

Definition at line 142 of file aggregate.hpp.


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