Changeset 4080


Ignore:
Timestamp:
Aug 26, 2021, 3:43:15 PM (3 months ago)
Author:
Peter
Message:

speedup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/kendall-score/yat/statistics/Kendall.cc

    r4068 r4080  
    313313      }
    314314
    315       Y.insert(it->second);
    316       // FIXME can we use return value from insert instead
    317       auto lower = Y.lower_bound(it->second);
     315      auto lower = Y.insert(it->second);
     316      if (lower!=Y.begin() && *std::prev(lower) == it->second)
     317        lower = Y.lower_bound(it->second);
    318318      // number of element in Y smaller than it->second
    319319      int n_smaller = Y.ranking(lower);
Note: See TracChangeset for help on using the changeset viewer.