Changeset 1583


Ignore:
Timestamp:
Oct 15, 2008, 8:29:47 PM (13 years ago)
Author:
Peter
Message:

removed layer of StrideIterator? for iterators having stride=1 all the time. Also corrected type of iterator returned (hm).

Location:
trunk/yat/utility
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/MatrixWeighted.cc

    r1487 r1583  
    7878
    7979
    80   MatrixWeighted::iterator MatrixWeighted::begin_column(size_t i)
    81   {
    82     return iterator(vec_.begin()+i, columns_);
    83   }
    84 
    85 
    86   MatrixWeighted::const_iterator MatrixWeighted::begin_column(size_t i) const
    87   {
    88     return const_iterator(vec_.begin()+i, columns_);
    89   }
    90 
    91 
    92   MatrixWeighted::iterator MatrixWeighted::begin_row(size_t i)
    93   {
    94     return iterator(vec_.begin()+columns_*i);
     80  MatrixWeighted::column_iterator MatrixWeighted::begin_column(size_t i)
     81  {
     82    return column_iterator(vec_.begin()+i, columns_);
     83  }
     84
     85
     86  MatrixWeighted::const_column_iterator
     87  MatrixWeighted::begin_column(size_t i) const
     88  {
     89    return const_column_iterator(vec_.begin()+i, columns_);
     90  }
     91
     92
     93  MatrixWeighted::row_iterator MatrixWeighted::begin_row(size_t i)
     94  {
     95    return row_iterator(vec_.begin()+columns_*i);
    9596  }
    9697
     
    9899  MatrixWeighted::const_iterator MatrixWeighted::begin_row(size_t i) const
    99100  {
    100     return const_iterator(vec_.begin()+columns_*i);
     101    return const_row_iterator(vec_.begin()+columns_*i);
    101102  }
    102103
     
    141142
    142143
    143   MatrixWeighted::iterator MatrixWeighted::end_column(size_t i)
    144   {
    145     return iterator(vec_.begin()+i+vec_.size(), columns_);
    146   }
    147 
    148 
    149   MatrixWeighted::const_iterator MatrixWeighted::end_column(size_t i) const
    150   {
    151     return const_iterator(vec_.begin()+i+vec_.size(), columns_);
    152   }
    153 
    154 
    155   MatrixWeighted::iterator MatrixWeighted::end_row(size_t i)
    156   {
    157     return iterator(vec_.begin()+columns_*(i+1));
    158   }
    159 
    160 
    161   MatrixWeighted::const_iterator MatrixWeighted::end_row(size_t i) const
    162   {
    163     return const_iterator(vec_.begin()+columns_*(i+1));
     144  MatrixWeighted::column_iterator MatrixWeighted::end_column(size_t i)
     145  {
     146    return column_iterator(vec_.begin()+i+vec_.size(), columns_);
     147  }
     148
     149
     150  MatrixWeighted::const_column_iterator
     151  MatrixWeighted::end_column(size_t i) const
     152  {
     153    return const_column_iterator(vec_.begin()+i+vec_.size(), columns_);
     154  }
     155
     156
     157  MatrixWeighted::row_iterator MatrixWeighted::end_row(size_t i)
     158  {
     159    return row_iterator(vec_.begin()+columns_*(i+1));
     160  }
     161
     162
     163  MatrixWeighted::const_row_iterator MatrixWeighted::end_row(size_t i) const
     164  {
     165    return const_row_iterator(vec_.begin()+columns_*(i+1));
    164166  }
    165167
  • trunk/yat/utility/MatrixWeighted.h

    r1549 r1583  
    6363       Mutable iterator that iterates over all elements
    6464     */
    65     typedef StrideIterator<std::vector<DataWeight>::iterator> iterator;
     65    typedef std::vector<DataWeight>::iterator iterator;
    6666
    6767    /**
    6868       Read-only iterator that iterates over all elements
    6969     */
    70     typedef StrideIterator<std::vector<DataWeight>::const_iterator>
    71     const_iterator;
     70    typedef std::vector<DataWeight>::const_iterator const_iterator;
    7271
    7372    /**
     
    8584       Mutable iterator that iterates over one row
    8685     */
    87     typedef StrideIterator<std::vector<DataWeight>::iterator> row_iterator;
     86    typedef std::vector<DataWeight>::iterator row_iterator;
    8887
    8988    /**
    9089       Read-only iterator that iterates over one row
    9190     */
    92     typedef StrideIterator<std::vector<DataWeight>::const_iterator>
    93     const_row_iterator;
     91    typedef std::vector<DataWeight>::const_iterator const_row_iterator;
    9492
    9593    /**
     
    153151       \return iterator pointing to first element of column \a i.
    154152     */
    155     iterator begin_column(size_t i);
     153    column_iterator begin_column(size_t i);
    156154
    157155    /**
     
    160158       \return const_iterator pointing to first element of column \a i.
    161159     */
    162     const_iterator begin_column(size_t i) const;
     160    const_column_iterator begin_column(size_t i) const;
    163161
    164162    /**
     
    167165       \return iterator pointing to first element of row \a i.
    168166     */
    169     iterator begin_row(size_t i);
     167    row_iterator begin_row(size_t i);
    170168
    171169    /**
     
    174172       \return const_iterator pointing to first element of row \a i.
    175173     */
    176     const_iterator begin_row(size_t i) const;
     174    const_row_iterator begin_row(size_t i) const;
    177175
    178176    /**
     
    194192       \return iterator pointing to end of column \a i
    195193     */
    196     iterator end_column(size_t i);
     194    column_iterator end_column(size_t i);
    197195
    198196    /**
    199197       \return const_iterator pointing to end of column \a i
    200198     */
    201     const_iterator end_column(size_t i) const;
     199    const_column_iterator end_column(size_t i) const;
    202200
    203201    /**
    204202       \return iterator pointing to end of row \a i
    205203     */
    206     iterator end_row(size_t i);
     204    row_iterator end_row(size_t i);
    207205
    208206    /**
    209207       \return const_iterator pointing to end of row \a i
    210208     */
    211     const_iterator end_row(size_t i) const;
     209    const_row_iterator end_row(size_t i) const;
    212210
    213211    /**
Note: See TracChangeset for help on using the changeset viewer.