From f08c100f0381b07f17dc53b06f38cd6d124268e8 Mon Sep 17 00:00:00 2001 From: David Wells Date: Fri, 4 Nov 2016 18:44:49 -0400 Subject: [PATCH] Prefer SparsityPattern::empty() to ad hoc checks. --- source/lac/sparsity_pattern.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/lac/sparsity_pattern.cc b/source/lac/sparsity_pattern.cc index 80fe41db7b..29388bf501 100644 --- a/source/lac/sparsity_pattern.cc +++ b/source/lac/sparsity_pattern.cc @@ -62,7 +62,7 @@ SparsityPattern::SparsityPattern (const SparsityPattern &s) store_diagonal_first_in_row(false) { (void)s; - Assert (s.rows==0 && s.cols==0 && s.rowstart==0 && s.colnums==0, + Assert (s.empty(), ExcMessage("This constructor can only be called if the provided argument " "is the sparsity pattern for an empty matrix. This constructor can " "not be used to copy-construct a non-empty sparsity pattern.")); @@ -226,12 +226,12 @@ SparsityPattern & SparsityPattern::operator = (const SparsityPattern &s) { (void)s; - Assert (s.rows==0 && s.cols==0 && s.rowstart==0 && s.colnums==0, + Assert (s.empty(), ExcMessage("This operator can only be called if the provided argument " "is the sparsity pattern for an empty matrix. This operator can " "not be used to copy a non-empty sparsity pattern.")); - Assert (rows==0 && cols==0 && rowstart==0 && cols==0, + Assert (this->empty(), ExcMessage("This operator can only be called if the current object is " "empty.")); -- 2.39.5