From: guido Date: Wed, 10 Jul 2002 10:35:33 +0000 (+0000) Subject: n_actually_nonzero_elements added to BlockSparseMatrix X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba780478186b83333e4d48f87f4f86c0395e06de;p=dealii-svn.git n_actually_nonzero_elements added to BlockSparseMatrix git-svn-id: https://svn.dealii.org/trunk@6243 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 4880083558..476f6245af 100644 --- a/deal.II/lac/include/lac/block_sparse_matrix.h +++ b/deal.II/lac/include/lac/block_sparse_matrix.h @@ -249,6 +249,14 @@ class BlockSparseMatrix : public Subscriptor * be zero, it is counted anyway. */ unsigned int n_nonzero_elements () const; + + /** + * Return the number of actually + * nonzero elements. Just counts + * the number of actually nonzero + * elements of all the blocks. + */ + unsigned int n_actually_nonzero_elements () const; /** * Set the element @p{(i,j)} to diff --git a/deal.II/lac/include/lac/block_sparse_matrix.templates.h b/deal.II/lac/include/lac/block_sparse_matrix.templates.h index 886dad110a..403ef71ea9 100644 --- a/deal.II/lac/include/lac/block_sparse_matrix.templates.h +++ b/deal.II/lac/include/lac/block_sparse_matrix.templates.h @@ -156,6 +156,19 @@ BlockSparseMatrix::n_nonzero_elements () const +template +unsigned int +BlockSparseMatrix::n_actually_nonzero_elements () const +{ + unsigned int count = 0; + for (unsigned int i=0; in_actually_nonzero_elements (); + return count; +}; + + + template const BlockSparsityPattern & BlockSparseMatrix::get_sparsity_pattern () const