Changeset 1525 for trunk


Ignore:
Timestamp:
Sep 24, 2008, 2:36:10 PM (13 years ago)
Author:
Peter
Message:

refs #444 - simplifying code in DataLookupD by calling underlying MatrixLookup? rather than creating iterator yourself.

Location:
trunk/yat/classifier
Files:
2 edited

Legend:

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

    r1487 r1525  
    9494  {
    9595    if (column_vector_)
    96       return const_iterator(const_iterator::iterator_type(*matrix_, 0, index_),
    97                             matrix_->columns());
    98     return const_iterator(const_iterator::iterator_type(*matrix_, index_, 0),1);
     96      return matrix_->begin_column(index_);
     97    return matrix_->begin_row(index_);
    9998  }
    10099
     
    103102  {
    104103    if (column_vector_)
    105       return const_iterator(const_iterator::iterator_type(*matrix_,
    106                                                           matrix_->rows(),
    107                                                           index_),
    108                             matrix_->columns());
    109     return const_iterator(const_iterator::iterator_type(*matrix_,index_+1,0), 1);
     104      return matrix_->end_column(index_);
     105    return matrix_->end_row(index_);
    110106  }
    111107
  • trunk/yat/classifier/DataLookup1D.h

    r1487 r1525  
    2727
    2828#include "MatrixLookup.h"
    29 #include "yat/utility/Container2DIterator.h"
    30 #include "yat/utility/iterator_traits.h"
    31 #include "yat/utility/StrideIterator.h"
    3229
    3330#include <iostream>
     
    4845  public:
    4946    /// 'Read Only' iterator
    50     typedef utility::StrideIterator<
    51     utility::Container2DIterator<const MatrixLookup, const double, void,
    52                                  const double> >
    53     const_iterator;
     47    typedef MatrixLookup::const_row_iterator const_iterator;
    5448
    5549    ///
     
    125119
    126120  private:
     121    // assignment no allowed
    127122    const DataLookup1D& operator=(const DataLookup1D&);
    128123
Note: See TracChangeset for help on using the changeset viewer.