Public Member Functions | Protected Member Functions | Protected Attributes | Friends

SparsityPatternIterators::Accessor Class Reference

Inheritance diagram for SparsityPatternIterators::Accessor:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Accessor (const SparsityPattern *matrix, const unsigned int row, const unsigned int index)
 Accessor (const SparsityPattern *matrix)
unsigned int row () const
unsigned int index () const
unsigned int column () const
bool is_valid_entry () const
bool operator== (const Accessor &) const
bool operator< (const Accessor &) const

Protected Member Functions

void advance ()

Protected Attributes

const SparsityPatternsparsity_pattern
unsigned int a_row
unsigned int a_index

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 allow read access to elements, providing their row and column number. It does not allow to modify the sparsity pattern itself.

Definition at line 105 of file sparsity_pattern.h.


Constructor & Destructor Documentation

SparsityPatternIterators::Accessor::Accessor ( const SparsityPattern matrix,
const unsigned int  row,
const unsigned int  index 
)

Constructor.

SparsityPatternIterators::Accessor::Accessor ( const SparsityPattern matrix )

Constructor. Construct the end accessor for the given sparsity pattern.


Member Function Documentation

unsigned int SparsityPatternIterators::Accessor::row (  ) const

Row number of the element represented by this object. This function can only be called for entries for which is_valid_entry() is true.

unsigned int SparsityPatternIterators::Accessor::index (  ) const

Index in row of the element represented by this object. This function can only be called for entries for which is_valid_entry() is true.

unsigned int SparsityPatternIterators::Accessor::column (  ) const

Column number of the element represented by this object. This function can only be called for entries for which is_valid_entry() is true.

bool SparsityPatternIterators::Accessor::is_valid_entry (  ) const [inline]

Return whether the sparsity pattern entry pointed to by this iterator is valid or not. Note that after compressing the sparsity pattern, all entries are valid. However, before compression, the sparsity pattern allocated some memory to be used while still adding new nonzero entries; if you create iterators in this phase of the sparsity pattern's lifetime, you will iterate over elements that are not valid. If this is so, then this function will return false.

bool SparsityPatternIterators::Accessor::operator== ( const Accessor  ) const

Comparison. True, if both iterators point to the same matrix position.

bool SparsityPatternIterators::Accessor::operator< ( const Accessor  ) const

Comparison operator. Result is true if either the first row number is smaller or if the row numbers are equal and the first index is smaller.

This function is only valid if both iterators point into the same sparsity pattern.

void SparsityPatternIterators::Accessor::advance (  ) [protected]

Move the accessor to the next nonzero entry in the matrix.


Friends And Related Function Documentation

friend class Iterator [friend]

Grant access to iterator class.

Reimplemented in SparseMatrixIterators::Accessor< number, true >, and SparseMatrixIterators::Accessor< number, false >.

Definition at line 218 of file sparsity_pattern.h.


Member Data Documentation

The sparsity pattern we operate on accessed.

Definition at line 197 of file sparsity_pattern.h.

Current row number.

Definition at line 202 of file sparsity_pattern.h.

Current index in row.

Definition at line 207 of file sparsity_pattern.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Fri Feb 3 2012 06:04:17 by doxygen 1.7.2