From e645bc9280111b0dc0be07c2a191d1744c2fcc23 Mon Sep 17 00:00:00 2001 From: wolf Date: Fri, 5 May 2000 17:11:14 +0000 Subject: [PATCH] Add matrix_norm_square, get_sparsity_pattern git-svn-id: https://svn.dealii.org/trunk@2816 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/block_sparse_matrix.h | 54 ++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/deal.II/lac/include/lac/block_sparse_matrix.h b/deal.II/lac/include/lac/block_sparse_matrix.h index 9d40cafb81..0172d13705 100644 --- a/deal.II/lac/include/lac/block_sparse_matrix.h +++ b/deal.II/lac/include/lac/block_sparse_matrix.h @@ -326,7 +326,27 @@ class BlockSparseMatrix : public Subscriptor * be square for this operation. */ template - somenumber matrix_norm (const BlockVector &v) const; + somenumber matrix_norm_square (const BlockVector &v) const; + + /** + * Return a (constant) reference + * to the underlying sparsity + * pattern of this matrix. + * + * Though the return value is + * declared #const#, you should + * be aware that it may change if + * you call any nonconstant + * function of objects which + * operate on it. + */ + const BlockSparsityPattern & + get_sparsity_pattern () const; + + /** + * Exception + */ + DeclException0 (ExcMatrixNotBlockSquare); private: /** @@ -632,4 +652,36 @@ Tvmult_add (BlockVector &/*dst*/, +template +template +somenumber +BlockSparseMatrix:: +matrix_norm_square (const BlockVector &v) const +{ + Assert (rows == columns, ExcMatrixNotBlockSquare()); + + somenumber norm_sqr = 0; + for (unsigned int row=0; row +const BlockSparsityPattern & +BlockSparseMatrix::get_sparsity_pattern () const +{ + return *sparsity_pattern; +}; + + + + + #endif // __deal2__block_sparse_matrix_h -- 2.39.5