From: wolf Date: Mon, 30 Sep 2002 14:06:31 +0000 (+0000) Subject: No longer allow to call Table::fill on empty tables. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce21006e793ba940e90551328230044c6942b9f4;p=dealii-svn.git No longer allow to call Table::fill on empty tables. git-svn-id: https://svn.dealii.org/trunk@6556 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/table.h b/deal.II/base/include/base/table.h index d87f3f7b2b..f77f470c82 100644 --- a/deal.II/base/include/base/table.h +++ b/deal.II/base/include/base/table.h @@ -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::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()); };