Reference documentation for deal.II version 9.4.1
\(\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 | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
internal::BlockVectorIterators::Iterator< BlockVectorType, Constness > Class Template Reference

#include <deal.II/lac/block_vector_base.h>

Public Types

using size_type = types::global_dof_index
 
using value_type = typename std::conditional< Constness, const typename BlockVectorType::value_type, typename BlockVectorType::value_type >::type
 
using iterator_category = std::random_access_iterator_tag
 
using difference_type = std::ptrdiff_t
 
using reference = typename BlockVectorType::reference
 
using pointer = value_type *
 
using dereference_type = typename std::conditional< Constness, value_type, typename BlockVectorType::BlockType::reference >::type
 
using BlockVector = typename std::conditional< Constness, const BlockVectorType, BlockVectorType >::type
 

Public Member Functions

 Iterator (BlockVector &parent, const size_type global_index)
 
 Iterator (const Iterator< BlockVectorType, !Constness > &c)
 
 Iterator (const Iterator &c)
 
Iteratoroperator= (const Iterator &c)
 
dereference_type operator* () const
 
dereference_type operator[] (const difference_type d) const
 
Iteratoroperator++ ()
 
Iterator operator++ (int)
 
Iteratoroperator-- ()
 
Iterator operator-- (int)
 
template<bool OtherConstness>
bool operator== (const Iterator< BlockVectorType, OtherConstness > &i) const
 
template<bool OtherConstness>
bool operator!= (const Iterator< BlockVectorType, OtherConstness > &i) const
 
template<bool OtherConstness>
bool operator< (const Iterator< BlockVectorType, OtherConstness > &i) const
 
template<bool OtherConstness>
bool operator<= (const Iterator< BlockVectorType, OtherConstness > &i) const
 
template<bool OtherConstness>
bool operator> (const Iterator< BlockVectorType, OtherConstness > &i) const
 
template<bool OtherConstness>
bool operator>= (const Iterator< BlockVectorType, OtherConstness > &i) const
 
template<bool OtherConstness>
difference_type operator- (const Iterator< BlockVectorType, OtherConstness > &i) const
 
Iterator operator+ (const difference_type &d) const
 
Iterator operator- (const difference_type &d) const
 
Iteratoroperator+= (const difference_type &d)
 
Iteratoroperator-= (const difference_type &d)
 

Static Public Member Functions

static ::ExceptionBaseExcPointerToDifferentVectors ()
 

Private Member Functions

 Iterator (BlockVector &parent, const size_type global_index, const size_type current_block, const size_type index_within_block, const size_type next_break_forward, const size_type next_break_backward)
 
void move_forward ()
 
void move_backward ()
 

Private Attributes

BlockVectorparent
 
size_type global_index
 
unsigned int current_block
 
size_type index_within_block
 
size_type next_break_forward
 
size_type next_break_backward
 

Friends

template<typename , bool >
class Iterator
 

Detailed Description

template<class BlockVectorType, bool Constness>
class internal::BlockVectorIterators::Iterator< BlockVectorType, Constness >

General random-access iterator class for block vectors. Since we do not want to have two classes for non-const iterator and const_iterator, we take a second template argument which denotes whether the vector we point into is a constant object or not. The first template argument is always the number type of the block vector in use.

This class satisfies all requirements of random access iterators defined in the C++ standard. Operations on these iterators are constant in the number of elements in the block vector. However, they are sometimes linear in the number of blocks in the vector, but since that does rarely change dynamically within an application, this is a constant and we again have that the iterator satisfies the requirements of a random access iterator.

Definition at line 120 of file block_vector_base.h.


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