16 #ifndef dealii_linear_index_iterator_h
17 #define dealii_linear_index_iterator_h
138 template <
typename DerivedIterator,
typename AccessorType>
145 #ifdef DEAL_II_HAVE_CXX20
256 template <
typename OtherIterator>
257 std::enable_if_t<std::is_convertible_v<OtherIterator, DerivedIterator>,
bool>
260 const auto &right_2 =
static_cast<const DerivedIterator &
>(right);
261 return this->
accessor == right_2.accessor;
267 template <
typename OtherIterator>
268 std::enable_if_t<std::is_convertible_v<OtherIterator, DerivedIterator>,
bool>
271 return !(*
this == right);
302 operator<(
const DerivedIterator &)
const;
331 template <
typename DerivedIterator,
typename AccessorType>
332 inline DerivedIterator &
334 const DerivedIterator &it)
336 accessor.container = it.container;
337 accessor.linear_index = it.linear_index;
338 return static_cast<DerivedIterator &
>(*this);
343 template <
typename DerivedIterator,
typename AccessorType>
344 inline DerivedIterator &
347 return operator+=(1);
352 template <
typename DerivedIterator,
typename AccessorType>
353 inline DerivedIterator
356 const DerivedIterator
copy(this->accessor);
363 template <
typename DerivedIterator,
typename AccessorType>
364 inline DerivedIterator &
367 return operator+=(-1);
372 template <
typename DerivedIterator,
typename AccessorType>
373 inline DerivedIterator
376 const DerivedIterator
copy(this->accessor);
383 template <
typename DerivedIterator,
typename AccessorType>
384 inline DerivedIterator
388 DerivedIterator
copy(this->accessor);
395 template <
typename DerivedIterator,
typename AccessorType>
396 inline DerivedIterator
400 DerivedIterator
copy(this->accessor);
407 template <
typename DerivedIterator,
typename AccessorType>
408 inline DerivedIterator &
412 accessor.linear_index += n;
413 return static_cast<DerivedIterator &
>(*this);
418 template <
typename DerivedIterator,
typename AccessorType>
419 inline DerivedIterator &
423 return operator+=(-n);
428 template <
typename DerivedIterator,
typename 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;
442 template <
typename DerivedIterator,
typename AccessorType>
451 template <
typename DerivedIterator,
typename AccessorType>
460 template <
typename DerivedIterator,
typename AccessorType>
463 const DerivedIterator &other)
const
465 return (*
this == other) || (*
this < other);
470 template <
typename DerivedIterator,
typename AccessorType>
473 const DerivedIterator &other)
const
475 return !(*
this < other);
480 template <
typename DerivedIterator,
typename 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;
493 template <
typename DerivedIterator,
typename AccessorType>
496 const DerivedIterator &other)
const
498 return other < static_cast<const DerivedIterator &>(*
this);
503 template <
typename DerivedIterator,
typename AccessorType>
505 const AccessorType accessor)
std::enable_if_t< std::is_convertible_v< OtherIterator, DerivedIterator >, bool > operator==(const OtherIterator &right) const
reference operator*() const
std::enable_if_t< std::is_convertible_v< OtherIterator, DerivedIterator >, bool > operator!=(const OtherIterator &right) const
LinearIndexIterator(const AccessorType accessor)
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)
types::global_dof_index size_type
void copy(const T *begin, const T *end, U *dest)