#include <yat/normalizer/Centralizer.h>
Public Member Functions | |
Centralizer (void) | |
default constructor | |
Centralizer (const UnaryFunction &uf) | |
template<class InputIterator , class ForwardIterator > | |
void | operator() (InputIterator first, InputIterator last, ForwardIterator result) const |
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.
Type Requirements:
theplu::yat::normalizer::Centralizer< UnaryFunction >::Centralizer | ( | void | ) | [inline] |
default constructor
Internal UnaryFunction is created using its default constructor.
theplu::yat::normalizer::Centralizer< UnaryFunction >::Centralizer | ( | const UnaryFunction & | uf | ) | [inline] |
uf | unary function defining the center. |
void theplu::yat::normalizer::Centralizer< UnaryFunction >::operator() | ( | InputIterator | first, | |
InputIterator | last, | |||
ForwardIterator | 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.