Ignore:
Timestamp:
Sep 19, 2008, 4:29:24 PM (14 years ago)
Author:
Peter
Message:

fixes #439 - and also took care of ties

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/normalization_test.cc

    r1511 r1512  
    129129  correct.push_back(7.0/8);
    130130  correct.push_back(3.0/8);
    131   suite.xadd(suite.equal_range(vec.begin(), vec.end(), correct.begin()));
     131  suite.add(suite.equal_range(vec.begin(), vec.end(), correct.begin()));
    132132  suite.err() << "Testing Spearman with ties\n";
    133133  vec[1]=vec[2];
    134134  correct[1] = correct[2] = (correct[1]+correct[2])/2;
    135   suite.xadd(suite.equal_range(vec.begin(), vec.end(), correct.begin()));
     135  spearman(vec.begin(), vec.end(), vec.begin());
     136  suite.add(suite.equal_range(vec.begin(), vec.end(), correct.begin()));
    136137  test_spearman_weighted(suite);
    137138}
     
    185186  m(0,1).weight() = 0.0;
    186187  spearman(m.begin_row(0), m.end_row(0), res.begin_row(0));
    187   suite.xadd(suite.equal(res(0,0).data(), 0.5/3));
    188   suite.xadd(suite.equal(res(0,2).data(), 2.5/3));
    189   suite.xadd(suite.equal(res(0,3).data(), 1.5/3));
     188  suite.add(suite.equal(res(0,0).data(), 0.5/3));
     189  suite.add(suite.equal(res(0,2).data(), 2.5/3));
     190  suite.add(suite.equal(res(0,3).data(), 1.5/3));
     191
     192  suite.err() << "Testing case with ties\n";
     193  m(0,0).data() = m(0,2).data();
     194  spearman(m.begin_row(0), m.end_row(0), res.begin_row(0));
     195  suite.add(suite.equal(res(0,0).data(), 2.0/3));
     196  suite.add(suite.equal(res(0,2).data(), 2.0/3));
     197  suite.add(suite.equal(res(0,3).data(), 0.5/3));
    190198}
Note: See TracChangeset for help on using the changeset viewer.