const unsigned int row,
const unsigned int index);
+ /**
+ * Constructor. Construct the end
+ * accessor for the given matrix.
+ */
+ Accessor (MatrixType *matrix);
/**
* Copy constructor to get from a
const unsigned int row,
const unsigned int index);
+ /**
+ * Constructor. Construct the end
+ * accessor for the given matrix.
+ */
+ Accessor (MatrixType *matrix);
+
/**
* Value of this matrix entry,
* returned as a read- and writable
const unsigned int row,
const unsigned int index);
+ /**
+ * Constructor. Create the end
+ * iterator for the given matrix.
+ */
+ Iterator (MatrixType *matrix);
+
/**
* Conversion constructor to get from
* a non-const iterator to a const
+ template <typename number>
+ inline
+ Accessor<number,true>::
+ Accessor (const MatrixType *matrix)
+ :
+ SparsityPatternIterators::Accessor (&matrix->get_sparsity_pattern()),
+ matrix (matrix)
+ {}
+
+
+
template <typename number>
inline
Accessor<number,true>::
row, index),
matrix (matrix)
{}
-
+
+
+
+ template <typename number>
+ inline
+ Accessor<number,false>::
+ Accessor (MatrixType *matrix)
+ :
+ SparsityPatternIterators::Accessor (&matrix->get_sparsity_pattern()),
+ matrix (matrix)
+ {}
+
template <typename number>
+ template <typename number, bool Constness>
+ inline
+ Iterator<number, Constness>::
+ Iterator (MatrixType *matrix)
+ :
+ accessor(matrix)
+ {}
+
+
+
template <typename number, bool Constness>
inline
Iterator<number, Constness>::
typename SparseMatrix<number>::const_iterator
SparseMatrix<number>::end () const
{
- return const_iterator(this, m(), 0);
+ return const_iterator(this);
}
const unsigned int row,
const unsigned int index);
+ /**
+ * Constructor. Construct the end
+ * accessor for the given sparsity
+ * pattern.
+ */
+ Accessor (const SparsityPattern *matrix);
+
/**
* Row number of the element
- * represented by this
- * object. This
+ * represented by this object. This
* function can only be called for
- * entries for which is_valid_entry() is
- * true.
+ * entries for which is_valid_entry()
+ * is true.
*/
unsigned int row () const;
/**
* Index in row of the element
- * represented by this
- * object. This
+ * represented by this object. This
* function can only be called for
- * entries for which is_valid_entry() is
- * true.
+ * entries for which is_valid_entry()
+ * is true.
*/
unsigned int index () const;
{}
+ inline
+ Accessor::
+ Accessor (const SparsityPattern *sparsity_pattern)
+ :
+ sparsity_pattern(sparsity_pattern),
+ a_row(sparsity_pattern->n_rows()),
+ a_index(0)
+ {}
+
+
inline
unsigned int
Accessor::row() const