Changeset 536


Ignore:
Timestamp:
Mar 3, 2006, 10:19:29 PM (16 years ago)
Author:
Peter
Message:

fixed problem with ConsensusInputranker? - Now all tests do pass

Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/classifier/DataLookup1D.cc

    r527 r536  
    22
    33#include <c++_tools/classifier/DataLookup1D.h>
     4
     5#include <cassert>
    46#include <iostream>
    57
     
    810
    911  DataLookup1D::DataLookup1D(const DataLookup2D& m, const size_t i,
    10                              const bool column_vector)
    11     : column_vector_(column_vector), index_(i), matrix_(&m)
     12                             const bool row_vector)
     13    : column_vector_(!row_vector), index_(i), matrix_(&m)
    1214  {
     15    assert( !column_vector_ || i<m.columns());
     16    assert( column_vector_ || i<m.rows());
    1317  }
    1418 
  • trunk/lib/classifier/DataLookup1D.h

    r533 r536  
    2828    ///
    2929    /// @parameter row_vector if true (default) DataLookup1D is
    30     /// looking into a column of DataLookup2D, otherwise looking into
    31     /// a row. @parameter index which row/column to look into.
     30    /// looking into a row of DataLookup2D, otherwise looking into
     31    /// a column. @parameter index which row/column to look into.
    3232    ///
    3333    DataLookup1D(const DataLookup2D&, const size_t index,
     
    4343    ///
    4444    inline size_t size(void) const
    45       { return column_vector_ ? matrix_->columns() : matrix_->rows(); }
     45      { return column_vector_ ? matrix_->rows() : matrix_->columns(); }
    4646
    4747    ///
     
    4949    ///
    5050    inline double operator()(const size_t i) const
    51     { assert(i<size());
    52       return column_vector_ ? (*matrix_)(index_,i) : (*matrix_)(i,index_); }
     51    {
     52      assert(i<size());
     53      return column_vector_ ? (*matrix_)(i,index_) : (*matrix_)(index_,i);
     54    }
    5355
    5456    ///
  • trunk/lib/classifier/DataLookup2D.cc

    r534 r536  
    44
    55#include <vector>
     6
     7#include <cassert>
     8#ifndef NDEBUG
     9#include <algorithm>
     10#endif
     11
    612
    713namespace theplu {
     
    1521    assert(row_index_.empty());
    1622    row_index_.reserve(row.size());
    17     for (size_t i=0; i<row.size(); i++)
     23    for (size_t i=0; i<row.size(); i++) {
     24      assert(row[i]<m.row_index_.size());
    1825      row_index_.push_back(m.row_index_[row[i]]);
     26    }
    1927    assert(column_index_.empty());
    2028    column_index_.reserve(col.size());
    21     for (size_t i=0; i<col.size(); i++)
     29    for (size_t i=0; i<col.size(); i++) {
     30      assert(col[i]<m.column_index_.size());
    2231      column_index_.push_back(m.column_index_[col[i]]);
     32    }
    2333  }
    2434   
     
    2636
    2737  DataLookup2D::DataLookup2D(const DataLookup2D& m,
    28                         const std::vector<size_t>& index,
    29                         const bool row)
     38                            const std::vector<size_t>& index,
     39                            const bool row)
    3040  {
    3141    if (row){
    3242      assert(row_index_.empty());
    3343      row_index_.reserve(index.size());
    34       for (size_t i=0; i<index.size(); i++)
     44      for (size_t i=0; i<index.size(); i++) {
     45        assert(index[i]<m.row_index_.size());
    3546        row_index_.push_back(m.row_index_[index[i]]);
     47      }
    3648      column_index_= m.column_index_;
    3749    }
     
    3951      assert(column_index_.empty());
    4052      column_index_.reserve(index.size());
    41       for (size_t i=0; i<index.size(); i++)
    42         column_index_.push_back(m.row_index_[index[i]]);
     53      for (size_t i=0; i<index.size(); i++) {
     54        column_index_.push_back(m.column_index_[index[i]]);
     55      }
    4356      row_index_= m.row_index_;
    4457    }
  • trunk/lib/classifier/InputRanker.cc

    r527 r536  
    2222                           statistics::Score& score_object)
    2323  {
     24    assert(data.columns()==target.size());
     25 
    2426    size_t nof_genes = data.rows();
    25     //    size_t nof_samples = data.columns();
    2627
    2728    //scoring each input
  • trunk/lib/classifier/Kernel.h

    r527 r536  
    5252
    5353    ///
     54    /// @return number columns in Kernel
     55    ///
     56    inline size_t columns(void) const { return size(); }
     57
     58    ///
     59    /// @return number of rows in Kernel
     60    ///
     61    inline size_t rows(void) const { return size(); }
     62
     63    ///
    5464    /// @brief number of samples
    5565    ///
  • trunk/lib/classifier/KernelLookup.h

    r527 r536  
    2424    /// Constructor
    2525    ///
    26     KernelLookup(const Kernel&);
     26    /// @note If underlying Kernel goes out of scope or is deleted, the
     27    /// returned pointer becomes invalid and the result of further use is
     28    /// undefined.
     29    ///
     30    KernelLookup(const Kernel& kernel);
    2731
    2832    ///
    29     /// Contructor taking the Kernel to view into, row index vector,
    30     /// and column index vector.
     33    /// Constructor creating a subKernel. The
     34    /// \f$i\f$th row in constructed lookup is identical to row number
     35    /// row[i] in matrix. The \f$i\f$th column in constructed lookup
     36    /// is identical to column number column[i] in matrix.
     37    ///
     38    /// @note If @a kernel goes out of scope or is deleted, the
     39    /// returned pointer becomes invalid and the result of further use is
     40    /// undefined.
    3141    ///
    3242    /// @note For training usage row index shall always be equal to
  • trunk/lib/classifier/MatrixLookup.cc

    r534 r536  
    22
    33#include <c++_tools/classifier/MatrixLookup.h>
     4
     5#ifndef NDEBUG
     6#include <algorithm>
     7#endif
    48
    59namespace theplu {
     
    1822
    1923  MatrixLookup::MatrixLookup(const gslapi::matrix& data,
    20                     const std::vector<size_t>& row,
    21                     const std::vector<size_t>& col)
     24                            const std::vector<size_t>& row,
     25                            const std::vector<size_t>& col)
    2226    : DataLookup2D(row,col), data_(&data)
    2327  {
     28    // Checking that each row index is less than data.rows()
     29    assert(row.empty() ||
     30           *(std::max_element(row.begin(),row.end()))<data.rows());
     31    // Checking that each row index is less than data.column()
     32    assert(col.empty() ||
     33           *(std::max_element(col.begin(),col.end()))<data.columns());
    2434  }
    2535 
     
    3242  {
    3343    if (row){
     44      // Checking that each row index is less than data.rows()
     45      assert(index.empty() ||
     46             *(std::max_element(index.begin(),index.end()))<data.rows());
    3447      row_index_=index;
    3548      assert(column_index_.empty());
     
    3952    }
    4053    else{
     54      // Checking that each column index is less than data.column()
     55      assert(index.empty() ||
     56             *(std::max_element(index.begin(),index.end()))<data.columns());
    4157      column_index_=index;
    4258      assert(row_index_.empty());
     
    6985    : DataLookup2D(ml,index,row), data_(ml.data_)
    7086  {
     87    // Checking that no index is out of range
     88    assert(row_index_.empty() ||
     89           *(max_element(row_index_.begin(), row_index_.end()))<data_->rows());
     90    assert(column_index_.empty() ||
     91           *(max_element(column_index_.begin(), column_index_.end()))<
     92           data_->columns());
    7193  }
    7294 
  • trunk/lib/classifier/MatrixLookup.h

    r534 r536  
    77#include <c++_tools/gslapi/matrix.h>
    88
     9#include <cassert>
    910
    1011namespace theplu {
     
    1617  /// Interface class for classifier data
    1718  ///
    18 
     19  /// @todo document, especially describe when object becomes invalid,
     20  /// as now documentation is conservative.
    1921  class MatrixLookup : public DataLookup2D
    2022  {
     
    2628    /// Constructor creating a lookup into the whole matrix.
    2729    ///
    28     explicit MatrixLookup(const gslapi::matrix&);
     30    /// @note If @a matrix goes out of scope or is deleted, the
     31    /// MatrixLookup becomes invalid and the result of further use is
     32    /// undefined.
     33    ///
     34    explicit MatrixLookup(const gslapi::matrix& matrix);
    2935
    3036    ///
     
    3440    /// is identical to column number column[i] in matrix.
    3541    ///
    36     MatrixLookup(const gslapi::matrix&, const std::vector<size_t>& row,
     42    /// @note If @a matrix goes out of scope or is deleted, the
     43    /// MatrixLookup becomes invalid and the result of further use is
     44    /// undefined.
     45    ///
     46    MatrixLookup(const gslapi::matrix& matrix, const std::vector<size_t>& row,
    3747             const std::vector<size_t>& column);
    3848
     
    4656    /// by @a index.
    4757    ///
    48     MatrixLookup(const gslapi::matrix&, const std::vector<size_t>& index,
     58    /// @note If @a matrix goes out of scope or is deleted, the
     59    /// MatrixLookup becomes invalid and the result of further use is
     60    /// undefined.
     61    ///
     62    MatrixLookup(const gslapi::matrix& matrix,
     63                 const std::vector<size_t>& index,
    4964                 const bool row_vectors=true);
    5065
     
    5267    /// @brief Copy constructor.
    5368    ///
     69    /// @note If underlying matrix goes out of scope or is deleted, the
     70    /// MatrixLookup becomes invalid and the result of further use is
     71    /// undefined.
     72    ///
    5473    MatrixLookup(const MatrixLookup&);
    5574
     
    5877    /// as input.
    5978    ///
    60     MatrixLookup(const MatrixLookup&, const std::vector<size_t>&,
     79    /// @note If underlying matrix goes out of scope or is deleted, the
     80    /// MatrixLookup becomes invalid and the result of further use is
     81    /// undefined.
     82    ///
     83    MatrixLookup(const MatrixLookup& matrix, const std::vector<size_t>&,
    6184             const std::vector<size_t>&);
    6285
     
    6588    /// as input.
    6689    ///
    67     MatrixLookup(const MatrixLookup&, const std::vector<size_t>&,
     90    /// @note If underlying matrix goes out of scope or is deleted, the
     91    /// MatrixLookup becomes invalid and the result of further use is
     92    /// undefined.
     93    ///
     94    MatrixLookup(const MatrixLookup& matrix, const std::vector<size_t>&,
    6895                 const bool row=false);
    6996
     
    77104    /// @return pointer to sub-Lookup of the MatrixLookup
    78105    ///
     106    /// @note If underlying matrix goes out of scope or is deleted, the
     107    /// returned pointer becomes invalid and the result of further use is
     108    /// undefined.
     109    ///
    79110    const MatrixLookup* training_data(const std::vector<size_t>& i) const;
    80111   
    81112    ///
    82113    /// @return pointer to sub-Lookup of the MatrixLookup
     114    ///
     115    /// @note If underlying matrix goes out of scope or is deleted, the
     116    /// returned pointer becomes invalid and the result of further use is
     117    /// undefined.
    83118    ///
    84119    const MatrixLookup* validation_data(const std::vector<size_t>&,
     
    90125    ///
    91126    inline double operator()(const size_t row, const size_t column) const
    92     { return (*data_)(row_index_[row], column_index_[column]); }
     127    {
     128      assert(row<rows());
     129      assert(columns());
     130      return (*data_)(row_index_[row], column_index_[column]);
     131    }
    93132
    94133  private:
  • trunk/lib/gslapi/matrix.h

    r535 r536  
    336336    ///
    337337    inline double& operator()(size_t row,size_t column)
    338     { return (*gsl_matrix_ptr(m_,row,column)); }
     338    {
     339      assert(row<rows());
     340      assert(column<columns());
     341      return (*gsl_matrix_ptr(m_,row,column));
     342    }
    339343
    340344    ///
     
    343347    ///
    344348    inline const double& operator()(size_t row,size_t column) const
    345     { return (*gsl_matrix_const_ptr(m_,row,column)); }
     349    {       
     350      assert(row<rows());
     351      assert(column<columns());
     352      return (*gsl_matrix_const_ptr(m_,row,column));
     353    }
    346354
    347355    ///
  • trunk/lib/gslapi/vector.cc

    r535 r536  
    144144  {
    145145    v_ = gsl_vector_alloc(data.size());
    146     for (size_t i=0; i<data.size(); i++){
    147       std::cout << "i " << i << std::endl;
     146    for (size_t i=0; i<data.size(); i++)
    148147      gsl_vector_set( v_, i, data(i) );
    149     }
    150    
    151148  }
    152149
  • trunk/lib/statistics/Score.h

    r532 r536  
    55
    66#include <c++_tools/gslapi/vector.h>
     7
     8#include <cassert>
     9#ifndef NDEGUG
     10#include <c++_tools/classifier/Target.h>
     11#include <c++_tools/classifier/DataLookup1D.h>
     12#endif
    713
    814namespace theplu {
     
    6066    score(const classifier::Target& target,
    6167          const classifier::DataLookup1D& value)
    62     { return score(target,gslapi::vector(value)); }
     68    {
     69      assert(target.size()==value.size());
     70      return score(target,gslapi::vector(value));
     71    }
    6372 
    6473    ///
  • trunk/test/inputranker_test.cc

    r475 r536  
    4444  }
    4545 
    46   *error << "second test" << std::endl;
    4746  if (ir.rank(0)!=1 || ir.rank(1)!=2 || ir.rank(2)!=0){
    4847    *error << "wrong rank" << std::endl;
  • trunk/test/kernel_test.cc

    r527 r536  
    102102  delete kf;
    103103
     104  data_core = gslapi::matrix(1,5);
     105  for (size_t i=0; i<data_core.columns(); i++)
     106    data_core(0,i)=i;
     107  data = classifier::MatrixLookup(data_core);
     108  classifier::PolynomialKernelFunction pkf;
     109  classifier::Kernel_SEV kernel(data,pkf);
     110 
     111
    104112  if (error!=&std::cerr)
    105113    delete error;
  • trunk/test/lookup_test.cc

    r534 r536  
    22
    33#include <c++_tools/gslapi/matrix.h>
     4#include <c++_tools/classifier/DataLookup1D.h>
     5#include <c++_tools/classifier/KernelLookup.h>
     6#include <c++_tools/classifier/Kernel_SEV.h>
    47#include <c++_tools/classifier/MatrixLookup.h>
     8#include <c++_tools/classifier/PolynomialKernelFunction.h>
     9
    510
    611#include <fstream>
     
    1217gslapi::matrix matrix(size_t n);
    1318
     19bool test_data_lookup1D(std::ostream* error);
     20bool test_kernel_lookup(std::ostream* error);
    1421bool test_matrix_lookup(std::ostream* error);
    1522
     
    2734  }
    2835
    29   *error << "Testing lookup classes" << std::endl;
    30   bool ok = true;
    31 
    32   ok = test_matrix_lookup(error);
    33  
     36  *error << "Testing Lookup Classes" << std::endl;
     37  bool ok = test_data_lookup1D(error);
     38
     39  ok = ok && test_matrix_lookup(error);
     40 
     41  ok = ok && test_kernel_lookup(error);
    3442
    3543  if (ok)
     
    5159}
    5260
     61bool test_data_lookup1D(std::ostream* error)
     62{
     63  bool ok =true;
     64  *error << "Testing DataLookup1D" << std::endl;
     65  gslapi::matrix gsl_m1(matrix(5));
     66  std::vector<size_t> index_odd;
     67  index_odd.push_back(1);
     68  index_odd.push_back(3);
     69  std::vector<size_t> index_even;
     70  index_even.push_back(2);
     71  index_even.push_back(0);
     72  index_even.push_back(4);
     73  classifier::MatrixLookup m1(gsl_m1,index_odd,index_even);
     74  *error << "DataLookup1D::DataLookup1D(const MatrixLookup&\n"
     75         << "                           const size_t, const bool)...";
     76  classifier::DataLookup1D v1(m1,1);
     77  if (v1.size()!=m1.columns() || v1(0)!=m1(1,0) ||
     78      v1(1)!=m1(1,1) ) {
     79    ok =false;
     80    *error << "\nERROR" << std::endl;
     81    *error << "size: " << v1.size() << " expected " << m1.columns() << "\n"
     82           << "v1(0): " << v1(0) << " expected " << m1(1,0) << "\n"
     83           << "v1(1): " << v1(1) << " expected " << m1(1,1)
     84           << std::endl;
     85  }
     86  else
     87    *error << "Ok" << std::endl;
     88
     89  *error << "DataLookup1D::DataLookup1D(const MatrixLookup&\n"
     90         << "                           const size_t, const bool)...";
     91  classifier::DataLookup1D v2(m1,1,false);
     92  if (v2.size()!=m1.rows() || v2(0)!=m1(0,1) || v2(1)!=m1(1,1) ) {
     93    ok =false;
     94    *error << "\nERROR\n"
     95           << "size: " << v2.size() << " expected " << m1.rows() << "\n"
     96           << "v2(0): " << v2(0) << " expected " << m1(0,1) << "\n"
     97           << "v2(1): " << v2(1) << " expected " << m1(1,1)
     98           << std::endl;
     99  }
     100  else
     101    *error << "Ok" << std::endl;
     102
     103  return ok;
     104}
     105
     106bool test_kernel_lookup(std::ostream* error)
     107{
     108  bool ok =true;
     109  *error << "\nTesting KernelLookup" << std::endl;
     110  gslapi::matrix data_core(1,5);
     111  for (size_t i=0; i<data_core.columns(); i++)
     112    data_core(0,i)=i;
     113  classifier::MatrixLookup data(data_core);
     114  classifier::PolynomialKernelFunction kf;
     115  classifier::Kernel_SEV kernel(data,kf);
     116  *error << "KernelLookup::KernelLookup(const Kernel&)...";
     117  classifier::KernelLookup k1(kernel);
     118  if (k1.rows()!=kernel.rows() || k1.columns()!=kernel.columns()) {
     119    ok =false;
     120    *error <<   "ERROR:" << std::endl;
     121    *error << "Dimensions do not agree." << std::endl;
     122  }
     123  for (size_t i=0; i<k1.rows(); i++)
     124    for (size_t j=0; j<k1.columns(); j++)
     125      if (k1(i,j)!=kernel(i,j)) {
     126        ok =false;
     127        *error << "ERROR:\n"
     128               << "KernelLookup::KernelLookup(const Kernel& data)"
     129               << std::endl;
     130        *error << "k(" << i << "," << j << ") is " << k1(i,j)
     131               << "expected " << kernel(i,j) << std::endl;
     132      }
     133 
     134  std::vector<size_t> index_odd;
     135  index_odd.push_back(1);
     136  index_odd.push_back(3);
     137  std::vector<size_t> index_even;
     138  index_even.push_back(2);
     139  index_even.push_back(0);
     140  index_even.push_back(5);
     141 
     142
     143
     144  return ok;
     145}
     146
    53147bool test_matrix_lookup(std::ostream* error)
    54148{
    55149  bool ok =true;
    56   *error << "Testing MatrixLookup" << std::endl;
     150  *error << "\nTesting MatrixLookup" << std::endl;
     151  *error << "MatrixLookup::MatrixLookup(const gslapi::matrix& data)...";
    57152  gslapi::matrix gsl_m1(matrix(2));
    58153  classifier::MatrixLookup m1(gsl_m1);
     
    61156      m1(1,0)!=gsl_m1(1,0) || m1(1,1)!=gsl_m1(1,1) ) {
    62157    ok =false;
    63     *error <<   "ERROR:\nMatrixLookup::MatrixLookup(const gslapi::matrix& data)"
    64            << std::endl;
    65   }
    66 
     158    *error <<   "ERROR:" << std::endl;
     159  }
     160  else
     161    *error << "Ok" << std::endl;
     162
     163 
     164  *error << "MatrixLookup::MatrixLookup(const gslapi::matrix&,\n"
     165         << "                           const std::vector<size_t>&,\n"
     166         << "                           const std::vector<size_t>&)...";
    67167  gslapi::matrix gsl_m2(matrix(4));
    68168  std::vector<size_t> index_odd;
     
    78178      m2(1,0)!=gsl_m2(3,2) || m2(1,1)!=gsl_m2(3,0) ) {
    79179    ok =false;
    80     *error <<   "ERROR:\n"
    81            << "MatrixLookup::MatrixLookup(const gslapi::matrix& data\n"
    82            << "                           const std::vector<size_t>& row,\n"
    83            << "                           const std::vector<size_t>& col)"
    84            << std::endl;
    85   }
    86 
     180    *error <<   "ERROR:" << std::endl;
     181  }
     182  else
     183    *error << "Ok" << std::endl;
     184
     185  *error << "MatrixLookup::MatrixLookup(const gslapi::matrix&,\n"
     186         << "                           const std::vector<size_t>&,\n"
     187         << "                           const bool)...";
    87188  std::vector<size_t> one(1,1);
    88189  classifier::MatrixLookup m3(gsl_m2,one,true);
     
    90191      m3(0,1)!=gsl_m2(1,1) || m3(0,2)!=gsl_m2(1,2) || m3(0,3)!=gsl_m2(1,3)) {
    91192    ok =false;
    92     *error <<   "ERROR:\n"
    93            << "MatrixLookup::MatrixLookup(const gslapi::matrix&,\n"
    94            << "                           const std::vector<size_t>&,\n"
    95            << "                           const bool)"
    96            << std::endl;
     193    *error <<   "ERROR:" << std::endl;
    97194    *error << "m3.rows(): " << m3.rows() << " expected 1" << std::endl;
    98195    *error << "m3.columns(): " << m3.columns() << " expected "
    99196           << gsl_m2.columns() << std::endl;
    100197  }
    101 
     198  else
     199    *error << "Ok" << std::endl;
     200
     201  *error << "MatrixLookup::MatrixLookup(const MatrixLookup&)...";
    102202  classifier::MatrixLookup m4(m2);
    103203  if (m4.rows()!=m2.rows() || m4.columns()!=m2.rows() || m4(0,0)!=m2(0,0) ||
    104204      m4(0,1)!=m2(0,1) || m4(1,0)!=m2(1,0) || m4(1,1)!=m2(1,1) ) {
    105205    ok =false;
    106     *error <<   "ERROR:\n"
    107            << "MatrixLookup::MatrixLookup(const MatrixLookup& data)"
    108            << std::endl;
    109   }
    110 
     206    *error <<   "ERROR:" << std::endl;
     207  }
     208  else
     209    *error << "Ok" << std::endl;
     210
     211  *error << "MatrixLookup::MatrixLookup(const MatrixLookup& data\n"
     212         << "                           const std::vector<size_t>&,\n"
     213         << "                           const std::vector<size_t>&)...";
    111214  classifier::MatrixLookup m5(m2,one,one);
    112215  if (m5.rows()!=1 || m5.columns()!=1 || m5(0,0)!=m2(1,1) ) {
    113216    ok =false;
    114     *error <<   "ERROR:\n"
    115            << "MatrixLookup::MatrixLookup(const MatrixLookup& data\n"
    116            << "                           const std::vector<size_t>& row,\n"
    117            << "                           const std::vector<size_t>& col)"
    118            << std::endl;
     217    *error <<   "ERROR:" << std::endl;
    119218    *error << "MatrixLookup is " << m5(0,0) << " expected " << m2(1,1)
    120219           << std::endl;
    121220  }
    122  
     221  else
     222    *error << "Ok" << std::endl;
     223 
     224  *error << "MatrixLookup::MatrixLookup(const MatrixLookup&,\n"
     225         << "                           const std::vector<size_t>&,\n"
     226         << "                           const bool)...";
    123227  classifier::MatrixLookup m6(m2,one,true);
    124228  if (m6.rows()!=1 || m6.columns()!=m2.columns() || m6(0,0)!=m2(1,0) ||
    125229      m6(0,1)!=m2(1,1)) {
    126230    ok =false;
    127     *error <<   "ERROR:\n"
    128            << "MatrixLookup::MatrixLookup(const MatrixLookup&,\n"
    129            << "                           const std::vector<size_t>&,\n"
    130            << "                           const bool)"
    131            << std::endl;
    132   }
    133 
    134 
     231    *error << "ERROR:" << std::endl;
     232  }
     233  else
     234    *error << "Ok" << std::endl;
     235
     236
     237  *error << "MatrixLookup::training_data(const std::vector<size_t>)...";
    135238  const classifier::MatrixLookup* TrnData = m2.training_data(one);
    136239  if (TrnData->rows() != m2.rows() || TrnData->columns()!=one.size()){
    137240    ok =false;
    138     *error << "ERROR:\nMatrixLookup::training_data(const std::vector<size_t>)"
    139            << std::endl;
    140   }
     241    *error << "ERROR:" << std::endl;
     242  }
     243  else
     244    *error << "Ok" << std::endl;
    141245  delete TrnData;
    142246
     247  *error << "MatrixLookup::validation_data(const std::vector<size_t>,\n"
     248         << "                              const std::vector<size_t>)...";
    143249  std::vector<size_t> val(23,2);
    144250  const classifier::MatrixLookup* ValData = m2.validation_data(one, val);
    145251  if (ValData->rows() != m2.rows() || TrnData->columns()!=val.size()){
    146252    ok =false;
    147     *error << "ERROR:\n"
    148            << "MatrixLookup::validation_data(const std::vector<size_t>,\n"
    149            << "                              const std::vector<size_t>)"
    150            << std::endl;
    151   }
     253    *error << "ERROR:" << std::endl;
     254  }
     255  else
     256    *error << "Ok" << std::endl;
    152257  delete ValData;
    153258
Note: See TracChangeset for help on using the changeset viewer.