From: wolf Date: Mon, 25 Jun 2001 15:27:37 +0000 (+0000) Subject: Don't throw an error if reinit is called with all zero row X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d050671665c4942dc6fcb7837328c5f3a424ebaa;p=dealii-svn.git Don't throw an error if reinit is called with all zero row lengths. This case may happen for block matrices where some blocks are zero only. git-svn-id: https://svn.dealii.org/trunk@4753 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/source/sparsity_pattern.cc b/deal.II/lac/source/sparsity_pattern.cc index 6a1d1512d2..8eb682f67b 100644 --- a/deal.II/lac/source/sparsity_pattern.cc +++ b/deal.II/lac/source/sparsity_pattern.cc @@ -250,8 +250,6 @@ SparsityPattern::reinit (const unsigned int m, const unsigned int n, const std::vector &row_lengths) { - Assert (((m==0) && (n==0)) || (*max_element(row_lengths.begin(), row_lengths.end()) > 0), - ExcInvalidNumber(*max_element(row_lengths.begin(), row_lengths.end()))); Assert (row_lengths.size() == m, ExcInvalidNumber (m)); rows = m; @@ -285,6 +283,16 @@ SparsityPattern::reinit (const unsigned int m, for (unsigned int i=0; i