From: wolf Date: Tue, 22 Oct 2002 13:47:03 +0000 (+0000) Subject: The assertion that filling empty matrices is not allowed, got applied X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=087cdc14ee4d461a500ff47f51c2f86ec7c7d1a5;p=dealii-svn.git The assertion that filling empty matrices is not allowed, got applied to the clear instead of the fill function. Fix this. git-svn-id: https://svn.dealii.org/trunk@6711 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/table.h b/deal.II/base/include/base/table.h index 717be31055..690e2f9799 100644 --- a/deal.II/base/include/base/table.h +++ b/deal.II/base/include/base/table.h @@ -1925,9 +1925,8 @@ inline void TableBase::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::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); }