Changeset 1948


Ignore:
Timestamp:
May 6, 2009, 5:02:21 PM (12 years ago)
Author:
Jari Häkkinen
Message:

Addresses #535. No need to replace NaNs? in the unweighted case. Peter, thanks for pointing this out for me.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.5-stable/yat/normalizer/qQuantileNormalizer.h

    r1947 r1948  
    261261
    262262    std::vector<size_t> sorted_index(last-first);
    263     // Code to avoid problems with NaN (ticket:535)
    264     // utility::sort_index(first, last, sorted_index);
    265     // ... above statement replaced below code block
    266     {
    267       utility::Vector vec(std::distance(first, last));
    268       std::copy(first, last, vec.begin());
    269       for (utility::Vector::iterator i(vec.begin()); i!=vec.end(); ++i)
    270         if (std::isnan((*i)))
    271           *i = std::numeric_limits<double>::infinity();
    272       utility::sort_index(vec.begin(), vec.end(), sorted_index);
    273     }
    274     // end Code to avoid problems with NaN (ticket:535)
     263    utility::sort_index(first, last, sorted_index);
    275264
    276265    utility::Vector diff(source.averages());
     
    403392    utility::Vector vec(std::distance(first, last));
    404393    std::copy(first, last, vec.begin());
    405     // Code to avoid problems with NaN (ticket:535)
    406     for (utility::Vector::iterator i(vec.begin()); i!=vec.end(); ++i)
    407       if (std::isnan((*i)))
    408         *i = std::numeric_limits<double>::infinity();
    409     // end Code to avoid problems with NaN (ticket:535)
    410394    std::sort(vec.begin(), vec.end());
    411395    init(vec, N);
Note: See TracChangeset for help on using the changeset viewer.