Public Types | Public Member Functions | Protected Attributes

mln::accu::math::sum< T, S > Struct Template Reference
[On values]

Generic sum accumulator class. More...

#include <sum.hh>

Inheritance diagram for mln::accu::math::sum< T, S >:
Inheritance graph

List of all members.

Public Types

typedef T argument
typedef Accumulator< void > category
typedef sum< T, S > exact_t
typedef const S & q_result
typedef mln::metal::unqualif
< const S & >::ret 
result

Public Member Functions

bool is_valid () const
 Check whether this accu is able to return a result.
const S & subj_ ()
 sum ()
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".
const S & to_result () const
 Get the value of the accumulator.

void init ()
 Manipulators.
void take (const argument &t)
void take_as_init_ (const argument &t)
void take (const sum< T, S > &other)
void untake (const argument &t)
void untake (const sum< T, S > &other)
void set_value (const S &s)

Protected Attributes

s_

Detailed Description

template<typename T, typename S = typename mln::value::props< T >::sum>
struct mln::accu::math::sum< T, S >

Generic sum accumulator class.

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

Definition at line 112 of file accu/math/sum.hh.


Member Typedef Documentation

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

Definition at line 114 of file accu/math/sum.hh.

typedef Accumulator<void> mln::Accumulator< sum< T, S > >::category [inherited]

Reimplemented from mln::Proxy< sum< T, S > >.

Definition at line 80 of file accumulator.hh.

typedef sum< T, S > mln::Object< sum< T, S > >::exact_t [inherited]

Definition at line 173 of file object.hh.

typedef const S & mln::accu::internal::base< const S & , sum< T, S > >::q_result [inherited]

Definition at line 58 of file base.hh.

typedef mln::metal::unqualif< const S & >::ret mln::accu::internal::base< const S & , sum< T, S > >::result [inherited]

Definition at line 59 of file base.hh.


Constructor & Destructor Documentation

template<typename T , typename S >
mln::accu::math::sum< T, S >::sum (  )  [inline]

Definition at line 153 of file accu/math/sum.hh.

References mln::accu::math::sum< T, S >::init().


Member Function Documentation

template<typename T , typename S >
void mln::accu::math::sum< T, S >::init (  )  [inline]
template<typename T , typename S >
bool mln::accu::math::sum< T, S >::is_valid (  )  const [inline]

Check whether this accu is able to return a result.

Always true here.

Definition at line 222 of file accu/math/sum.hh.

template<typename T , typename S>
void mln::accu::math::sum< T, S >::set_value ( const S &  s  )  [inline]

Definition at line 214 of file accu/math/sum.hh.

References mln::accu::math::sum< T, S >::s_.

const S & mln::accu::internal::base< const S & , sum< T, S > >::subj_ (  )  [inherited]
template<typename T , typename S >
void mln::accu::math::sum< T, S >::take ( const argument t  )  [inline]
template<typename T, typename S>
void mln::accu::math::sum< T, S >::take ( const sum< T, S > &  other  )  [inline]

Definition at line 190 of file accu/math/sum.hh.

References mln::accu::math::sum< T, S >::s_.

void mln::Accumulator< sum< T, S > >::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< sum< T, S > >::take_as_init_ ( const T &  t  )  [inherited]

Default implementation of "take as initialization".

template<typename T , typename S >
void mln::accu::math::sum< T, S >::take_as_init_ ( const argument t  )  [inline]

Definition at line 182 of file accu/math/sum.hh.

References mln::accu::math::sum< T, S >::s_.

void mln::Accumulator< sum< T, S > >::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< sum< T, S > >::take_n_times_ ( unsigned  n,
const T &  t 
) [inherited]

Default implementation of "take n times".

template<typename T , typename S >
const S & mln::accu::math::sum< T, S >::to_result (  )  const [inline]

Get the value of the accumulator.

Definition at line 206 of file accu/math/sum.hh.

References mln::accu::math::sum< T, S >::s_.

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

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

Definition at line 198 of file accu/math/sum.hh.

References mln::accu::math::sum< T, S >::s_.

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

Definition at line 175 of file accu/math/sum.hh.

References mln::accu::math::sum< T, S >::s_.


Member Data Documentation

template<typename T, typename S = typename mln::value::props< T >::sum>
S mln::accu::math::sum< T, S >::s_ [protected]