]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Prefer SparsityPattern::empty() to ad hoc checks.
authorDavid Wells <wellsd2@rpi.edu>
Fri, 4 Nov 2016 22:44:49 +0000 (18:44 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Fri, 4 Nov 2016 22:44:49 +0000 (18:44 -0400)
source/lac/sparsity_pattern.cc

index 80fe41db7b36ea50a861c84f2c1401d990f36ea8..29388bf5017278599d0cc98eb1ca1230ae8330d0 100644 (file)
@@ -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."));
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.