Variance accumulator class. More...
#include <variance.hh>
Public Types | |
typedef T | argument |
typedef Accumulator< void > | category |
typedef variance< T, S, R > | 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. | |
R | mean () const |
Get the mean value. | |
unsigned | n_items () const |
Get the number of items. | |
R | standard_deviation () const |
Get the standard deviation value. | |
R | subj_ () |
S | sum () const |
Get the sum value. | |
void | take_as_init (const T &t) |
Take as initialization the value t . | |
void | take_as_init_ (const T &t) |
Default implementation of "take as initialization". | |
void | take_n_times (unsigned n, const T &t) |
Take n times the value t . | |
void | take_n_times_ (unsigned n, const T &t) |
Default implementation of "take n times". | |
R | to_result () const |
Get the accumulator result (the variance value). | |
R | var () const |
Get the variance value. | |
variance () | |
void | init () |
Manipulators. | |
void | take_as_init (const argument &t) |
void | take (const argument &t) |
void | take (const variance< T, S, R > &other) |
void | take (unsigned n_times, const argument &t) |
Protected Attributes | |
unsigned | n_ |
S | sum2_ |
S | sum_ |
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
.
typedef T mln::accu::stat::variance< T, S, R >::argument |
typedef Accumulator<void> mln::Accumulator< variance< T, S, R > >::category [inherited] |
Reimplemented from mln::Proxy< variance< T, S, R > >.
typedef variance< T, S, R > mln::Object< variance< T, S, R > >::exact_t [inherited] |
typedef R mln::accu::internal::base< R, variance< T, S, R > >::q_result [inherited] |
typedef R mln::accu::stat::variance< T, S, R >::result |
Reimplemented from mln::accu::internal::base< R, variance< T, S, R > >.
mln::accu::stat::variance< T, S, R >::variance | ( | ) | [inline] |
References mln::accu::stat::variance< T, S, R >::init().
void mln::accu::stat::variance< T, S, R >::init | ( | ) | [inline] |
Manipulators.
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_.
Referenced by mln::accu::stat::variance< T, S, R >::variance().
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.
References mln::accu::stat::variance< T, S, R >::n_.
R mln::accu::stat::variance< T, S, R >::mean | ( | ) | const [inline] |
Get the mean value.
References mln::accu::stat::variance< T, S, R >::n_, and mln::accu::stat::variance< T, S, R >::sum_.
unsigned mln::accu::stat::variance< T, S, R >::n_items | ( | ) | const [inline] |
Get the number of items.
References mln::accu::stat::variance< T, S, R >::n_.
R mln::accu::stat::variance< T, S, R >::standard_deviation | ( | ) | const [inline] |
Get the standard deviation value.
References mln::accu::stat::variance< T, S, R >::to_result().
R mln::accu::internal::base< R, variance< T, S, R > >::subj_ | ( | ) | [inherited] |
S mln::accu::stat::variance< T, S, R >::sum | ( | ) | const [inline] |
Get the sum value.
References mln::accu::stat::variance< T, S, R >::sum_.
void mln::accu::stat::variance< T, S, R >::take | ( | const variance< T, S, R > & | other | ) | [inline] |
void mln::accu::stat::variance< T, S, R >::take | ( | unsigned | n_times, | |
const argument & | t | |||
) | [inline] |
void mln::accu::stat::variance< T, S, R >::take | ( | const argument & | t | ) | [inline] |
void mln::accu::stat::variance< T, S, R >::take_as_init | ( | const argument & | t | ) | [inline] |
void mln::Accumulator< variance< T, S, R > >::take_as_init | ( | const T & | t | ) | [inherited] |
Take as initialization the value t
.
Dev note: this is a final method; override if needed by take_as_init_ (ending with '_').
void mln::Accumulator< variance< T, S, R > >::take_as_init_ | ( | const T & | t | ) | [inherited] |
Default implementation of "take as initialization".
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 '_').
void mln::Accumulator< variance< T, S, R > >::take_n_times_ | ( | unsigned | n, | |
const T & | t | |||
) | [inherited] |
Default implementation of "take n times".
R mln::accu::stat::variance< T, S, R >::to_result | ( | ) | const [inline] |
Get the accumulator result (the variance value).
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_.
Referenced by mln::accu::stat::variance< T, S, R >::standard_deviation(), and mln::accu::stat::variance< T, S, R >::var().
R mln::accu::stat::variance< T, S, R >::var | ( | ) | const [inline] |
Get the variance value.
References mln::accu::stat::variance< T, S, R >::to_result().
unsigned mln::accu::stat::variance< T, S, R >::n_ [protected] |
Referenced by mln::accu::stat::variance< T, S, R >::init(), mln::accu::stat::variance< T, S, R >::is_valid(), mln::accu::stat::variance< T, S, R >::mean(), mln::accu::stat::variance< T, S, R >::n_items(), mln::accu::stat::variance< T, S, R >::take(), mln::accu::stat::variance< T, S, R >::take_as_init(), and mln::accu::stat::variance< T, S, R >::to_result().
S mln::accu::stat::variance< T, S, R >::sum2_ [protected] |
S mln::accu::stat::variance< T, S, R >::sum_ [protected] |
Referenced by mln::accu::stat::variance< T, S, R >::init(), mln::accu::stat::variance< T, S, R >::mean(), mln::accu::stat::variance< T, S, R >::sum(), mln::accu::stat::variance< T, S, R >::take(), mln::accu::stat::variance< T, S, R >::take_as_init(), and mln::accu::stat::variance< T, S, R >::to_result().