Changeset 1361 for trunk


Ignore:
Timestamp:
Jul 2, 2008, 11:23:56 PM (13 years ago)
Author:
Peter
Message:

fixing ticket:389 - the problem was in test code

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/matrix_lookup_test.cc

    r1360 r1361  
    5555    suite.err() << "Ok" << std::endl;
    5656
    57   // FIXME - see ticket:389
    58   //suite.add(suite.test_stream(m1));
     57  suite.add(suite.test_stream(m1));
    5958
    6059 
     
    162161  suite.err() << "MatrixLookup::validation_data(const std::vector<size_t>,\n"
    163162         << "                              const std::vector<size_t>)...";
    164   std::vector<size_t> val(23,2);
     163  std::vector<size_t> val(23,1);
    165164  const classifier::MatrixLookup* ValData =
    166165    new MatrixLookup(m2, utility::Index(val), false);
  • trunk/yat/classifier/MatrixLookup.cc

    r1275 r1361  
    113113    : data_(other.data_)
    114114  {
     115    assert(other.validate());
    115116    if (row){
    116117      row_index_ = utility::Index(other.row_index_, index);
     
    123124    assert(validate());
    124125  }
    125  
    126126
    127127
  • trunk/yat/utility/Index.cc

    r1134 r1361  
    2323
    2424#include "Index.h"
     25
     26#include <cassert>
    2527
    2628namespace theplu {
     
    5759    std::vector<size_t>* vec = new std::vector<size_t>;
    5860    vec->reserve(b.size());
    59     for (size_t i=0; i<b.size(); ++i)
     61    for (size_t i=0; i<b.size(); ++i) {
     62      assert(b[i]<a.size());
    6063      vec->push_back(a[b[i]]);
     64    }
    6165    index_ = SmartPtr<const std::vector<size_t> >(vec);
    6266  }
Note: See TracChangeset for help on using the changeset viewer.