1 #ifndef _theplu_yat_normalizer_centralizer_
2 #define _theplu_yat_normalizer_centralizer_
28 #include "yat/statistics/Average.h"
29 #include "yat/utility/DataIterator.h"
30 #include "yat/utility/iterator_traits.h"
31 #include "yat/utility/WeightIterator.h"
33 #include <boost/concept_check.hpp>
34 #include <boost/iterator/iterator_concepts.hpp>
41 namespace normalizer {
64 template<
class UnaryFunction = statistics::Average>
105 template<
class InputIterator,
class OutputIterator>
107 OutputIterator result)
const
109 BOOST_CONCEPT_ASSERT((boost_concepts::ReadableIterator<InputIterator>));
113 BOOST_CONCEPT_ASSERT((boost_concepts::ForwardTraversal<InputIterator>));
117 check_requirements<OutputIterator>(tag);
120 detail::copy_weight_if_weighted(first, last, result);
121 std::transform(utility::data_iterator(first),
122 utility::data_iterator(last),
123 utility::data_iterator(result),
124 std::bind2nd(std::minus<double>(),func_(first, last)));
129 template<
typename OutputIterator>
132 using boost_concepts::SinglePassIterator;
133 using boost_concepts::ReadableIterator;
134 using boost_concepts::WritableIterator;
135 BOOST_CONCEPT_ASSERT((SinglePassIterator<OutputIterator>));
136 BOOST_CONCEPT_ASSERT((ReadableIterator<OutputIterator>));
137 BOOST_CONCEPT_ASSERT((WritableIterator<OutputIterator, double>));
141 template<
typename OutputIterator>
144 using boost_concepts::ForwardTraversal;
145 using boost_concepts::ReadableIterator;
146 using boost_concepts::WritableIterator;
147 BOOST_CONCEPT_ASSERT((ForwardTraversal<OutputIterator>));
148 BOOST_CONCEPT_ASSERT((ReadableIterator<OutputIterator>));
149 BOOST_CONCEPT_ASSERT((WritableIterator<OutputIterator
Centralize a range.
Definition: Centralizer.h:65
Centralizer(void)
default constructor
Definition: Centralizer.h:74
detail::weighted_iterator_traits_detail< value >::type type
Definition: iterator_traits.h:114
Definition: iterator_traits.h:47
Centralizer(const UnaryFunction &uf)
Definition: Centralizer.h:79
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:106