From: wolf Date: Fri, 5 May 2000 16:00:27 +0000 (+0000) Subject: Add access to the individual blocks. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ffcba04de746487e2c47f5af9d8b82d6871f828;p=dealii-svn.git Add access to the individual blocks. git-svn-id: https://svn.dealii.org/trunk@2808 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/block_sparse_matrix.h b/deal.II/lac/include/lac/block_sparse_matrix.h index 9f4339b713..fad7bd4c61 100644 --- a/deal.II/lac/include/lac/block_sparse_matrix.h +++ b/deal.II/lac/include/lac/block_sparse_matrix.h @@ -107,6 +107,25 @@ class BlockSparseMatrix : public Subscriptor */ virtual void reinit (const BlockSparsityPattern &sparsity); + + /** + * Access the block with the + * given coordinates. + */ + SparseMatrix & + block (const unsigned int row, + const unsigned int column); + + + /** + * Access the block with the + * given coordinates. Version for + * constant objects. + */ + const SparseMatrix & + block (const unsigned int row, + const unsigned int column) const; + /** * Release all memory and return * to a state just like after @@ -316,6 +335,29 @@ BlockSparseMatrix::reinit (const BlockSparsityPattern +inline +SparseMatrix +BlockSparseMatrix::block (const unsigned int row, + const unsigned int column) +{ + return sub_objects[row][column]; +}; + + + +template +inline +const SparseMatrix & +BlockSparseMatrix::block (const unsigned int row, + const unsigned int column) const +{ + return sub_objects[row][column]; +}; + + + template void BlockSparseMatrix::clear ()