Changeset 1565
- Timestamp:
- Oct 10, 2008, 11:49:07 PM (14 years ago)
- Location:
- trunk/yat
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/classifier/KernelLookup.h
r1552 r1565 84 84 /// 'Read Only' iterator 85 85 typedef utility::StrideIterator< 86 utility::Container2DIterator<const KernelLookup, double, void,const double> > 86 utility::Container2DIterator<const KernelLookup, value_type, 87 const_reference> > 87 88 const_iterator; 88 89 -
trunk/yat/classifier/MatrixLookup.h
r1549 r1565 87 87 88 88 /// 'Read Only' iterator 89 typedef utility::Container2DIterator<const MatrixLookup, double,90 void, const double>89 typedef utility::Container2DIterator<const MatrixLookup, value_type, 90 const_reference> 91 91 const_iterator; 92 92 -
trunk/yat/classifier/MatrixLookupWeighted.h
r1552 r1565 89 89 typedef utility::StrideIterator< 90 90 utility::Container2DIterator<const MatrixLookupWeighted, 91 value_type, void, 92 const_reference, 93 utility::IteratorPolicyWeighted<const MatrixLookupWeighted, 94 const double, 95 const double> > > 91 value_type, const_reference> > 96 92 const_iterator; 97 93 -
trunk/yat/utility/Container2DIterator.h
r1564 r1565 24 24 */ 25 25 26 #include "IteratorPolicy.h" 26 #include "deprecate.h" 27 #include "iterator_traits.h" 27 28 #include "yat_assert.h" 28 29 … … 41 42 @brief Iterator 42 43 */ 43 template<typename Container, typename value, 44 typename pointer = value*, typename reference = value&, 45 class Policy = IteratorPolicy<Container, reference, value> > 44 template<typename Container, typename value, typename reference = value&> 46 45 class Container2DIterator 47 46 : public boost::iterator_facade< 48 Container2DIterator<Container, value, pointer, reference, Policy>47 Container2DIterator<Container, value, reference> 49 48 , value 50 49 , std::random_access_iterator_tag 51 50 , reference> 52 51 { 53 public:54 /**55 Tells whether iterator is weighted or not.56 57 \see weighted_iterator_tag and unweighted_iterator_tag58 */59 typedef typename Policy::weighted_iterator_type weighted_iterator_type;60 61 52 private: 62 typedef Container2DIterator<Container, value, pointer,reference,Policy> self;53 typedef Container2DIterator<Container, value, reference> self; 63 54 64 55 public: … … 78 69 : container_(&container), index_(row*container.columns()+column) {} 79 70 80 /**81 \return data82 */83 typename Policy::data_type data(void) const84 { yat_assert<std::out_of_range>(index_<this->size(),85 "Container2DIterator::data");86 return ip_.data(*container_, row(index_), column(index_));87 }88 89 /**90 \return weight91 */92 typename Policy::weight_type weight(void) const93 { yat_assert<std::out_of_range>(index_<this->size(),94 "Container2DIterator::weight");95 return ip_.weight(*container_, row(index_), column(index_));96 }97 98 71 private: 99 72 friend class boost::iterator_core_access; … … 101 74 Container* container_; 102 75 size_t index_; 103 Policy ip_;104 76 105 77 void advance(int n) { index_+=n; } -
trunk/yat/utility/iterator_traits.h
r1563 r1565 298 298 that have an underlying iterator (e.g. StrideIterator), this 299 299 class should be specialized, so the class also works when the 300 underlying is an iterator that is not overed by this class300 underlying is an iterator that is not covered by this class 301 301 e.g. WeightedIterator. 302 302 */
Note: See TracChangeset
for help on using the changeset viewer.