15#ifndef dealii_linear_index_iterator_h
16#define dealii_linear_index_iterator_h
137template <
typename DerivedIterator,
typename AccessorType>
144#ifdef DEAL_II_HAVE_CXX20
255 template <
typename OtherIterator>
256 std::enable_if_t<std::is_convertible_v<OtherIterator, DerivedIterator>,
bool>
259 const auto &right_2 =
static_cast<const DerivedIterator &
>(right);
260 return this->
accessor == right_2.accessor;
266 template <
typename OtherIterator>
267 std::enable_if_t<std::is_convertible_v<OtherIterator, DerivedIterator>,
bool>
270 return !(*
this == right);
301 operator<(
const DerivedIterator &)
const;
330template <
typename DerivedIterator,
typename AccessorType>
331inline DerivedIterator &
333 const DerivedIterator &it)
335 accessor.container = it.container;
336 accessor.linear_index = it.linear_index;
337 return static_cast<DerivedIterator &
>(*this);
342template <
typename DerivedIterator,
typename AccessorType>
343inline DerivedIterator &
346 return operator+=(1);
351template <
typename DerivedIterator,
typename AccessorType>
352inline DerivedIterator
355 const DerivedIterator copy(this->accessor);
362template <
typename DerivedIterator,
typename AccessorType>
363inline DerivedIterator &
366 return operator+=(-1);
371template <
typename DerivedIterator,
typename AccessorType>
372inline DerivedIterator
375 const DerivedIterator copy(this->accessor);
382template <
typename DerivedIterator,
typename AccessorType>
383inline DerivedIterator
387 DerivedIterator copy(this->accessor);
394template <
typename DerivedIterator,
typename AccessorType>
395inline DerivedIterator
399 DerivedIterator copy(this->accessor);
406template <
typename DerivedIterator,
typename AccessorType>
407inline DerivedIterator &
411 accessor.linear_index += n;
412 return static_cast<DerivedIterator &
>(*this);
417template <
typename DerivedIterator,
typename AccessorType>
418inline DerivedIterator &
422 return operator+=(-n);
427template <
typename DerivedIterator,
typename AccessorType>
431 const DerivedIterator &other)
const
433 Assert(this->accessor.container == other.accessor.container,
435 "Only iterators pointing to the same container can be compared."));
436 return this->accessor.linear_index - other.accessor.linear_index;
441template <
typename DerivedIterator,
typename AccessorType>
450template <
typename DerivedIterator,
typename AccessorType>
459template <
typename DerivedIterator,
typename AccessorType>
462 const DerivedIterator &other)
const
464 return (*
this == other) || (*
this < other);
469template <
typename DerivedIterator,
typename AccessorType>
472 const DerivedIterator &other)
const
474 return !(*
this < other);
479template <
typename DerivedIterator,
typename AccessorType>
482 const DerivedIterator &other)
const
484 Assert(this->accessor.container == other.accessor.container,
486 "Only iterators pointing to the same container can be compared."));
487 return this->accessor.linear_index < other.accessor.linear_index;
492template <
typename DerivedIterator,
typename AccessorType>
495 const DerivedIterator &other)
const
497 return other < static_cast<const DerivedIterator &>(*
this);
502template <
typename DerivedIterator,
typename AccessorType>
504 const AccessorType accessor)
reference operator*() const
std::enable_if_t< std::is_convertible_v< OtherIterator, DerivedIterator >, bool > operator!=(const OtherIterator &right) const
LinearIndexIterator(const AccessorType accessor)
std::enable_if_t< std::is_convertible_v< OtherIterator, DerivedIterator >, bool > operator==(const OtherIterator &right) const
bool operator>=(const DerivedIterator &) const
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)