Milena (Olena)  User documentation 2.0a Id
mln::accu::center< P, V > Struct Template Reference

Mass center accumulator. More...

#include <center.hh>

Inherits mln::accu::internal::base< V, center< P, V > >.

List of all members.

Public Member Functions

bool is_valid () const
 Check whether this accu is able to return a result.
unsigned nsites () const
 Return the number of sites taken in consideration.
void take_as_init (const T &t)
 Take as initialization the value t.
void take_n_times (unsigned n, const T &t)
 Take n times the value t.
to_result () const
 Get the value of the accumulator.
void init ()
 Manipulators.

Detailed Description

template<typename P, typename V = typename P::vec>
struct mln::accu::center< P, V >

Mass center accumulator.

Template Parameters:
Pthe type of site.
Vthe type of vector to be used as result. The default vector type is the one provided by P.

Definition at line 55 of file center.hh.


Member Function Documentation

template<typename P , typename V >
void mln::accu::center< P, V >::init ( ) [inline]

Manipulators.

Definition at line 116 of file center.hh.

References mln::literal::zero.

template<typename P , typename V >
bool mln::accu::center< P, V >::is_valid ( ) const [inline]

Check whether this accu is able to return a result.

Definition at line 160 of file center.hh.

template<typename P , typename V >
unsigned mln::accu::center< P, V >::nsites ( ) const [inline]

Return the number of sites taken in consideration.

Definition at line 168 of file center.hh.

void mln::Accumulator< center< P, V > >::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< center< P, V > >::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 '_').

template<typename P , typename V >
V mln::accu::center< P, V >::to_result ( ) const [inline]

Get the value of the accumulator.

Definition at line 142 of file center.hh.

 All Classes Namespaces Functions Variables Typedefs Enumerator