Changeset 2149


Ignore:
Timestamp:
Jan 17, 2010, 4:28:14 AM (12 years ago)
Author:
Peter
Message:

fixes #543

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/normalization_test.cc

    r2148 r2149  
    400400  suite.add(suite.equal(res(0,2).data(), 2.0/3));
    401401  suite.add(suite.equal(res(0,3).data(), 0.5/3));
     402  // compile test should not be run
     403  if (false) {
     404    spearman(boost::random_access_iterator_archetype<double>(),
     405             boost::random_access_iterator_archetype<double>(),
     406             boost::mutable_random_access_iterator_archetype<double>());
     407  }
     408
    402409}
    403410
  • trunk/yat/normalizer/Spearman.h

    r2148 r2149  
    2929#include "yat/utility/WeightIterator.h"
    3030
     31#include <boost/concept_check.hpp>
     32
    3133#include <algorithm>
    3234#include <functional>
     
    5860       permissible for the iterators \a first and \a result to be the
    5961       same.
     62
     63       Type Requirements:
     64       - RandomAccessIter1 must be a \random_access_iterator
     65       - RandomAccessIter2 must be a mutable \random_access_iterator
     66
    6067     */
    61     template<typename ForwardIterator, typename RandomAccessIterator>
    62     void operator()(ForwardIterator first, ForwardIterator last,
    63                     RandomAccessIterator result) const
     68    template<typename RandomAccessIter1, typename RandomAccessIter2>
     69    void operator()(RandomAccessIter1 first, RandomAccessIter1 last,
     70                    RandomAccessIter2 result) const
    6471    {
    65       typename utility::weighted_iterator_traits<ForwardIterator>::type tag;
     72      using boost::function_requires;
     73      function_requires<boost::RandomAccessIterator<RandomAccessIter1> >();
     74      function_requires<boost::Mutable_RandomAccessIterator<RandomAccessIter2> >();
     75      typename utility::weighted_iterator_traits<RandomAccessIter1>::type tag;
    6676      normalize(first, last, result, tag);
    6777    }
Note: See TracChangeset for help on using the changeset viewer.