theplu::yat::normalizer::Centralizer< UnaryFunction > Class Template Reference

Centralize a range. More...

#include <yat/normalizer/Centralizer.h>

List of all members.

Public Member Functions

 Centralizer (void)
 default constructor
 Centralizer (const UnaryFunction &uf)
template<class InputIterator, class OutputIterator>
void operator() (InputIterator first, InputIterator last, OutputIterator result) const


Detailed Description

template<class UnaryFunction = statistics::Average>
class theplu::yat::normalizer::Centralizer< UnaryFunction >

Centralize a range.

The center is calculated and then that value is subtracted from each element. By default the center is defined as the arithmetic mean, but this can be changed by providing a suitable UnaryFunction.

Since:
New in yat 0.5

Constructor & Destructor Documentation

template<class UnaryFunction = statistics::Average>
theplu::yat::normalizer::Centralizer< UnaryFunction >::Centralizer ( void   )  [inline]

default constructor

Internal UnaryFunction is created using its default constructor.

template<class UnaryFunction = statistics::Average>
theplu::yat::normalizer::Centralizer< UnaryFunction >::Centralizer ( const UnaryFunction &  uf  )  [inline]

Parameters:
uf unary function defining the center.


Member Function Documentation

template<class UnaryFunction = statistics::Average>
template<class InputIterator, class OutputIterator>
void theplu::yat::normalizer::Centralizer< UnaryFunction >::operator() ( InputIterator  first,
InputIterator  last,
OutputIterator  result 
) const [inline]

Calculates the center c of the range [first, last) using UnaryFunction. This value, c, is then subtracted from each element in the range [first, last) and assigned to the corresponding element in range [result, result + (last-first) ).

It is possible to centralize a range "in place"; it is permissible for the iterators first and result to be the same.

See also:
std::transform


The documentation for this class was generated from the following file:

Generated on Tue Jan 18 02:20:10 2011 for yat by  doxygen 1.5.5