yat  0.10.4pre
Public Member Functions
theplu::yat::normalizer::Centralizer< UnaryFunction > Class Template Reference

Centralize a range. More...

#include </scratch/bob/jari/tmp/pristine/yat-0.10.x/yat/normalizer/Centralizer.h>

List of all members.

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

Detailed Description

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

Centralize a range.

The class centralizes a range <tt> [first, last) </tt> in two
steps. First, the center value is calculaterd using the functor
\c UnaryFunction to calculate the center. Second, the center
value is subtracted from each element in range <tt> [first, last)
</tt>. \c UnaryFunction must be a functor that has an operator:
return_type operator()(InputIterator, InputIterator) const

where return_type must be convertible to value_type of InputIterator. By default the center value is calculated as the arithmetic mean via class statistics::Average, but this can be changed using an alternative functor such as statistics::Percentiler.

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:
ufunary function defining the center.

Member Function Documentation

template<class UnaryFunction = statistics::Average>
template<class InputIterator , class ForwardIterator >
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.

Type Requirements:

See also:
std::transform

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

Generated on Mon Nov 11 2013 09:41:45 for yat by  doxygen 1.8.1