Changeset 1251


Ignore:
Timestamp:
Apr 3, 2008, 7:48:24 AM (13 years ago)
Author:
Peter
Message:

make distcheck works - fixes ticket:217

Location:
trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/alignment_test.cc

    r1232 r1251  
    9696  test::Suite suite(argc, argv);
    9797
    98   std::ifstream s(std::string("data/isoform.peaks").c_str());
     98  std::ifstream s(test::filename("data/isoform.peaks").c_str());
    9999  std::vector<std::vector<double> > peaksets;
    100100  s >> peaksets;
  • trunk/test/averager_test.cc

    r1234 r1251  
    235235  delete apw2;
    236236
    237   return !suite.ok();
     237  return suite.return_value();
    238238}
    239239
  • trunk/test/consensus_inputranker_test.cc

    r1232 r1251  
    4242int main(int argc, char* argv[])
    4343
     44  using namespace theplu::yat;
    4445  theplu::yat::test::Suite suite(argc, argv);
    4546  suite.err() << "testing consensus_inputranker" << std::endl;
    4647
    47   ifstream is("data/rank_data.txt");
     48  ifstream is(test::filename("data/rank_data.txt").c_str());
    4849  theplu::yat::utility::Matrix data_tmp(is);
    4950  theplu::yat::classifier::MatrixLookup data(data_tmp);
    5051  is.close();
    5152
    52   is.open("data/rank_target.txt");
     53  is.open(test::filename("data/rank_target.txt").c_str());
    5354  theplu::yat::classifier::Target target(is);
    5455  is.close();
  • trunk/test/data_lookup_1d_test.cc

    r1233 r1251  
    120120
    121121  // First with a vector with no missing values separated by ' '.
    122   std::ofstream my_out("data/tmp_test_datalookup1D.txt");
     122  std::ofstream my_out("/tmp/yat_test_datalookup1D.txt");
    123123  my_out << v1;
    124124  my_out.close();
    125   std::ifstream is("data/tmp_test_datalookup1D.txt");
     125  std::ifstream is("/tmp/yat_test_datalookup1D.txt");
    126126  utility::Vector v5(is);
    127127  is.close();
     
    131131    suite.err() << "\nERROR\n" << std::endl;
    132132  }
    133   std::remove("data/tmp_test_datalookup1D.txt");
     133  std::remove("/tmp/yat_test_datalookup1D.txt");
    134134 
    135135  // Second with a vector with a missing value separated by '\t'.
    136136  gsl_m1(3,0)=std::numeric_limits<double>::quiet_NaN();
    137137  classifier::DataLookup1D v6(m1,1, true); 
    138   my_out.open("data/tmp_test_datalookup1D.txt");
     138  my_out.open("/tmp/yat_test_datalookup1D.txt");
    139139  char prev=my_out.fill('\t');
    140140  my_out << v1;
    141141  my_out.fill(prev);
    142142  my_out.close();
    143   is.open("data/tmp_test_datalookup1D.txt");
     143  is.open("/tmp/yat_test_datalookup1D.txt");
    144144  utility::Vector v7(is,'\t');
    145145  is.close();
     
    151151           << std::endl;
    152152  }
    153   std::remove("data/tmp_test_datalookup1D.txt");
     153  std::remove("data/yat_test_datalookup1D.txt");
    154154  suite.err() << "\n";
    155155
  • trunk/test/ensemble_test.cc

    r1236 r1251  
    5656
    5757  suite.err() << "loading data" << std::endl;
    58   std::ifstream is("data/nm_data_centralized.txt");
     58  std::ifstream is(test::filename("data/nm_data_centralized.txt").c_str());
    5959  utility::Matrix data_core(is);
    6060  is.close();
     
    6868
    6969  suite.err() << "load target" << std::endl;
    70   is.open("data/nm_target_bin.txt");
     70  is.open(test::filename("data/nm_target_bin.txt").c_str());
    7171  classifier::Target target(is);
    7272  is.close();
  • trunk/test/feature_selection_test.cc

    r1237 r1251  
    5353
    5454  suite.err() << "Reading in Sorlie data to identify top gene ..." << std::endl;
    55   std::ifstream is("data/sorlie_centroid_data.txt");
     55  std::ifstream is(test::filename("data/sorlie_centroid_data.txt").c_str());
    5656  utility::Matrix data(is,'\t');
    5757  is.close();
    5858
    59   is.open("data/sorlie_centroid_classes.txt");
     59  is.open(test::filename("data/sorlie_centroid_classes.txt").c_str());
    6060  classifier::Target targets(is);
    6161  is.close();
  • trunk/test/fileutil_test.cc

    r1248 r1251  
    153153      suite.err() << "\tfile does not exist: " << file.path() << std::endl;
    154154    suite.add(!testval);
    155     utility::FileUtil file2("fileutil_test.cc");
     155    utility::FileUtil file2(test::filename("fileutil_test.cc").c_str());
    156156    if (!(testval=!file2.exists()))
    157157      suite.err() << "\tfile does exist: " << file2.path() << std::endl;
  • trunk/test/inputranker_test.cc

    r1237 r1251  
    4242  suite.err() << "testing inputranker" << std::endl;
    4343
    44   std::ifstream is("data/rank_data.txt");
     44  std::ifstream is(test::filename("data/rank_data.txt").c_str());
    4545  theplu::yat::utility::Matrix data_tmp(is);
    4646  theplu::yat::classifier::MatrixLookup data(data_tmp);
    4747  is.close();
    4848
    49   is.open("data/rank_target.txt");
     49  is.open(test::filename("data/rank_target.txt").c_str());
    5050  classifier::Target target(is);
    5151  is.close();
  • trunk/test/kernel_test.cc

    r1238 r1251  
    9090  // containing kernel matrices calculated in matlab.
    9191  double error_bound = 1e-6;
    92   std::ifstream is("data/nm_data_centralized.txt");
     92  std::ifstream is(test::filename("data/nm_data_centralized.txt").c_str());
    9393  utility::Matrix data_core(is);
    9494  is.close();
     
    9696  classifier::MatrixLookup data(data_core);
    9797
    98   is.open("data/nm_kernel.txt");
     98  is.open(test::filename("data/nm_kernel.txt").c_str());
    9999  utility::Matrix kernel_matlab(is);
    100100  is.close();
     
    104104  delete kf;
    105105 
    106   is.open("data/nm_kernel2.txt");
     106  is.open(test::filename("data/nm_kernel2.txt").c_str());
    107107  utility::Matrix kernel_matlab2(is);
    108108  is.close();
     
    114114  // Checking that GaussianKernelFunction.
    115115  suite.err() << "Checking GaussianKernelFunction.\n";
    116   is.open("data/nm_kernel_gaussian.txt");
     116  is.open(test::filename("data/nm_kernel_gaussian.txt").c_str());
    117117  utility::Matrix kernel_gaussian(is);
    118118  is.close();
  • trunk/test/matrix_test.cc

    r1240 r1251  
    6767  // Checking that the matrix output operator writes a file that the
    6868  // input operator can read.
    69   std::ofstream my_out("data/tmp_test_matrix.txt");
     69  std::ofstream my_out("/tmp/yat_test_matrix.txt");
    7070  my_out << m2;
    7171  my_out.close();
    72   std::ifstream is("data/tmp_test_matrix.txt");
     72  std::ifstream is("/tmp/yat_test_matrix.txt");
    7373  utility::Matrix m3(is);
    7474  is.close();
    7575  if (m3!=m2)
    7676    suite.add(false);
    77   std::remove("data/tmp_test_matrix.txt");
     77  std::remove("/tmp/yat_test_matrix.txt");
    7878
    7979  suite.err() << "\toperator*=(double)" << std::endl;
     
    8585  }
    8686
    87   is.open("data/knni_matrix.data");
     87  is.open(test::filename("data/knni_matrix.data").c_str());
    8888  // The stream input is a proper matrix file, with some stray empty
    8989  // lines and other whitespaces. The file is not expected to break
     
    195195
    196196  suite.err() << "\tmatrix::nan()" << std::endl;
    197   is.open("data/sorlie_centroid_data.txt");
     197  is.open(test::filename("data/sorlie_centroid_data.txt").c_str());
    198198  utility::Matrix* m_nan = new utility::Matrix(is,'\t');
    199199  utility::Matrix m_weight;
  • trunk/test/nbc_test.cc

    r1241 r1251  
    4242  suite.err() << "testing ncc" << std::endl;
    4343
    44   std::ifstream is("data/nm_data_centralized.txt");
     44  std::ifstream is(test::filename("data/nm_data_centralized.txt").c_str());
    4545  utility::Matrix data_core(is);
    4646  is.close();
    4747  classifier::MatrixLookup data(data_core);
    4848
    49   is.open("data/nm_target_bin.txt");
     49  is.open(test::filename("data/nm_target_bin.txt").c_str());
    5050  classifier::Target target(is);
    5151  is.close();
  • trunk/test/ncc_test.cc

    r1241 r1251  
    197197  //////////////////////////////////////////////////////////////////////////
    198198  suite.err() << "test with Sorlie data\n";
    199   std::ifstream is("data/sorlie_centroid_data.txt");
     199  std::ifstream is(test::filename("data/sorlie_centroid_data.txt").c_str());
    200200  utility::Matrix data(is,'\t');
    201201  is.close();
    202202
    203   is.open("data/sorlie_centroid_classes.txt");
     203  is.open(test::filename("data/sorlie_centroid_classes.txt").c_str());
    204204  classifier::Target targets(is);
    205205  is.close();
     
    215215
    216216  // Comparing the centroids to stored result
    217   is.open("data/sorlie_centroids.txt");
     217  is.open(test::filename("data/sorlie_centroids.txt").c_str());
    218218  utility::Matrix centroids(is);
    219219  is.close();
     
    239239 
    240240  // Comparing the prediction to stored result
    241   is.open("data/sorlie_centroid_predictions.txt");
     241  is.open(test::filename("data/sorlie_centroid_predictions.txt").c_str());
    242242  utility::Matrix result(is,'\t');
    243243  is.close();
  • trunk/test/nni_test.cc

    r1242 r1251  
    5151
    5252  uint neighbours=3;
    53   std::string knni_data("data/knni_matrix.data");
    54   std::string knni_result("data/knni_result.data");
    55   std::string knni_weight("data/knni_weight.data");
    56   std::string wenni_data("data/knni_matrix.data");
    57   std::string wenni_result("data/wenni_result.data");
    58   std::string wenni_weight("data/wenni_weight.data");
     53  std::string knni_data(test::filename("data/knni_matrix.data"));
     54  std::string knni_result(test::filename("data/knni_result.data"));
     55  std::string knni_weight(test::filename("data/knni_weight.data"));
     56  std::string wenni_data(test::filename("data/knni_matrix.data"));
     57  std::string wenni_result(test::filename("data/wenni_result.data"));
     58  std::string wenni_weight(test::filename("data/wenni_weight.data"));
    5959  check_file_access(knni_data);
    6060  check_file_access(knni_result);
  • trunk/test/regression_test.cc

    r1247 r1251  
    202202  suite.err() << "  testing regression::Polynomial" << std::endl;
    203203  {
    204     std::ifstream s("data/regression_gauss.data");
     204    std::ifstream s(test::filename("data/regression_gauss.data").c_str());
    205205    utility::Matrix data(s);
    206206    utility::Vector x(data.rows());
  • trunk/test/score_test.cc

    r1248 r1251  
    7373  }
    7474 
    75   std::ifstream is("data/rank_data.txt");
     75  std::ifstream is(test::filename("data/rank_data.txt").c_str());
    7676  utility::Matrix data(is);
    7777  is.close();
    7878
    79   is.open("data/rank_target.txt");
     79  is.open(test::filename("data/rank_target.txt").c_str());
    8080  classifier::Target target2(is);
    8181  is.close();
  • trunk/test/subset_generator_test.cc

    r1248 r1251  
    6767{
    6868  bool ok=true;
    69   std::ifstream is("data/nm_target_bin.txt");
     69  std::ifstream is(test::filename("data/nm_target_bin.txt").c_str());
    7070  suite.err() << "loading target " << std::endl;
    7171  classifier::Target target(is);
     
    7373  suite.err() << "number of targets: " << target.size() << std::endl;
    7474  suite.err() << "number of classes: " << target.nof_classes() << std::endl;
    75   is.open("data/nm_data_centralized.txt");
     75  is.open(test::filename("data/nm_data_centralized.txt").c_str());
    7676  suite.err() << "loading data " << std::endl;
    7777  utility::Matrix m(is);
  • trunk/test/svd_test.cc

    r1248 r1251  
    6060  Areconstruct*=S;
    6161  Areconstruct*=Vtranspose;
    62   if (!suite.equal_range(A.begin(), A.end(), Areconstruct.begin(), 1000)) {
     62  if (!suite.equal_range(A.begin(), A.end(), Areconstruct.begin(), 10000)) {
    6363    suite.err() << "test_svd: FAILED, algorithm " << algo << std::endl;
    6464    suite.err() << "reconstruction error" << std::endl;
  • trunk/test/svm_test.cc

    r1248 r1251  
    105105 
    106106
    107   std::ifstream is("data/nm_data_centralized.txt");
     107  std::ifstream is(test::filename("data/nm_data_centralized.txt").c_str());
    108108  utility::Matrix data_core(is);
    109109  is.close();
     
    115115
    116116
    117   is.open("data/nm_target_bin.txt");
     117  is.open(test::filename("data/nm_target_bin.txt").c_str());
    118118  classifier::Target target(is);
    119119  is.close();
    120120
    121   is.open("data/nm_alpha_linear_matlab.txt");
     121  is.open(test::filename("data/nm_alpha_linear_matlab.txt").c_str());
    122122  theplu::yat::utility::Vector alpha_matlab(is);
    123123  is.close();
  • trunk/test/target_test.cc

    r1248 r1251  
    106106    suite.err() << "Error: target.binary(20) not true" << std::endl;
    107107  }   
    108   std::ifstream is("data/rank_target.txt");
     108  std::ifstream is(test::filename("data/rank_target.txt").c_str());
    109109  classifier::Target target2(is);
    110110  is.close();
  • trunk/test/vector_test.cc

    r1248 r1251  
    193193  try {
    194194    suite.err() << "stream" << std::endl;
    195     std::string data1("data/vector1.data");
    196     std::string data2("data/vector2.data");
    197     std::string data3("data/vector3.data");
    198     std::string data4("data/vector4.data");
     195    std::string data1(test::filename("data/vector1.data"));
     196    std::string data2(test::filename("data/vector2.data"));
     197    std::string data3(test::filename("data/vector3.data"));
     198    std::string data4(test::filename("data/vector4.data"));
    199199    check_file_access(data1);
    200200    check_file_access(data2);
     
    235235  // Checking that unexpected characters in a stream gives error.
    236236  try {
    237     std::string data5("data/vector5.data");
     237    std::string data5(test::filename("data/vector5.data"));
    238238    check_file_access(data5);
    239239    std::ifstream data_stream5(data5.c_str());
     
    244244  }
    245245  try {
    246     std::string data("data/vector6.data");
     246    std::string data(test::filename("data/vector6.data"));
    247247    check_file_access(data);
    248248    std::ifstream data_stream(data.c_str());
     
    256256  this_ok=false;
    257257  try {
    258     std::string data("data/vector7.data");
     258    std::string data(test::filename("data/vector7.data"));
    259259    check_file_access(data);
    260260    std::ifstream data_stream(data.c_str());
     
    269269  // Test sort algorithms
    270270  {
    271     std::string data3("data/vector3.data");
     271    std::string data3(test::filename("data/vector3.data"));
    272272    std::ifstream data_stream3(data3.c_str());
    273273    utility::Vector vec3(data_stream3);
  • trunk/yat/classifier/KNN_ReciprocalDistance.cc

    r1112 r1251  
    88
    99#include <vector>
     10
     11#include <iostream>
    1012
    1113namespace theplu {
Note: See TracChangeset for help on using the changeset viewer.