yat  0.21pre
Public Member Functions | List of all members
theplu::yat::normalizer::RangeNormalizer< UnaryFunction, Operator > Class Template Reference

#include <yat/normalizer/RangeNormalizer.h>

Public Member Functions

 RangeNormalizer (void)
 default constructor More...
 
 RangeNormalizer (const UnaryFunction &uf)
 
 RangeNormalizer (const UnaryFunction &uf, const Operator &op)
 
template<class InputIterator , class OutputIterator >
void operator() (InputIterator first, InputIterator last, OutputIterator result) const
 

Detailed Description

template<class UnaryFunction, class Operator>
class theplu::yat::normalizer::RangeNormalizer< UnaryFunction, Operator >

The class normalizes a range [first, last) in two steps. First, a value is calculaterd using the functor UnaryFunction. Second, the each element in the result range is calculated by applying the operator on the input range and the value. 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.

Operator must be a binary function object class with result type and argument types such that result type is convertible to double and double is convertible to the argument types.

Since
New in yat 0.18

Constructor & Destructor Documentation

◆ RangeNormalizer() [1/3]

template<class UnaryFunction , class Operator >
theplu::yat::normalizer::RangeNormalizer< UnaryFunction, Operator >::RangeNormalizer ( void  )
inline

default constructor

Internal UnaryFunction and Operator are created using default constructors.

◆ RangeNormalizer() [2/3]

template<class UnaryFunction , class Operator >
theplu::yat::normalizer::RangeNormalizer< UnaryFunction, Operator >::RangeNormalizer ( const UnaryFunction &  uf)
inline
Parameters
ufunary function defining the value

◆ RangeNormalizer() [3/3]

template<class UnaryFunction , class Operator >
theplu::yat::normalizer::RangeNormalizer< UnaryFunction, Operator >::RangeNormalizer ( const UnaryFunction &  uf,
const Operator &  op 
)
inline
Parameters
ufunary function defining the value
opbinary function defining the operation applied on the input range

Member Function Documentation

◆ operator()()

template<class UnaryFunction , class Operator >
template<class InputIterator , class OutputIterator >
void theplu::yat::normalizer::RangeNormalizer< UnaryFunction, Operator >::operator() ( InputIterator  first,
InputIterator  last,
OutputIterator  result 
) const
inline

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

It is possible to normalize 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 Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14