16#ifndef dealii_linear_index_iterator_h
17#define dealii_linear_index_iterator_h
138template <
class DerivedIterator,
class AccessorType>
252 template <
typename OtherIterator>
253 friend typename std::enable_if<
254 std::is_convertible<OtherIterator, DerivedIterator>::value,
258 const auto &right_2 =
static_cast<const DerivedIterator &
>(right);
259 return left.
accessor == right_2.accessor;
265 template <
typename OtherIterator>
266 friend typename std::enable_if<
267 std::is_convertible<OtherIterator, DerivedIterator>::value,
271 return !(left == right);
302 operator<(
const DerivedIterator &)
const;
331template <
class DerivedIterator,
class AccessorType>
332inline DerivedIterator &
334 const DerivedIterator &it)
336 accessor.container = it.container;
337 accessor.linear_index = it.linear_index;
338 return static_cast<DerivedIterator &
>(*this);
343template <
class DerivedIterator,
class AccessorType>
344inline DerivedIterator &
347 return operator+=(1);
352template <
class DerivedIterator,
class AccessorType>
353inline DerivedIterator
356 const DerivedIterator copy(this->accessor);
363template <
class DerivedIterator,
class AccessorType>
364inline DerivedIterator &
367 return operator+=(-1);
372template <
class DerivedIterator,
class AccessorType>
373inline DerivedIterator
376 const DerivedIterator copy(this->accessor);
383template <
class DerivedIterator,
class AccessorType>
384inline DerivedIterator
388 DerivedIterator copy(this->accessor);
395template <
class DerivedIterator,
class AccessorType>
396inline DerivedIterator
400 DerivedIterator copy(this->accessor);
407template <
class DerivedIterator,
class AccessorType>
408inline DerivedIterator &
412 accessor.linear_index += n;
413 return static_cast<DerivedIterator &
>(*this);
418template <
class DerivedIterator,
class AccessorType>
419inline DerivedIterator &
423 return operator+=(-n);
428template <
class DerivedIterator,
class AccessorType>
432 const DerivedIterator &other)
const
434 Assert(this->accessor.container == other.accessor.container,
436 "Only iterators pointing to the same container can be compared."));
437 return this->accessor.linear_index - other.accessor.linear_index;
442template <
class DerivedIterator,
class AccessorType>
451template <
class DerivedIterator,
class AccessorType>
460template <
class DerivedIterator,
class AccessorType>
463 const DerivedIterator &other)
const
465 return (*
this == other) || (*
this < other);
470template <
class DerivedIterator,
class AccessorType>
473 const DerivedIterator &other)
const
475 return !(*
this < other);
480template <
class DerivedIterator,
class AccessorType>
483 const DerivedIterator &other)
const
485 Assert(this->accessor.container == other.accessor.container,
487 "Only iterators pointing to the same container can be compared."));
488 return this->accessor.linear_index < other.accessor.linear_index;
493template <
class DerivedIterator,
class AccessorType>
496 const DerivedIterator &other)
const
498 return other < static_cast<const DerivedIterator &>(*
this);
503template <
class DerivedIterator,
class AccessorType>
505 const AccessorType accessor)
reference operator*() const
LinearIndexIterator(const AccessorType accessor)
bool operator>=(const DerivedIterator &) const
difference_type operator-(const DerivedIterator &p) const
friend std::enable_if< std::is_convertible< OtherIterator, DerivedIterator >::value, bool >::type operator!=(const LinearIndexIterator &left, const OtherIterator &right)
bool operator<=(const DerivedIterator &) const
DerivedIterator & operator++()
DerivedIterator operator--(int)
DerivedIterator operator++(int)
friend std::enable_if< std::is_convertible< OtherIterator, DerivedIterator >::value, bool >::type operator==(const LinearIndexIterator &left, const OtherIterator &right)
bool operator>(const DerivedIterator &) const
pointer operator->() const
const value_type * pointer
LinearIndexIterator()=default
DerivedIterator operator-(const difference_type n) const
std::random_access_iterator_tag iterator_category
typename value_type::size_type size_type
bool operator<(const DerivedIterator &) const
DerivedIterator operator+(const difference_type n) const
const value_type & reference
std::ptrdiff_t difference_type
DerivedIterator & operator=(const DerivedIterator &it)
DerivedIterator & operator-=(const difference_type n)
DerivedIterator & operator--()
DerivedIterator & operator+=(const difference_type n)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcMessage(std::string arg1)