mln::accu::stat::variance< T, S, R > Struct Template Reference
[On values]

Variance accumulator class. More...

#include <variance.hh>

Inheritance diagram for mln::accu::stat::variance< T, S, R >:

Inheritance graph

List of all members.

Public Types

typedef T argument
typedef Accumulator< void > category
typedef E exact_t
typedef R q_result
typedef R result

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.
subj_ ()
sum () const
 Get the sum value.
template<typename T>
void take_as_init_ (const T &t)
 Default implementation of "take as initialization".
template<typename T>
void take_n_times (unsigned n, const T &t)
 Take n times the value t.
template<typename T>
void take_n_times_ (unsigned n, const T &t)
 Default implementation of "take n times".
to_result () const
 Get the accumulator result (the variance value).
var () const
 Get the variance value.
 variance ()
void init ()
 Manipulators.
void take (unsigned n_times, const argument &t)
void take (const variance< T, S, R > &other)
void take (const argument &t)
void take_as_init (const argument &t)
 Take as initialization the value t.

Protected Attributes

unsigned n_
sum2_
sum_


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 Typedef Documentation

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

Definition at line 63 of file variance.hh.

template<typename E>
typedef Accumulator<void> mln::Accumulator< E >::category [inherited]

Reimplemented from mln::Proxy< E >.

Definition at line 80 of file accumulator.hh.

template<typename E>
typedef E mln::Object< E >::exact_t [inherited]

Definition at line 172 of file object.hh.

template<typename R, typename E>
typedef R mln::accu::internal::base< R, E >::q_result [inherited]

Definition at line 58 of file base.hh.

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

Reimplemented from mln::accu::internal::base< R, E >.

Definition at line 64 of file variance.hh.


Constructor & Destructor Documentation

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

Definition at line 117 of file variance.hh.

References mln::accu::stat::variance< T, S, R >::init().


Member Function Documentation

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

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.

References mln::accu::stat::variance< T, S, R >::n_.

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

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.

References mln::accu::stat::variance< T, S, R >::n_.

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.

References mln::accu::stat::variance< T, S, R >::to_result().

template<typename R, typename E>
R base::subj_ (  )  [inline, inherited]

Definition at line 77 of file base.hh.

References mln::exact().

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.

References mln::accu::stat::variance< T, S, R >::sum_.

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

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

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

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< E >.

Definition at line 156 of file variance.hh.

References mln::accu::stat::variance< T, S, R >::n_, mln::accu::stat::variance< T, S, R >::sum2_, and mln::accu::stat::variance< T, S, R >::sum_.

template<typename E>
template<typename T>
void mln::Accumulator< E >::take_as_init_ ( const T &  t  )  [inline, inherited]

template<typename E>
template<typename T>
void mln::Accumulator< E >::take_n_times ( unsigned  n,
const T &  t 
) [inline, inherited]

Take n times the value t.

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

Definition at line 213 of file accumulator.hh.

References mln::exact(), and mln::mln_exact().

template<typename E>
template<typename T>
void mln::Accumulator< E >::take_n_times_ ( unsigned  n,
const T &  t 
) [inline, inherited]

Default implementation of "take n times".

Reimplemented in mln::accu::stat::var< T >.

Definition at line 230 of file accumulator.hh.

References mln::exact().

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

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.

References mln::accu::stat::variance< T, S, R >::to_result().


Member Data Documentation

template<typename T, typename S = typename mln::value::props< T >::sum, typename R = S>
unsigned mln::accu::stat::variance< T, S, R >::n_ [protected]

template<typename T, typename S = typename mln::value::props< T >::sum, typename R = S>
S mln::accu::stat::variance< T, S, R >::sum2_ [protected]

template<typename T, typename S = typename mln::value::props< T >::sum, typename R = S>
S mln::accu::stat::variance< T, S, R >::sum_ [protected]


Generated on Sun Apr 25 01:57:43 2010 for Milena (Olena) by  doxygen 1.5.6