Changeset 1739 for trunk/yat/normalizer/Spearman.h
 Timestamp:
 Jan 21, 2009, 2:34:18 AM (12 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/normalizer/Spearman.h
r1717 r1739 57 57 permissible for the iterators \a first and \a result to be the 58 58 same. 59 60 \return result + (lastfirst)61 59 */ 62 60 template<typename ForwardIterator, typename RandomAccessIterator> 63 RandomAccessIteratoroperator()(ForwardIterator first, ForwardIterator last,64 61 void operator()(ForwardIterator first, ForwardIterator last, 62 RandomAccessIterator result) const 65 63 { 66 64 typename utility::weighted_iterator_traits<ForwardIterator>::type tag; 67 returnnormalize(first, last, result, tag);65 normalize(first, last, result, tag); 68 66 } 69 67 … … 72 70 // unweighted version 73 71 template<typename ForwardIterator, typename RandomAccessIterator> 74 RandomAccessIteratornormalize(ForwardIterator first, ForwardIterator last,75 76 72 void normalize(ForwardIterator first, ForwardIterator last, 73 RandomAccessIterator result, 74 utility::unweighted_iterator_tag) const 77 75 { 78 76 std::vector<size_t> perm; … … 88 86 result[perm[min_i]] = res; 89 87 } 90 return result + std::distance(first, last);91 88 } 92 89 … … 94 91 // weighted version 95 92 template<typename ForwardIterator, typename RandomAccessIterator> 96 RandomAccessIteratornormalize(ForwardIterator first, ForwardIterator last,97 98 93 void normalize(ForwardIterator first, ForwardIterator last, 94 RandomAccessIterator result, 95 utility::weighted_iterator_tag) const 99 96 { 100 97 std::copy(utility::weight_iterator(first), … … 134 131 utility::data_iterator(result), 135 132 std::bind2nd(std::divides<double>(), sum_w)); 136 return result + n;137 133 } 138 134
Note: See TracChangeset
for help on using the changeset viewer.