Changeset 1739 for trunk/yat/normalizer/Centralizer.h
- Timestamp:
- Jan 21, 2009, 2:34:18 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/normalizer/Centralizer.h
r1717 r1739 74 74 75 75 \see std::transform 76 77 \return result + (last-first)78 76 */ 79 77 template<class InputIterator, class OutputIterator> 80 OutputIteratoroperator()(InputIterator first, InputIterator last,81 78 void operator()(InputIterator first, InputIterator last, 79 OutputIterator result) const 82 80 { 83 81 typename utility::weighted_iterator_traits<InputIterator>::type tag; 84 return normalize(first, last, result, tag); 85 82 normalize(first, last, result, tag); 86 83 } 87 84 … … 91 88 // unweighted version 92 89 template<class InputIterator, class OutputIterator> 93 OutputIterator normalize(InputIterator first, InputIterator last, 94 OutputIterator result, 95 utility::unweighted_iterator_tag tag) const 90 void normalize(InputIterator first,InputIterator last,OutputIterator result, 91 utility::unweighted_iterator_tag tag) const 96 92 { 97 return std::transform(first, last, 98 result, std::bind2nd(std::minus<double>(), 99 func_(first, last))); 93 std::transform(first, last, result, 94 std::bind2nd(std::minus<double>(), func_(first, last))); 100 95 } 101 96 … … 103 98 // weighted version 104 99 template<class InputIterator, class OutputIterator> 105 OutputIterator normalize(InputIterator first, InputIterator last, 106 OutputIterator result, 107 utility::weighted_iterator_tag tag) const 100 void normalize(InputIterator first,InputIterator last,OutputIterator result, 101 utility::weighted_iterator_tag tag) const 108 102 { 109 103 std::copy(utility::weight_iterator(first), … … 113 107 utility::data_iterator(last), 114 108 utility::data_iterator(result), 115 std::bind2nd(std::minus<double>(), 116 func_(first, last))); 117 return result + std::distance(first, last); 109 std::bind2nd(std::minus<double>(),func_(first, last))); 118 110 } 119 111
Note: See TracChangeset
for help on using the changeset viewer.