Changeset 1374 for trunk/yat/utility


Ignore:
Timestamp:
Jul 16, 2008, 6:34:45 PM (13 years ago)
Author:
Peter
Message:

fixes #391 - implemented specializations for StrideIterator? and Container2DIterator

Location:
trunk/yat/utility
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/Container2DIterator.h

    r1275 r1374  
    289289  struct iterator_traits<Container2DIterator<A, B, C, D, E> > {
    290290    /**
     291       data_reference is defined by Policy class E::data_type
     292     */
     293    typedef typename E::data_type data_reference;
     294
     295    /**
     296       data_reference is defined by Policy class E::weight_type
     297     */
     298    typedef typename E::weight_type weight_reference;
     299
     300    /**
    291301       \return data
    292302    */
    293     double data(Container2DIterator<A, B, C, D, E> iter) const
     303    data_reference data(Container2DIterator<A, B, C, D, E> iter) const
    294304    { return iter.data(); }
    295305
     
    297307       \return weight
    298308    */
    299     double weight(Container2DIterator<A, B, C, D, E> iter) const
     309    weight_reference weight(Container2DIterator<A, B, C, D, E> iter) const
    300310    { return iter.weight(); }
    301311
  • trunk/yat/utility/StrideIterator.h

    r1293 r1374  
    5757  struct iterator_traits<StrideIterator<Iter> > {
    5858    /**
    59        \return data that is *iter
    60     */
    61     double data(StrideIterator<Iter> iter) const
     59       data_reference same as for underlying iterator
     60     */
     61    typedef typename iterator_traits<Iter>::data_reference data_reference;
     62
     63    /**
     64       weight_reference same as for underlying iterator
     65     */
     66    typedef typename iterator_traits<Iter>::weight_reference weight_reference;
     67
     68    /**
     69       \return data of iterator
     70    */
     71    data_reference data(StrideIterator<Iter> iter) const
    6272    { return iterator_traits<Iter>().data(iter.base()); }
    6373
    6474    /**
    65        \return 1.0
    66     */
    67     double weight(StrideIterator<Iter> iter) const
     75       \return weight of iterator
     76    */
     77    weight_reference weight(StrideIterator<Iter> iter) const
    6878    { return iterator_traits<Iter>().weight(iter.base()); }
    6979
Note: See TracChangeset for help on using the changeset viewer.