1 #ifndef BALL_LINALG_REVERSEITERATOR_H
2 #define BALL_LINALG_REVERSEITERATOR_H
4 #ifndef BALL_CONCEPT_RANDOMACCESSITERATOR_H
21 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
204 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
205 ConstReverseIterator<Container, DataType, Position, Traits>&
208 if (!Base::getTraits().isValid())
213 Base::getTraits().backward();
217 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
221 if (!Base::getTraits().isValid())
231 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
235 if (Base::getTraits().isSingular())
240 Base::getTraits().forward();
244 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
248 if (Base::getTraits().isSingular())
263 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
268 return (tmp_iterator += distance);
277 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
278 Distance ConstReverseIterator<Container, DataType, Position, Traits>::operator -
279 (
const ConstReverseIterator<Container, DataType, Position, Traits>& b)
const
281 if (!Base::getTraits().isValid())
283 Exception::InvalidIterator e;
286 if (!b.getTraits().isValid())
288 Exception::InvalidIterator e;
291 if (Base::getTraits().getContainer() != b.getTraits().getContainer())
293 Exception::IncompatibleIterators e;
296 return Base::getTraits().getDistance(b.getTraits());
299 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
300 ConstReverseIterator<Container, DataType, Position, Traits>&
303 if (!Base::getTraits().isValid())
310 return (*
this -= -distance);
312 Base::getTraits().backward(distance);
316 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
320 if (Base::getTraits().isSingular())
327 return (*
this += -distance);
329 if (Base::getTraits().isREnd() ==
true)
331 Base::getTraits().toBegin();
332 Base::getTraits().forward(distance - 1);
336 Base::getTraits().forward(distance);
341 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
346 return (iterator += distance);
349 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
354 return (iterator -= distance);
357 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
361 if (!Base::getTraits().isValid())
366 if (!iterator.isValid())
371 if (Base::getTraits().getContainer() != iterator.getContainer())
377 return !(Base::getTraits().operator < (iterator.getTraits()));
380 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
384 if (!Base::getTraits().isValid())
389 if (!iterator.isValid())
394 if (Base::getTraits().getContainer() != iterator.getContainer())
399 return (Base::getTraits().operator > (iterator.getTraits()));
402 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
406 if (!Base::getTraits().isValid())
411 if (!iterator.isValid())
416 if (Base::getTraits().getContainer() != iterator.getContainer())
422 return (Base::getTraits().operator < (iterator.getTraits()));
425 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
429 if (!Base::getTraits().isValid())
434 if (!iterator.isValid())
439 if (Base::getTraits().getContainer() != iterator.getContainer())
445 return !(Base::getTraits().operator > (iterator.getTraits()));
449 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
452 if (!Base::getTraits().isValid())
458 return Base::getTraits().getData(index);
461 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
470 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
479 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
488 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
504 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
589 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
590 ReverseIterator<Container, DataType, Position, Traits>
598 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
607 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
616 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
627 #endif // BALL_KERNEL_REVERSEITERATOR_H