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

Generic mean accumulator class. More...

#include <mean.hh>

Inheritance diagram for mln::accu::stat::mean< T, S, M >:

Inheritance graph

List of all members.

Public Types

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

Public Member Functions

accu::math::count< T >::result count () const
 Get the cardinality.
bool is_valid () const
 Check whether this accu is able to return a result.
 mean ()
 operator M () const
subj_ ()
accu::math::sum< T >::result sum () const
 Get the sum of values.
template<typename T>
void take_as_init (const T &t)
 Take as initialization the value t.
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 value of the accumulator.
void init ()
 Manipulators.
void take (const mean< T, S, M > &other)
void take (const argument &t)
void untake (const mean< T, S, M > &other)
void untake (const argument &t)

Protected Attributes

accu::math::count< T > count_
accu::math::sum< T, S > sum_


Detailed Description

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

Generic mean accumulator class.

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

Definition at line 119 of file accu/stat/mean.hh.


Member Typedef Documentation

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

Definition at line 121 of file accu/stat/mean.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 M = S>
typedef M mln::accu::stat::mean< T, S, M >::result

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

Definition at line 122 of file accu/stat/mean.hh.


Constructor & Destructor Documentation

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

Definition at line 165 of file accu/stat/mean.hh.

References mln::accu::stat::mean< T, S, M >::init().


Member Function Documentation

template<typename T, typename S, typename M>
accu::math::count< T >::result mln::accu::stat::mean< T, S, M >::count (  )  const [inline]

Get the cardinality.

Definition at line 242 of file accu/stat/mean.hh.

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

Manipulators.

Definition at line 173 of file accu/stat/mean.hh.

Referenced by mln::accu::stat::mean< T, S, M >::mean().

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

Check whether this accu is able to return a result.

Always true here.

Definition at line 234 of file accu/stat/mean.hh.

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

Definition at line 226 of file accu/stat/mean.hh.

References mln::accu::stat::mean< T, S, M >::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 M>
accu::math::sum< T >::result mln::accu::stat::mean< T, S, M >::sum (  )  const [inline]

Get the sum of values.

Definition at line 251 of file accu/stat/mean.hh.

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

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

Definition at line 181 of file accu/stat/mean.hh.

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

Take as initialization the value t.

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

Reimplemented in mln::accu::stat::variance< T, S, R >.

Definition at line 186 of file accumulator.hh.

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

Referenced by mln::morpho::elementary::impl::gradient_on_function(), and mln::morpho::elementary::impl::gradient_on_function_fastest().

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 M>
M mln::accu::stat::mean< T, S, M >::to_result (  )  const [inline]

Get the value of the accumulator.

Definition at line 216 of file accu/stat/mean.hh.

Referenced by mln::accu::stat::mean< T, S, M >::operator M().

template<typename T, typename S, typename M>
void mln::accu::stat::mean< T, S, M >::untake ( const mean< T, S, M > &  other  )  [inline]

template<typename T, typename S, typename M>
void mln::accu::stat::mean< T, S, M >::untake ( const argument t  )  [inline]

Definition at line 198 of file accu/stat/mean.hh.


Member Data Documentation

template<typename T, typename S = typename mln::value::props< T >::sum, typename M = S>
accu::math::count<T> mln::accu::stat::mean< T, S, M >::count_ [protected]

template<typename T, typename S = typename mln::value::props< T >::sum, typename M = S>
accu::math::sum<T,S> mln::accu::stat::mean< T, S, M >::sum_ [protected]


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