]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
The assertion that filling empty matrices is not allowed, got applied
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 22 Oct 2002 13:47:03 +0000 (13:47 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 22 Oct 2002 13:47:03 +0000 (13:47 +0000)
to the clear instead of the fill function. Fix this.

git-svn-id: https://svn.dealii.org/trunk@6711 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/table.h

index 717be31055c4dae31b9c39b21773997403fd9c27..690e2f979955fa45ca9f27c02f2036a3708d6da2 100644 (file)
@@ -1925,9 +1925,8 @@ inline
 void
 TableBase<N,T>::clear ()
 {
-  Assert (n_elements() != 0,
-          ExcMessage("Trying to fill an empty matrix."));
-  std::fill_n (val, n_elements(), T());
+  if (n_elements() != 0)
+    std::fill_n (val, n_elements(), T());
 };
 
 
@@ -2014,8 +2013,10 @@ inline
 void
 TableBase<N,T>::fill (const T2* entries)
 {
-  if (val_size != 0)
-    std::copy (entries, entries+n_elements(), val);
+  Assert (n_elements() != 0,
+          ExcMessage("Trying to fill an empty matrix."));
+
+  std::copy (entries, entries+n_elements(), val);
 }
 
 

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.