Generic sum accumulator class. More...
#include <sum.hh>
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 | set_value (const S &s) |
Protected Attributes | |
S | 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
.
typedef T mln::accu::math::sum< T, S >::argument |
typedef Accumulator<void> mln::Accumulator< sum< T, S > >::category [inherited] |
Reimplemented from mln::Proxy< sum< T, S > >.
typedef sum< T, S > mln::Object< sum< T, S > >::exact_t [inherited] |
typedef const S & mln::accu::internal::base< const S & , sum< T, S > >::q_result [inherited] |
typedef mln::metal::unqualif< const S & >::ret mln::accu::internal::base< const S & , sum< T, S > >::result [inherited] |
mln::accu::math::sum< T, S >::sum | ( | ) | [inline] |
References mln::accu::math::sum< T, S >::init().
void mln::accu::math::sum< T, S >::init | ( | ) | [inline] |
Manipulators.
References mln::accu::math::sum< T, S >::s_, and mln::literal::zero.
Referenced by mln::accu::math::sum< T, S >::sum().
bool mln::accu::math::sum< T, S >::is_valid | ( | ) | const [inline] |
Check whether this accu is able to return a result.
Always true here.
void mln::accu::math::sum< T, S >::set_value | ( | const S & | s | ) | [inline] |
References mln::accu::math::sum< T, S >::s_.
const S & mln::accu::internal::base< const S & , sum< T, S > >::subj_ | ( | ) | [inherited] |
void mln::accu::math::sum< T, S >::take | ( | const sum< T, S > & | other | ) | [inline] |
References mln::accu::math::sum< T, S >::s_.
void mln::accu::math::sum< T, S >::take | ( | const argument & | t | ) | [inline] |
References mln::accu::math::sum< T, S >::s_.
Referenced by mln::registration::compute_distance_criteria().
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".
void mln::accu::math::sum< T, S >::take_as_init_ | ( | const argument & | t | ) | [inline] |
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".
const S & mln::accu::math::sum< T, S >::to_result | ( | ) | const [inline] |
Get the value of the accumulator.
References mln::accu::math::sum< T, S >::s_.
void mln::accu::math::sum< T, S >::untake | ( | const argument & | t | ) | [inline] |
References mln::accu::math::sum< T, S >::s_.
S mln::accu::math::sum< T, S >::s_ [protected] |