Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
TrilinosWrappers::SparsityPatternIterators::Accessor Class Reference

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

Public Types

using size_type = ::types::global_dof_index
 

Public Member Functions

 Accessor (const SparsityPattern *sparsity_pattern, const size_type row, const size_type index)
 
size_type row () const
 
size_type index () const
 
size_type column () const
 

Static Public Member Functions

static ::ExceptionBaseExcBeyondEndOfSparsityPattern ()
 
static ::ExceptionBaseExcAccessToNonlocalRow (size_type arg1, size_type arg2, size_type arg3)
 

Private Member Functions

void visit_present_row ()
 

Private Attributes

SparsityPatternsparsity_pattern
 
size_type a_row
 
size_type a_index
 
std::shared_ptr< const std::vector< size_type > > colnum_cache
 

Friends

class Iterator
 

Detailed Description

Accessor class for iterators into sparsity patterns. This class is also the base class for both const and non-const accessor classes into sparse matrices.

Note that this class only allows read access to elements, providing their row and column number. It does not allow modifying the sparsity pattern itself.

Author
Wolfgang Bangerth, Martin Kronbichler, Guido Kanschat
Date
2004, 2008, 2012

Definition at line 73 of file trilinos_sparsity_pattern.h.

Member Typedef Documentation

◆ size_type

Declare type for container size.

Definition at line 79 of file trilinos_sparsity_pattern.h.

Constructor & Destructor Documentation

◆ Accessor()

TrilinosWrappers::SparsityPatternIterators::Accessor::Accessor ( const SparsityPattern sparsity_pattern,
const size_type  row,
const size_type  index 
)

Constructor.

Member Function Documentation

◆ row()

size_type TrilinosWrappers::SparsityPatternIterators::Accessor::row ( ) const

Row number of the element represented by this object.

◆ index()

size_type TrilinosWrappers::SparsityPatternIterators::Accessor::index ( ) const

Index in row of the element represented by this object.

◆ column()

size_type TrilinosWrappers::SparsityPatternIterators::Accessor::column ( ) const

Column number of the element represented by this object.

◆ visit_present_row()

void TrilinosWrappers::SparsityPatternIterators::Accessor::visit_present_row ( )
private

Discard the old row caches (they may still be used by other accessors) and generate new ones for the row pointed to presently by this accessor.

Definition at line 37 of file trilinos_sparsity_pattern.cc.

Friends And Related Function Documentation

◆ Iterator

friend class Iterator
friend

Make enclosing class a friend.

Mark all other instances of this template as friends.

Definition at line 164 of file trilinos_sparsity_pattern.h.

Member Data Documentation

◆ sparsity_pattern

SparsityPattern* TrilinosWrappers::SparsityPatternIterators::Accessor::sparsity_pattern
mutableprivate

The matrix accessed.

Definition at line 127 of file trilinos_sparsity_pattern.h.

◆ a_row

size_type TrilinosWrappers::SparsityPatternIterators::Accessor::a_row
private

Current row number.

Definition at line 132 of file trilinos_sparsity_pattern.h.

◆ a_index

size_type TrilinosWrappers::SparsityPatternIterators::Accessor::a_index
private

Current index in row.

Definition at line 137 of file trilinos_sparsity_pattern.h.

◆ colnum_cache

std::shared_ptr<const std::vector<size_type> > TrilinosWrappers::SparsityPatternIterators::Accessor::colnum_cache
private

Cache where we store the column indices of the present row. This is necessary, since Trilinos makes access to the elements of its matrices rather hard, and it is much more efficient to copy all column entries of a row once when we enter it than repeatedly asking Trilinos for individual ones. This also makes some sense since it is likely that we will access them sequentially anyway.

In order to make copying of iterators/accessor of acceptable performance, we keep a shared pointer to these entries so that more than one accessor can access this data if necessary.

Definition at line 151 of file trilinos_sparsity_pattern.h.


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