From: Wolfgang Bangerth 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-Tag: v8.0.0~19041 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b573cce110de18b31bbf48657df61709af2fa93b;p=dealii.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