Reference documentation for deal.II version 9.5.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
IndexSet::ElementIterator Class Reference

#include <deal.II/base/index_set.h>

Public Types

using iterator_category = std::forward_iterator_tag
 
using value_type = size_type
 
using difference_type = std::ptrdiff_t
 
using pointer = size_type *
 
using reference = size_type &
 

Public Member Functions

 ElementIterator (const IndexSet *idxset, const size_type range_idx, const size_type index)
 
 ElementIterator (const IndexSet *idxset)
 
size_type operator* () const
 
bool is_valid () const
 
ElementIteratoroperator++ ()
 
ElementIterator operator++ (int)
 
bool operator== (const ElementIterator &) const
 
bool operator!= (const ElementIterator &) const
 
bool operator< (const ElementIterator &) const
 
std::ptrdiff_t operator- (const ElementIterator &p) const
 

Private Member Functions

void advance ()
 

Private Attributes

const IndexSetindex_set
 
size_type range_idx
 
size_type idx
 

Detailed Description

Class that represents an iterator pointing to a single element in the IndexSet as returned by IndexSet::begin().

Definition at line 747 of file index_set.h.

Member Typedef Documentation

◆ iterator_category

using IndexSet::ElementIterator::iterator_category = std::forward_iterator_tag

Mark the class as forward iterator and declare some alias which are standard for iterators and are used by algorithms to enquire about the specifics of the iterators they work on.

Definition at line 822 of file index_set.h.

◆ value_type

Definition at line 823 of file index_set.h.

◆ difference_type

Definition at line 824 of file index_set.h.

◆ pointer

Definition at line 825 of file index_set.h.

◆ reference

Definition at line 826 of file index_set.h.

Constructor & Destructor Documentation

◆ ElementIterator() [1/2]

IndexSet::ElementIterator::ElementIterator ( const IndexSet idxset,
const size_type  range_idx,
const size_type  index 
)
inline

Construct an iterator pointing to the global index index in the interval range_idx

Definition at line 1343 of file index_set.h.

◆ ElementIterator() [2/2]

IndexSet::ElementIterator::ElementIterator ( const IndexSet idxset)
inlineexplicit

Construct an iterator pointing to the end of the IndexSet.

Definition at line 1363 of file index_set.h.

Member Function Documentation

◆ operator*()

IndexSet::size_type IndexSet::ElementIterator::operator* ( ) const
inline

Dereferencing operator. The returned value is the index of the element inside the IndexSet.

Definition at line 1387 of file index_set.h.

◆ is_valid()

bool IndexSet::ElementIterator::is_valid ( ) const
inline

Does this iterator point to an existing element?

Definition at line 1372 of file index_set.h.

◆ operator++() [1/2]

IndexSet::ElementIterator & IndexSet::ElementIterator::operator++ ( )
inline

Prefix increment.

Definition at line 1440 of file index_set.h.

◆ operator++() [2/2]

IndexSet::ElementIterator IndexSet::ElementIterator::operator++ ( int  )
inline

Postfix increment.

Definition at line 1449 of file index_set.h.

◆ operator==()

bool IndexSet::ElementIterator::operator== ( const ElementIterator other) const
inline

Comparison.

Definition at line 1399 of file index_set.h.

◆ operator!=()

bool IndexSet::ElementIterator::operator!= ( const ElementIterator other) const
inline

Inverse of ==.

Definition at line 1459 of file index_set.h.

◆ operator<()

bool IndexSet::ElementIterator::operator< ( const ElementIterator other) const
inline

Comparison operator.

Definition at line 1467 of file index_set.h.

◆ operator-()

std::ptrdiff_t IndexSet::ElementIterator::operator- ( const ElementIterator p) const
inline

Return the distance between the current iterator and the argument. In the expression it_left-it_right the distance is given by how many times one has to apply operator++ to the right operand it_right to get the left operand it_left (for a positive return value), or to it_left to get the it_right (for a negative return value).

Definition at line 1481 of file index_set.h.

◆ advance()

void IndexSet::ElementIterator::advance ( )
inlineprivate

Advance iterator by one.

Definition at line 1411 of file index_set.h.

Member Data Documentation

◆ index_set

const IndexSet* IndexSet::ElementIterator::index_set
private

The parent IndexSet.

Definition at line 838 of file index_set.h.

◆ range_idx

size_type IndexSet::ElementIterator::range_idx
private

Index into index_set.ranges.

Definition at line 842 of file index_set.h.

◆ idx

size_type IndexSet::ElementIterator::idx
private

The global index this iterator is pointing at.

Definition at line 846 of file index_set.h.


The documentation for this class was generated from the following file: