Ignore:
Timestamp:
Jan 15, 2009, 10:15:26 PM (12 years ago)
Author:
Jari Häkkinen
Message:

Fixes #476. Improved estimate() doc and added test on estimate() return value.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/nni_test.cc

    r1669 r1726  
    6969  utility::Matrix weight(weight_stream);
    7070  utility::kNNI knni(data,weight,neighbours);
    71   knni.estimate();
     71  unsigned int nonimputed=knni.estimate();
     72  if (!suite.equal(nonimputed,15)) {
     73    suite.err() << "kNNI FAILED, unexpected number of non imputed rows" << std::endl;
     74    suite.add(false);
     75  }
    7276  std::ifstream control_stream(knni_result.c_str());
    7377  utility::Matrix control(control_stream);
     
    9094  weight=utility::Matrix(weight_stream);
    9195  utility::WeNNI wenni(data,weight,neighbours);
    92   wenni.estimate();
     96  nonimputed=wenni.estimate();
     97  if (!suite.equal(nonimputed,15)) {
     98    suite.err() << "WeNNI FAILED, unexpected number of non imputed rows" << std::endl;
     99    suite.add(false);
     100  }
    93101  control_stream.open(wenni_result.c_str());
    94102  control=utility::Matrix(control_stream);
     
    110118  weight=utility::Matrix(weight_stream);
    111119  utility::WeNNI wenni2(data,weight,neighbours);
    112   wenni2.estimate();
     120  nonimputed=wenni2.estimate();
     121  if (!suite.equal(nonimputed,15)) {
     122    suite.err() << "binary WeNNI FAILED, unexpected number of non imputed rows"
     123                << std::endl;
     124    suite.add(false);
     125  }
    113126  control_stream.open(knni_result.c_str());
    114127  control=utility::Matrix(control_stream);
Note: See TracChangeset for help on using the changeset viewer.