Changeset 1755


Ignore:
Timestamp:
Jan 27, 2009, 7:54:19 PM (14 years ago)
Author:
Peter
Message:

simplify code by using std::ceil - refs #425

File:
1 edited

Legend:

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

    r1751 r1755  
    3030
    3131#include <algorithm>
     32#include <cmath>
    3233#include <iterator>
    3334#include <stdexcept>
     
    221222    // all points in the first part.
    222223    size_t start=0;
    223     size_t end=static_cast<unsigned int>(idx(0));
    224     // The first condition below takes care of limiting case number
    225     // of parts approximately equal to the number of matrix rows and
    226     // the second condition makes sure that index is large enough
    227     // when using cspline below ... the static cast above takes the
    228     // floor whereas we want to take the "roof" forcing next index
    229     // range to be within interpolation range for the cspline.
    230     if ((end==0) || (end<idx(0)))
     224    size_t end=static_cast<unsigned int>(std::ceil(idx(0)));
     225    // take care of limiting case number of parts approximately equal
     226    // to the number of elements in range.
     227    if (end==0)
    231228      ++end;
    232229    for (size_t row=start; row<end; ++row) {
Note: See TracChangeset for help on using the changeset viewer.