Ignore:
Timestamp:
Feb 9, 2009, 11:11:30 PM (12 years ago)
Author:
Peter
Message:

Changed MatrixLookup::operator() to return const double& rather than double. Fixes #488

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/iterator_test.cc

    r1749 r1788  
    44  Copyright (C) 2007 Jari Häkkinen, Peter Johansson, Markus Ringnér
    55  Copyright (C) 2008 Peter Johansson, Markus Ringnér
     6  Copyright (C) 2009 Peter Johansson
    67
    78  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    2627
    2728#include "yat/classifier/DataLookupWeighted1D.h"
     29#include "yat/classifier/MatrixLookup.h"
    2830#include "yat/classifier/MatrixLookupWeighted.h"
    2931#include "yat/utility/Container2DIterator.h"
     
    7981void test_stride_iterator(test::Suite& suite);
    8082void test_weighted_iterator(test::Suite& suite);
     83void test_matrix_lookup_iterator(test::Suite& suite);
    8184
    8285int main(int argc, char* argv[])
     
    465468  suite.add(*iter_p==*iter); 
    466469}
     470
     471void test_matrix_lookup_iterator(test::Suite& suite)
     472{
     473  classifier::MatrixLookup ml(10, 10);
     474  test_random_access_iterator(ml.begin(), suite);
     475  std::vector<double> vec(ml.rows()*ml.columns());
     476  std::copy(ml.begin(), ml.end(), vec.begin());
     477}
     478
Note: See TracChangeset for help on using the changeset viewer.