Changeset 86


Ignore:
Timestamp:
Apr 4, 2006, 9:00:40 AM (15 years ago)
Author:
Jari Häkkinen
Message:

Changed most tests to do numerical tests instead of diffs.

Location:
trunk/se/lu/thep/wenni
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/se/lu/thep/wenni/INSTALL

    r83 r86  
    3131
    3232i) Download and unpack WeNNI. 'cd' to the root directory of the
    33    distribution.
     33   distribution.
     34
    3435
    3536ii) If you are going to run WeNNI as a plug-in to BASE, do the
    36   following steps starting in the WeNNI distribution root directory
     37  following steps starting in the WeNNI distribution root directory
    3738
    3839     $ mkdir BASE-plugindevkit
     
    8081   If all went well a few binaries where created.
    8182
     83
    8284v) Optionally, run the test program
    8385
    84      $ make check
     86     $ make check
     87
     88   The numerical checks are very resitrictive, if 'make check' fails
     89   this may due to this. You can loosen the error bound in the tests
     90   by changing the default in test/wenni_test.cc line 17:
     91
     92     bool compare(const std::string&, const std::string&,
     93                  double error_bound=1e-20);
     94
    8595
    8696vi) BASErs need to copy the binaries to their plug-in directory on the
  • trunk/se/lu/thep/wenni/TODO

    r83 r86  
    11$Id$
    22
    3 wenni_test uses 'diff' to compare results generated with WeNNI for
    4 all cases except test for WeNNI with SNR input. In the latter case
    5 numerical check are performed. This should be done for all checks that
    6 has numerical results.
    7 
    83Add configure option to compile a stand alone or plug-in WeNNI.
  • trunk/se/lu/thep/wenni/test/wenni_test.cc

    r75 r86  
    1515bool check_wenni_snr_results(void);
    1616bool cleanup(void);
    17 bool compare(const std::string&,const std::string&);
    18 bool diff(const std::string&,const std::string&);
     17bool compare(const std::string&, const std::string&, double error_bound=1e-20);
     18bool diff(const std::string&, const std::string&);
    1919bool rm(const std::string& filename);
    2020
     
    6969  teststatus|=diff("BASEfile.data","../data/basefile_in.data");
    7070  teststatus|=diff("basefile_out.data","../data/basefile_out.data");
    71   teststatus|=diff("wenni_BCh1SD.data","../data/wenni_BCh1SD.data");
    72   teststatus|=diff("wenni_BCh2SD.data","../data/wenni_BCh2SD.data");
    73   teststatus|=diff("wenni_imputed.data","../data/wenni_imputed.data");
    74   teststatus|=diff("wenni_intensity1.data","../data/wenni_intensity1.data");
    75   teststatus|=diff("wenni_intensity2.data","../data/wenni_intensity2.data");
    76   teststatus|=diff("wenni_logratio.data","../data/wenni_logratio.data");
    77   teststatus|=diff("wenni_weight.data","../data/wenni_weight.data");
     71  teststatus|=compare("wenni_BCh1SD.data","../data/wenni_BCh1SD.data");
     72  teststatus|=compare("wenni_BCh2SD.data","../data/wenni_BCh2SD.data");
     73  teststatus|=compare("wenni_imputed.data","../data/wenni_imputed.data");
     74  teststatus|=compare("wenni_intensity1.data","../data/wenni_intensity1.data");
     75  teststatus|=compare("wenni_intensity2.data","../data/wenni_intensity2.data");
     76  teststatus|=compare("wenni_logratio.data","../data/wenni_logratio.data");
     77  teststatus|=compare("wenni_weight.data","../data/wenni_weight.data");
    7878  if (teststatus)
    7979    std::cerr << "ERROR: check_default_results failed." << std::endl;
     
    9797  teststatus|=diff("BASEfile.data","../data/basefile_in.data");
    9898  teststatus|=diff("basefile_out.data","../data/basefile_out.data");
    99   teststatus|=diff("wenni_BCh1Mean.data","../data/wenni_BCh1Mean.data");
    100   teststatus|=diff("wenni_BCh1SD.data","../data/wenni_BCh1SD.data");
    101   teststatus|=diff("wenni_BCh2Mean.data","../data/wenni_BCh2Mean.data");
    102   teststatus|=diff("wenni_BCh2SD.data","../data/wenni_BCh2SD.data");
    103   teststatus|=diff("wenni_FCh1Mean.data","../data/wenni_FCh1Mean.data");
    104   teststatus|=diff("wenni_FCh2Mean.data","../data/wenni_FCh2Mean.data");
    105   teststatus|=diff("wenni_imputed.data","../data/wenni_imputed.data");
    106   teststatus|=diff("wenni_logratio.data","../data/wenni_logratio.data");
    107   teststatus|=diff("wenni_weight.data","../data/wenni_weight.data");
     99  teststatus|=compare("wenni_BCh1Mean.data","../data/wenni_BCh1Mean.data");
     100  teststatus|=compare("wenni_BCh1SD.data","../data/wenni_BCh1SD.data");
     101  teststatus|=compare("wenni_BCh2Mean.data","../data/wenni_BCh2Mean.data");
     102  teststatus|=compare("wenni_BCh2SD.data","../data/wenni_BCh2SD.data");
     103  teststatus|=compare("wenni_FCh1Mean.data","../data/wenni_FCh1Mean.data");
     104  teststatus|=compare("wenni_FCh2Mean.data","../data/wenni_FCh2Mean.data");
     105  teststatus|=compare("wenni_imputed.data","../data/wenni_imputed.data");
     106  teststatus|=compare("wenni_logratio.data","../data/wenni_logratio.data");
     107  teststatus|=compare("wenni_weight.data","../data/wenni_weight.data");
    108108  if (teststatus)
    109109    std::cerr << "ERROR: check_raw_results failed." << std::endl;
     
    115115{
    116116  bool teststatus=false;
    117   teststatus|=compare("wenni_imputed.data","../data/wenni_imputed.data");
     117  teststatus|=compare("wenni_imputed.data","../data/wenni_imputed.data",
     118                      1.1e-11);
    118119  if (teststatus)
    119120    std::cerr << "ERROR: check_wenni_results failed." << std::endl;
     
    143144
    144145
    145 bool compare(const std::string& a,const std::string& b)
     146bool compare(const std::string& a,const std::string& b, double error_bound)
    146147{
    147148  bool teststatus=false;
     
    151152  theplu::gslapi::matrix bdata(bstream);
    152153  adata-=bdata;
    153   double error_bound = 1.1e-11;
    154154  for (size_t i=0; i<adata.rows(); i++)
    155155    for (size_t j=0; j<adata.columns(); j++)
Note: See TracChangeset for help on using the changeset viewer.