From 4907212e85e0d8c909bc7b2bc72f008fe75783b3 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 5 May 2000 16:00:27 +0000 Subject: [PATCH] Add access to the individual blocks. git-svn-id: https://svn.dealii.org/trunk@2808 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/block_sparse_matrix.h | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) 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 () -- 2.39.5