Ignore:
Timestamp:
Feb 10, 2008, 7:41:06 PM (14 years ago)
Author:
Peter
Message:

redesigning Iterator class to hold a 2D container rather than 1D as before. refs #267

File:
1 edited

Legend:

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

    r1018 r1062  
    9595  DataLookup1D::const_iterator DataLookup1D::begin(void) const
    9696  {
    97     return DataLookup1D::const_iterator(*this, 0);
     97    typedef utility::Iterator<const DataLookup2D, const double> Iter;
     98    if (column_vector_)
     99      return const_iterator(Iter(*matrix_, 0, index_), matrix_->columns());
     100    return const_iterator(Iter(*matrix_, index_, 0), 1);
    98101  }
    99102
     
    101104  DataLookup1D::const_iterator DataLookup1D::end(void) const
    102105  {
    103     return DataLookup1D::const_iterator(*this, size());
     106    typedef utility::Iterator<const DataLookup2D, const double> Iter;
     107    if (column_vector_)
     108      return const_iterator(Iter(*matrix_, matrix_->rows(), index_),
     109                            matrix_->columns());
     110    return const_iterator(Iter(*matrix_, index_+1, 0), 1);
    104111  }
    105112
Note: See TracChangeset for help on using the changeset viewer.