#include <variance.hh>
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. | |
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. | |
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". | |
R | to_result () const |
Get the accumulator result (the variance value). | |
R | 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_ |
S | sum2_ |
S | sum_ |
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.
typedef T mln::accu::stat::variance< T, S, R >::argument |
Definition at line 63 of file variance.hh.
typedef Accumulator<void> mln::Accumulator< E >::category [inherited] |
typedef E mln::Object< E >::exact_t [inherited] |
typedef R mln::accu::internal::base< R, E >::q_result [inherited] |
typedef R mln::accu::stat::variance< T, S, R >::result |
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().
void mln::accu::stat::variance< T, S, R >::init | ( | ) | [inline] |
Manipulators.
Definition at line 125 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_.
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.
Definition at line 229 of file variance.hh.
References mln::accu::stat::variance< T, S, R >::n_.
R mln::accu::stat::variance< T, S, R >::mean | ( | ) | const [inline] |
Definition at line 187 of file variance.hh.
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.
Definition at line 205 of file variance.hh.
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.
Definition at line 221 of file variance.hh.
References mln::accu::stat::variance< T, S, R >::to_result().
R base::subj_ | ( | ) | [inline, inherited] |
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_.
void mln::accu::stat::variance< T, S, R >::take | ( | unsigned | n_times, | |
const argument & | t | |||
) | [inline] |
Definition at line 144 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_.
void mln::accu::stat::variance< T, S, R >::take | ( | const variance< T, S, R > & | other | ) | [inline] |
Definition at line 166 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_.
void mln::accu::stat::variance< T, S, R >::take | ( | const argument & | t | ) | [inline] |
Definition at line 134 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_.
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_.
void mln::Accumulator< E >::take_as_init_ | ( | const T & | t | ) | [inline, inherited] |
Default implementation of "take as initialization".
Reimplemented in mln::accu::math::inf< T >, mln::accu::math::sum< T, S >, mln::accu::math::sup< T >, mln::accu::pair< A1, A2, T >, mln::accu::rms< T, V >, mln::accu::stat::max< T >, mln::accu::stat::min< T >, mln::accu::stat::rank_high_quant< T >, and mln::accu::stat::var< T >.
Definition at line 200 of file accumulator.hh.
References mln::exact().
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().
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().
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.
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] |
Definition at line 213 of file variance.hh.
References mln::accu::stat::variance< T, S, R >::to_result().
unsigned mln::accu::stat::variance< T, S, R >::n_ [protected] |
Definition at line 102 of file variance.hh.
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] |
Definition at line 103 of file variance.hh.
Referenced by mln::accu::stat::variance< T, S, R >::init(), 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 >::sum_ [protected] |
Definition at line 103 of file variance.hh.
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().