From: David Wells Date: Fri, 4 Nov 2016 22:44:49 +0000 (-0400) Subject: Prefer SparsityPattern::empty() to ad hoc checks. X-Git-Tag: v8.5.0-rc1~461^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f08c100f0381b07f17dc53b06f38cd6d124268e8;p=dealii.git Prefer SparsityPattern::empty() to ad hoc checks. --- 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."));