]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
No longer allow to call Table::fill on empty tables.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 30 Sep 2002 14:06:31 +0000 (14:06 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 30 Sep 2002 14:06:31 +0000 (14:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@6556 0785d39b-7218-0410-832d-ea1e28bc413d

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

index d87f3f7b2bf20cd03c5436cf2661714051104dc1..f77f470c82df09343ec92f2628f373dcb3f38d5f 100644 (file)
@@ -805,7 +805,9 @@ class TableBase : public Subscriptor
                                       * @p{n_rows()*n_cols()}
                                       * elements, and that the layout
                                       * refers to the desired shape of
-                                      * this table.
+                                      * this table. The only check we
+                                      * do is that the present array
+                                      * is non-empty.
                                       *
                                       * Note also that the type of the
                                       * objects of the input array,
@@ -1914,8 +1916,9 @@ inline
 void
 TableBase<N,T>::clear ()
 {
-  if (val != 0)
-    std::fill_n (val, n_elements(), T());
+  Assert (size()[0]*size()[1] != 0,
+          ExcMessage("Trying to fill an empty matrix."));
+  std::fill_n (val, n_elements(), T());
 };
 
 

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.