Changeset 3571


Ignore:
Timestamp:
Jan 10, 2017, 6:47:56 AM (7 years ago)
Author:
Peter
Message:

closes #875

With new version of sort_index (since yat 0.13) allows sorting ranges
of DataWeight?, which behaves as desired, use that function rather than
copying input range.

File:
1 edited

Legend:

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

    r3550 r3571  
    328328
    329329    std::vector<size_t> sorted_index(last-first);
    330     // Code to avoid problems with NaN (ticket:535)
    331     // utility::sort_index(utility::data_iterator(first),
    332     //                     utility::data_iterator(last), sorted_index);
    333     // ... above statement replaced below code block
    334     {
    335       using namespace utility;
    336       std::vector<double> vec;
    337       vec.reserve(std::distance(first, last));
    338       std::copy(utility::data_iterator(first), utility::data_iterator(last),
    339                 std::back_inserter(vec));
    340       for (std::vector<double>::iterator i(vec.begin()); i!=vec.end(); ++i)
    341         if (std::isnan(*i))
    342           *i = std::numeric_limits<double>::infinity();
    343       utility::sort_index(vec.begin(), vec.end(), sorted_index);
    344     }
    345     // end Code to avoid problems with NaN (ticket:535)
     330    utility::sort_index(first, last, sorted_index);
    346331
    347332    utility::Vector diff(source.averages());
Note: See TracChangeset for help on using the changeset viewer.