Changeset 3000 for branches/0.10-stable


Ignore:
Timestamp:
Mar 17, 2013, 6:53:07 AM (8 years ago)
Author:
Peter
Message:

fixes bug in KolmogorovSmirnov::remove. closes #753.

Location:
branches/0.10-stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/0.10-stable/test/kolmogorov_smirnov.cc

    r2881 r3000  
    206206  suite.out() << "test remove\n";
    207207  KolmogorovSmirnov ks;
     208  ks.add(0, true);
    208209  ks.add(1, true);
    209210  ks.add(2, false);
     
    211212  ks.add(3, false);
    212213  double score = ks.score();
    213   ks.add(4, false);
     214  double x = 0;
     215  ks.add(x, false);
    214216
    215217  try {
    216     ks.remove(4, false);
     218    ks.remove(x, false);
    217219  }
    218220  catch (std::runtime_error& e) {
  • branches/0.10-stable/yat/statistics/KolmogorovSmirnov.cc

    r2997 r3000  
    113113      return;
    114114    Element e(value, class_label, weight);
    115     typedef std::multiset<Element>::const_iterator iterator;
     115    typedef std::multiset<Element>::iterator iterator;
    116116    std::pair<iterator, iterator> iter = data_.equal_range(e);
    117117    while (iter.first!=iter.second) {
     
    121121        else
    122122          sum_w2_-=weight;
     123        data_.erase(iter.first);
    123124        cached_=false;
    124125        return;
Note: See TracChangeset for help on using the changeset viewer.