16#ifndef dealii_linear_index_iterator_h
17#define dealii_linear_index_iterator_h
138template <
class DerivedIterator,
class AccessorType>
145#ifdef DEAL_II_HAVE_CXX20
256 template <
typename OtherIterator>
257 friend std::enable_if_t<
258 std::is_convertible<OtherIterator, DerivedIterator>::value,
269 template <
typename OtherIterator>
270 friend std::enable_if_t<
271 std::is_convertible<OtherIterator, DerivedIterator>::value,
275 return !(left == right);
335template <
class DerivedIterator,
class AccessorType>
340 accessor.container =
it.container;
341 accessor.linear_index =
it.linear_index;
347template <
class DerivedIterator,
class AccessorType>
351 return operator+=(1);
356template <
class DerivedIterator,
class AccessorType>
367template <
class DerivedIterator,
class AccessorType>
371 return operator+=(-1);
376template <
class DerivedIterator,
class AccessorType>
387template <
class DerivedIterator,
class AccessorType>
399template <
class DerivedIterator,
class AccessorType>
411template <
class DerivedIterator,
class AccessorType>
416 accessor.linear_index += n;
422template <
class DerivedIterator,
class AccessorType>
427 return operator+=(-n);
432template <
class DerivedIterator,
class AccessorType>
438 Assert(this->accessor.container ==
other.accessor.container,
440 "Only iterators pointing to the same container can be compared."));
441 return this->accessor.linear_index -
other.accessor.linear_index;
446template <
class DerivedIterator,
class AccessorType>
455template <
class DerivedIterator,
class AccessorType>
464template <
class DerivedIterator,
class AccessorType>
474template <
class DerivedIterator,
class AccessorType>
479 return !(*
this <
other);
484template <
class DerivedIterator,
class AccessorType>
489 Assert(this->accessor.container ==
other.accessor.container,
491 "Only iterators pointing to the same container can be compared."));
492 return this->accessor.linear_index <
other.accessor.linear_index;
497template <
class DerivedIterator,
class AccessorType>
507template <
class DerivedIterator,
class AccessorType>
509 const AccessorType accessor)
reference operator*() const
LinearIndexIterator(const AccessorType accessor)
bool operator>=(const DerivedIterator &) const
friend std::enable_if_t< std::is_convertible< OtherIterator, DerivedIterator >::value, bool > operator==(const LinearIndexIterator &left, const OtherIterator &right)
friend std::enable_if_t< std::is_convertible< OtherIterator, DerivedIterator >::value, bool > operator!=(const LinearIndexIterator &left, const OtherIterator &right)
difference_type operator-(const DerivedIterator &p) const
bool operator<=(const DerivedIterator &) const
DerivedIterator & operator++()
DerivedIterator operator--(int)
DerivedIterator operator++(int)
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)