Milena (Olena)  User documentation 2.0a Id
mln::accu::stat::variance< T, S, R > Struct Template Reference

Variance accumulator class. More...

#include <variance.hh>

Inherits mln::accu::internal::base< R, variance< T, S, R > >.

List of all members.

Public Member Functions

bool is_valid () const
 Check whether this accu is able to return a result.
mean () const
 Get the mean value.
unsigned n_items () const
 Get the number of items.
standard_deviation () const
 Get the standard deviation value.
sum () const
 Get the sum value.
void take_n_times (unsigned n, const T &t)
 Take n times the value t.
to_result () const
 Get the accumulator result (the variance value).
var () const
 Get the variance value.
void init ()
 Manipulators.
void take_as_init (const argument &t)
 Take as initialization the value t.

Detailed Description

template<typename T, typename S = typename mln::value::props< T >::sum, typename R = S>
struct mln::accu::stat::variance< T, S, R >

Variance accumulator class.

Parameter T is the type of values that we sum. Parameter S is the type to store the value sum and the sum of value * value; the default type of S is the summation type (property) of T. Parameter R is the type of the mean and variance values; the default type of R is S.

Definition at line 61 of file variance.hh.


Member Function Documentation

template<typename T , typename S , typename R >
void mln::accu::stat::variance< T, S, R >::init ( ) [inline]

Manipulators.

Definition at line 125 of file variance.hh.

References mln::literal::zero.

template<typename T , typename S , typename R >
bool mln::accu::stat::variance< T, S, R >::is_valid ( ) const [inline]

Check whether this accu is able to return a result.

Always true here.

Definition at line 229 of file variance.hh.

template<typename T , typename S , typename R >
R mln::accu::stat::variance< T, S, R >::mean ( ) const [inline]

Get the mean value.

Definition at line 187 of file variance.hh.

References mln::literal::zero.

template<typename T , typename S , typename R >
unsigned mln::accu::stat::variance< T, S, R >::n_items ( ) const [inline]

Get the number of items.

Definition at line 205 of file variance.hh.

template<typename T , typename S , typename R >
R mln::accu::stat::variance< T, S, R >::standard_deviation ( ) const [inline]

Get the standard deviation value.

Definition at line 221 of file variance.hh.

template<typename T , typename S , typename R >
S mln::accu::stat::variance< T, S, R >::sum ( ) const [inline]

Get the sum value.

Definition at line 197 of file variance.hh.

template<typename T , typename S , typename R >
void mln::accu::stat::variance< T, S, R >::take_as_init ( const argument &  t) [inline]

Take as initialization the value t.

Dev note: this is a final method; override if needed by take_as_init_ (ending with '_').

Reimplemented from mln::Accumulator< variance< T, S, R > >.

Definition at line 156 of file variance.hh.

void mln::Accumulator< variance< T, S, R > >::take_n_times ( unsigned  n,
const T &  t 
) [inherited]

Take n times the value t.

Dev note: this is a final method; override if needed by take_as_init_ (ending with '_').

template<typename T , typename S , typename R >
R mln::accu::stat::variance< T, S, R >::to_result ( ) const [inline]

Get the accumulator result (the variance value).

Definition at line 176 of file variance.hh.

template<typename T , typename S , typename R >
R mln::accu::stat::variance< T, S, R >::var ( ) const [inline]

Get the variance value.

Definition at line 213 of file variance.hh.

 All Classes Namespaces Functions Variables Typedefs Enumerator