From: Guido Kanschat Date: Thu, 26 Jan 2006 11:15:05 +0000 (+0000) Subject: add a function setting a table to a constant value X-Git-Tag: v8.0.0~12498 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0eb3300292a2c3422d1d281ed0c9742681749544;p=dealii.git add a function setting a table to a constant value git-svn-id: https://svn.dealii.org/trunk@12177 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/table.h b/deal.II/base/include/base/table.h index 8b000a7f79..f208761e34 100644 --- a/deal.II/base/include/base/table.h +++ b/deal.II/base/include/base/table.h @@ -612,6 +612,15 @@ class TableBase : public Subscriptor */ template void fill (const T2 *entries); + + /** + * Fill all table entries with + * the same value. The type of + * value must be convertible to t + * he value type of the table. + */ + template + void fill (const T2& value); /** * Return a read-write reference @@ -1837,6 +1846,17 @@ TableBase::reset_values () } +template +template +void +TableBase::fill (const T2& value) +{ + if (n_elements() != 0) + std::fill_n(val, n_elements(), value); +} + + + template void