*/
std::size_t max_len;
+ /**
+ * Return the value of the <tt>index</tt>th entry in <tt>row</tt>. Here,
+ * <tt>index</tt> refers to the internal representation of the matrix, not
+ * the column. This is an internal function because it exposes the actual
+ * format in which data is stored -- be sure to understand what you are
+ * doing here.
+ */
+ number nth_entry_in_row (const unsigned int row,
+ const unsigned int index) const;
+
// make all other sparse matrices friends
template <typename somenumber> friend class SparseMatrix;
template <typename somenumber> friend class SparseLUDecomposition;
* To allow it calling private prepare_add() and prepare_set().
*/
template <typename> friend class BlockMatrixBase;
+
+ /**
+ * Also give access to internal details to the iterator/accessor
+ * classes.
+ */
+ template <typename,bool> friend class SparseMatrixIterators::Iterator;
+ template <typename,bool> friend class SparseMatrixIterators::Accessor;
};
/**
number
SparseMatrix<number>::raw_entry (const unsigned int row,
const unsigned int index) const
+{
+ // this is the (deprecated) public version of the
+ // nth_entry_in_row() function. this function will soon
+ // go away.
+ return nth_entry_in_row (row, index);
+}
+
+
+
+template <typename number>
+inline
+number
+SparseMatrix<number>::nth_entry_in_row (const unsigned int row,
+ const unsigned int index) const
{
Assert(row<cols->rows, ExcIndexRange(row,0,cols->rows));
Assert(index<cols->row_length(row),
number
Accessor<number, true>::value () const
{
- return matrix->raw_entry(a_row, a_index);
+ return matrix->nth_entry_in_row(a_row, a_index);
}
inline
Accessor<number, false>::Reference::operator number() const
{
- return accessor->matrix->raw_entry(accessor->a_row,
- accessor->a_index);
+ return accessor->matrix->nth_entry_in_row(accessor->a_row,
+ accessor->a_index);
}