Changeset 2158


Ignore:
Timestamp:
Jan 18, 2010, 1:33:15 AM (12 years ago)
Author:
Peter
Message:

qQuantileNormalizer now works with mixed iterators. closes #498

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/normalization_test.cc

    r2157 r2158  
    201201         boost::random_access_iterator_archetype<DataWeight>(),
    202202         boost::mutable_random_access_iterator_archetype<DataWeight>());
     203    qqn4(boost::random_access_iterator_archetype<DataWeight>(),
     204         boost::random_access_iterator_archetype<DataWeight>(),
     205         boost::mutable_random_access_iterator_archetype<double>());
    203206  }
    204207}
  • trunk/yat/normalizer/qQuantileNormalizer.h

    r2154 r2158  
    2121  along with yat. If not, see <http://www.gnu.org/licenses/>.
    2222*/
     23
     24#include "utility.h"
    2325
    2426#include "yat/regression/CSplineInterpolation.h"
     
    241243  {
    242244    Partitioner source(first, last, target_.size());
    243     typename utility::weighted_iterator_traits<RandomAccessIterator2>::type tag;
     245    typename utility::weighted_if_any2<RandomAccessIterator1, RandomAccessIterator2>::type tag;
    244246    normalize(source, first, last, result, tag);
    245247  }
     
    318320    BOOST_CONCEPT_ASSERT((boost::Mutable_RandomAccessIterator<RandomAccessIterator2>));
    319321    // copy the weights
    320     std::copy(utility::weight_iterator(first),
    321               utility::weight_iterator(last),
    322               utility::weight_iterator(result));
     322    detail::copy_weight_if_weighted(first, last, result);
    323323
    324324    double total_w = std::accumulate(utility::weight_iterator(first),
Note: See TracChangeset for help on using the changeset viewer.