Ignore:
Timestamp:
Jan 21, 2009, 2:34:18 AM (12 years ago)
Author:
Peter
Message:

fixes #479 and removing some debug output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/normalizer/Spearman.h

    r1717 r1739  
    5757       permissible for the iterators \a first and \a result to be the
    5858       same.
    59 
    60        \return result + (last-first)
    6159     */
    6260    template<typename ForwardIterator, typename RandomAccessIterator>
    63     RandomAccessIterator operator()(ForwardIterator first, ForwardIterator last,
    64                                     RandomAccessIterator result) const
     61    void operator()(ForwardIterator first, ForwardIterator last,
     62                    RandomAccessIterator result) const
    6563    {
    6664      typename utility::weighted_iterator_traits<ForwardIterator>::type tag;
    67       return normalize(first, last, result, tag);
     65      normalize(first, last, result, tag);
    6866    }
    6967
     
    7270    // unweighted version
    7371    template<typename ForwardIterator, typename RandomAccessIterator>
    74     RandomAccessIterator normalize(ForwardIterator first, ForwardIterator last,
    75                                   RandomAccessIterator result,
    76                                   utility::unweighted_iterator_tag) const
     72    void normalize(ForwardIterator first, ForwardIterator last,
     73                  RandomAccessIterator result,
     74                  utility::unweighted_iterator_tag) const
    7775    {
    7876      std::vector<size_t> perm;
     
    8886          result[perm[min_i]] = res;
    8987      }
    90       return result + std::distance(first, last);
    9188    }
    9289
     
    9491    // weighted version
    9592    template<typename ForwardIterator, typename RandomAccessIterator>
    96     RandomAccessIterator normalize(ForwardIterator first, ForwardIterator last,
    97                                   RandomAccessIterator result,
    98                                   utility::weighted_iterator_tag) const
     93    void normalize(ForwardIterator first, ForwardIterator last,
     94                  RandomAccessIterator result,
     95                  utility::weighted_iterator_tag) const
    9996    {
    10097      std::copy(utility::weight_iterator(first),
     
    134131                     utility::data_iterator(result),
    135132                     std::bind2nd(std::divides<double>(), sum_w));
    136       return result + n;
    137133    }
    138134
Note: See TracChangeset for help on using the changeset viewer.