16 #ifndef dealii_linear_index_iterator_h 17 #define dealii_linear_index_iterator_h 19 #include <deal.II/base/config.h> 21 #include <deal.II/base/exceptions.h> 24 DEAL_II_NAMESPACE_OPEN
140 template <
class DerivedIterator,
class AccessorType>
236 operator-(
const DerivedIterator &p)
const;
289 operator<(
const DerivedIterator &)
const;
296 operator>(
const DerivedIterator &)
const;
318 template <
class DerivedIterator,
class AccessorType>
319 inline DerivedIterator &
323 accessor.container = it.container;
324 accessor.linear_index = it.linear_index;
325 return static_cast<DerivedIterator &
>(*this);
330 template <
class DerivedIterator,
class AccessorType>
331 inline DerivedIterator &
334 return operator+=(1);
339 template <
class DerivedIterator,
class AccessorType>
340 inline DerivedIterator
343 const DerivedIterator copy(this->accessor);
350 template <
class DerivedIterator,
class AccessorType>
351 inline DerivedIterator &
354 return operator+=(-1);
359 template <
class DerivedIterator,
class AccessorType>
360 inline DerivedIterator
363 const DerivedIterator copy(this->accessor);
370 template <
class DerivedIterator,
class AccessorType>
371 inline DerivedIterator
375 DerivedIterator copy(this->accessor);
382 template <
class DerivedIterator,
class AccessorType>
383 inline DerivedIterator
387 DerivedIterator copy(this->accessor);
394 template <
class DerivedIterator,
class AccessorType>
395 inline DerivedIterator &
399 accessor.linear_index += n;
400 return static_cast<DerivedIterator &
>(*this);
405 template <
class DerivedIterator,
class AccessorType>
406 inline DerivedIterator &
410 return operator+=(-n);
415 template <
class DerivedIterator,
class AccessorType>
421 Assert(this->accessor.container == other.accessor.container,
423 "Only iterators pointing to the same container can be compared."));
424 return this->accessor.linear_index - other.accessor.linear_index;
429 template <
class DerivedIterator,
class AccessorType>
438 template <
class DerivedIterator,
class AccessorType>
447 template <
class DerivedIterator,
class AccessorType>
452 const auto &other_2 =
static_cast<decltype(*this) &
>(other);
453 return accessor.container == other_2.accessor.container &&
454 accessor.linear_index == other_2.accessor.linear_index;
459 template <
class DerivedIterator,
class AccessorType>
464 return !(*
this == other);
469 template <
class DerivedIterator,
class AccessorType>
474 return (*
this == other) || (*
this < other);
479 template <
class DerivedIterator,
class AccessorType>
484 return !(*
this < other);
489 template <
class DerivedIterator,
class AccessorType>
494 Assert(this->accessor.container == other.accessor.container,
496 "Only iterators pointing to the same container can be compared."));
497 return this->accessor.linear_index < other.accessor.linear_index;
502 template <
class DerivedIterator,
class AccessorType>
507 return other < static_cast<const DerivedIterator &>(*this);
512 template <
class DerivedIterator,
class AccessorType>
514 const AccessorType accessor)
519 DEAL_II_NAMESPACE_CLOSE
pointer operator->() const
DerivedIterator & operator+=(const difference_type n)
bool operator<(const DerivedIterator &) const
DerivedIterator operator-(const difference_type n) const
std::ptrdiff_t difference_type
DerivedIterator & operator=(const DerivedIterator &it)
bool operator!=(const DerivedIterator &) const
static ::ExceptionBase & ExcMessage(std::string arg1)
DerivedIterator operator+(const difference_type n) const
bool operator>(const DerivedIterator &) const
bool operator<=(const DerivedIterator &) const
#define Assert(cond, exc)
bool operator==(const DerivedIterator &) const
std::random_access_iterator_tag iterator_category
DerivedIterator & operator++()
bool operator>=(const DerivedIterator &) const
DerivedIterator & operator-=(const difference_type n)
typename value_type::size_type size_type
DerivedIterator & operator--()
const value_type & reference
const value_type * pointer
reference operator*() const