Changeset 1104


Ignore:
Timestamp:
Feb 18, 2008, 6:14:46 AM (13 years ago)
Author:
Peter
Message:

adding iterator typedefs in MatrixLookup?

Location:
trunk/yat/classifier
Files:
2 edited

Legend:

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

    r1066 r1104  
    167167
    168168
    169   MatrixLookup::const_iterator MatrixLookup::begin_column(size_t i) const
    170   {
    171     return const_iterator(const_iterator::iterator_type(*this, 0, i),columns());
    172   }
    173 
    174 
    175   MatrixLookup::const_iterator MatrixLookup::begin_row(size_t i) const
    176   {
    177     return const_iterator(const_iterator::iterator_type(*this, i, 0), 1);
     169  MatrixLookup::const_column_iterator MatrixLookup::begin_column(size_t i) const
     170  {
     171    return const_column_iterator(const_iterator::iterator_type(*this, 0, i),
     172                                 columns());
     173  }
     174
     175
     176  MatrixLookup::const_row_iterator MatrixLookup::begin_row(size_t i) const
     177  {
     178    return const_row_iterator(const_iterator::iterator_type(*this, i, 0), 1);
    178179  }
    179180
     
    185186
    186187
    187   MatrixLookup::const_iterator MatrixLookup::end_column(size_t i) const
    188   {
    189     return const_iterator(const_iterator::iterator_type(*this, rows(), i),
    190                           columns());
    191   }
    192 
    193 
    194   MatrixLookup::const_iterator MatrixLookup::end_row(size_t i) const
    195   {
    196     return const_iterator(const_iterator::iterator_type(*this, i+1, 0), 1);
     188  MatrixLookup::const_column_iterator MatrixLookup::end_column(size_t i) const
     189  {
     190    return const_column_iterator(const_iterator::iterator_type(*this, rows(),i),
     191                                 columns());
     192  }
     193
     194
     195  MatrixLookup::const_row_iterator MatrixLookup::end_row(size_t i) const
     196  {
     197    return const_row_iterator(const_iterator::iterator_type(*this, i+1, 0), 1);
    197198  }
    198199
  • trunk/yat/classifier/MatrixLookup.h

    r1083 r1104  
    7878    const_iterator;
    7979
     80    typedef const_iterator const_column_iterator;
     81    typedef const_iterator const_row_iterator;
     82
    8083    ///
    8184    /// Constructor creating a lookup into the entire @a matrix.
     
    234237       \return iterator pointing to first element of column \a i.
    235238     */
    236     const_iterator begin_column(size_t) const;
     239    const_column_iterator begin_column(size_t) const;
    237240
    238241    /**
     
    241244       \return const_iterator pointing to first element of column \a i.
    242245     */
    243     const_iterator begin_row(size_t) const;
     246    const_row_iterator begin_row(size_t) const;
    244247
    245248    /**
     
    251254       \return const_iterator pointing to end of column \a i
    252255     */
    253     const_iterator end_column(size_t) const;
     256    const_column_iterator end_column(size_t) const;
    254257
    255258    /**
    256259       \return const_iterator pointing to end of row \a i
    257260     */
    258     const_iterator end_row(size_t) const;
     261    const_row_iterator end_row(size_t) const;
    259262
    260263    /**
Note: See TracChangeset for help on using the changeset viewer.