1 #ifndef _theplu_yat_normalizer_centralizer_
2 #define _theplu_yat_normalizer_centralizer_
28 #include "yat/statistics/Average.h"
29 #include "yat/utility/concept_check.h"
30 #include "yat/utility/DataIterator.h"
31 #include "yat/utility/iterator_traits.h"
32 #include "yat/utility/WeightIterator.h"
34 #include <boost/concept_check.hpp>
35 #include <boost/iterator/iterator_concepts.hpp>
42 namespace normalizer {
65 template<
class UnaryFunction = statistics::Average>
106 template<
class InputIterator,
class OutputIterator>
108 OutputIterator result)
const
112 BOOST_CONCEPT_ASSERT((boost_concepts::WritableIterator<OutputIterator>));
117 BOOST_CONCEPT_ASSERT((boost_concepts::ForwardTraversal<InputIterator>));
121 check_requirements<OutputIterator>(tag);
124 detail::copy_weight_if_weighted(first, last, result);
125 std::transform(utility::data_iterator(first),
126 utility::data_iterator(last),
127 utility::data_iterator(result),
128 std::bind2nd(std::minus<double>(),func_(first, last)));
133 template<
typename OutputIterator>
136 using boost_concepts::SinglePassIterator;
137 using boost_concepts::WritableIterator;
138 BOOST_CONCEPT_ASSERT((SinglePassIterator<OutputIterator>));
139 BOOST_CONCEPT_ASSERT((WritableIterator<OutputIterator, double>));
143 template<
typename OutputIterator>
146 using boost_concepts::ForwardTraversal;
147 using boost_concepts::WritableIterator;
148 BOOST_CONCEPT_ASSERT((ForwardTraversal<OutputIterator>));
149 BOOST_CONCEPT_ASSERT((WritableIterator<OutputIterator
Centralize a range.
Definition: Centralizer.h:66
Centralizer(void)
default constructor
Definition: Centralizer.h:75
detail::weighted_iterator_traits_detail< value >::type type
Definition: iterator_traits.h:114
Concept check for Data Iterator.
Definition: concept_check.h:228
Definition: iterator_traits.h:47
Centralizer(const UnaryFunction &uf)
Definition: Centralizer.h:80
Holds a pair of data and associated weight.
Definition: DataWeight.h:39
Definition: iterator_traits.h:55
void operator()(InputIterator first, InputIterator last, OutputIterator result) const
Definition: Centralizer.h:107