From b573cce110de18b31bbf48657df61709af2fa93b Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 25 Jun 2001 15:27:37 +0000 Subject: [PATCH] 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 --- deal.II/lac/source/sparsity_pattern.cc | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) 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