Classes | |
class | ExcInvalidIterator |
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 SparsityPattern * | sparsity_pattern |
unsigned int | a_row |
unsigned int | a_index |
Friends | |
class | Iterator |
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.
internals::SparsityPatternIterators::Accessor::Accessor | ( | const SparsityPattern * | matrix, | |
const unsigned int | row, | |||
const unsigned int | index | |||
) |
Constructor.
internals::SparsityPatternIterators::Accessor::Accessor | ( | const SparsityPattern * | matrix | ) |
Constructor. Construct the end accessor for the given sparsity pattern.
Row number of the element represented by this object. This function can only be called for entries for which is_valid_entry() is true.
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.
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 internals::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.
Comparison. True, if both iterators point to the same matrix position.
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 internals::SparsityPatternIterators::Accessor::advance | ( | ) | [protected] |
Move the accessor to the next nonzero entry in the matrix.
friend class Iterator [friend] |
Grant access to iterator class.
Reimplemented in internals::SparseMatrixIterators::Accessor< number, true >, and internals::SparseMatrixIterators::Accessor< number, false >.
const SparsityPattern* internals::SparsityPatternIterators::Accessor::sparsity_pattern [protected] |
The sparsity pattern we operate on accessed.
Current row number.
Current index in row.