Changeset 1511 for trunk


Ignore:
Timestamp:
Sep 19, 2008, 3:18:53 PM (13 years ago)
Author:
Peter
Message:

refs #437 modified test to reflect new spec

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/normalization_test.cc

    r1509 r1511  
    125125  spearman(vec.begin(), vec.end(), vec.begin());
    126126  std::vector<double> correct;
    127   correct.push_back(0);
    128   correct.push_back(0.5);
    129   correct.push_back(0.75);
    130   correct.push_back(0.25);
    131   suite.equal_range(vec.begin(), vec.end(), correct.begin());
     127  correct.push_back(1.0/8);
     128  correct.push_back(5.0/8);
     129  correct.push_back(7.0/8);
     130  correct.push_back(3.0/8);
     131  suite.xadd(suite.equal_range(vec.begin(), vec.end(), correct.begin()));
     132  suite.err() << "Testing Spearman with ties\n";
     133  vec[1]=vec[2];
     134  correct[1] = correct[2] = (correct[1]+correct[2])/2;
     135  suite.xadd(suite.equal_range(vec.begin(), vec.end(), correct.begin()));
    132136  test_spearman_weighted(suite);
    133137}
     
    181185  m(0,1).weight() = 0.0;
    182186  spearman(m.begin_row(0), m.end_row(0), res.begin_row(0));
    183   suite.add(suite.equal(res(0,0).data(), 0));
    184   suite.add(suite.equal(res(0,2).data(), 2.0/3));
    185   suite.add(suite.equal(res(0,3).data(), 1.0/3));
     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));
    186190}
Note: See TracChangeset for help on using the changeset viewer.