16#ifndef dealii_linear_index_iterator_h
17#define dealii_linear_index_iterator_h
138template <
class DerivedIterator,
class AccessorType>
250 template <
typename OtherIterator>
251 friend typename std::enable_if<
252 std::is_convertible<OtherIterator, DerivedIterator>::value,
256 const auto &right_2 =
static_cast<const DerivedIterator &
>(right);
257 return left.
accessor == right_2.accessor;
263 template <
typename OtherIterator>
264 friend typename std::enable_if<
265 std::is_convertible<OtherIterator, DerivedIterator>::value,
269 return !(left == right);
300 operator<(
const DerivedIterator &)
const;
329template <
class DerivedIterator,
class AccessorType>
330inline DerivedIterator &
334 accessor.container = it.container;
335 accessor.linear_index = it.linear_index;
336 return static_cast<DerivedIterator &
>(*this);
341template <
class DerivedIterator,
class AccessorType>
342inline DerivedIterator &
345 return operator+=(1);
350template <
class DerivedIterator,
class AccessorType>
351inline DerivedIterator
354 const DerivedIterator
copy(this->accessor);
361template <
class DerivedIterator,
class AccessorType>
362inline DerivedIterator &
365 return operator+=(-1);
370template <
class DerivedIterator,
class AccessorType>
371inline DerivedIterator
374 const DerivedIterator
copy(this->accessor);
381template <
class DerivedIterator,
class AccessorType>
382inline DerivedIterator
386 DerivedIterator
copy(this->accessor);
393template <
class DerivedIterator,
class AccessorType>
394inline DerivedIterator
398 DerivedIterator
copy(this->accessor);
405template <
class DerivedIterator,
class AccessorType>
406inline DerivedIterator &
410 accessor.linear_index += n;
411 return static_cast<DerivedIterator &
>(*this);
416template <
class DerivedIterator,
class AccessorType>
417inline DerivedIterator &
421 return operator+=(-n);
426template <
class DerivedIterator,
class AccessorType>
430 operator-(
const DerivedIterator &other)
const
432 Assert(this->accessor.container == other.accessor.container,
434 "Only iterators pointing to the same container can be compared."));
435 return this->accessor.linear_index - other.accessor.linear_index;
440template <
class DerivedIterator,
class AccessorType>
449template <
class DerivedIterator,
class AccessorType>
458template <
class DerivedIterator,
class AccessorType>
463 return (*
this == other) || (*
this < other);
468template <
class DerivedIterator,
class AccessorType>
473 return !(*
this < other);
478template <
class DerivedIterator,
class AccessorType>
481operator<(
const DerivedIterator &other)
const
483 Assert(this->accessor.container == other.accessor.container,
485 "Only iterators pointing to the same container can be compared."));
486 return this->accessor.linear_index < other.accessor.linear_index;
491template <
class DerivedIterator,
class AccessorType>
494operator>(
const DerivedIterator &other)
const
496 return other < static_cast<const DerivedIterator &>(*
this);
501template <
class DerivedIterator,
class AccessorType>
503 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)
types::global_dof_index size_type
void copy(const T *begin, const T *end, U *dest)