From b44d369d8177abf7b318be74d01eb9d53ae89ee9 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 22 Feb 2006 04:30:53 +0000 Subject: [PATCH] Import the operator() that takes a TableIndices object from the base class also into the derived classes. git-svn-id: https://svn.dealii.org/trunk@12453 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/table.h | 276 +++++++++++++++++++++++++++++- deal.II/doc/news/changes.html | 12 ++ 2 files changed, 280 insertions(+), 8 deletions(-) diff --git a/deal.II/base/include/base/table.h b/deal.II/base/include/base/table.h index 13909f92ee..d510a44114 100644 --- a/deal.II/base/include/base/table.h +++ b/deal.II/base/include/base/table.h @@ -821,6 +821,24 @@ class Table<1,T> : public TableBase<1,T> */ T & operator () (const unsigned int i); + + /** + * Make the corresponding + * operator() from the TableBase + * base class available also in + * this class. + */ + T & + operator() (const TableIndices<1> &indices); + + /** + * Make the corresponding + * operator() from the TableBase + * base class available also in + * this class. + */ + const T & + operator() (const TableIndices<1> &indices) const; }; @@ -920,6 +938,24 @@ class Table<2,T> : public TableBase<2,T> T & operator () (const unsigned int i, const unsigned int j); + /** + * Make the corresponding + * operator() from the TableBase + * base class available also in + * this class. + */ + T & + operator() (const TableIndices<2> &indices); + + /** + * Make the corresponding + * operator() from the TableBase + * base class available also in + * this class. + */ + const T & + operator() (const TableIndices<2> &indices) const; + /** * Number of rows. This function @@ -1069,6 +1105,22 @@ class Table<3,T> : public TableBase<3,T> T & operator () (const unsigned int i, const unsigned int j, const unsigned int k); + + /** + * Make the corresponding + * operator() from the TableBase + * base class available also in + * this class. + */ + T & operator() (const TableIndices<3> &indices); + + /** + * Make the corresponding + * operator() from the TableBase + * base class available also in + * this class. + */ + const T & operator() (const TableIndices<3> &indices) const; }; @@ -1159,6 +1211,24 @@ class Table<4,T> : public TableBase<4,T> const unsigned int j, const unsigned int k, const unsigned int l); + + /** + * Make the corresponding + * operator() from the TableBase + * base class available also in + * this class. + */ + T & + operator() (const TableIndices<4> &indices); + + /** + * Make the corresponding + * operator() from the TableBase + * base class available also in + * this class. + */ + const T & + operator() (const TableIndices<4> &indices) const; }; @@ -1237,7 +1307,6 @@ class Table<5,T> : public TableBase<5,T> const unsigned int l, const unsigned int m) const; - /** * Direct access to one element * of the table by specifying all @@ -1252,6 +1321,24 @@ class Table<5,T> : public TableBase<5,T> const unsigned int k, const unsigned int l, const unsigned int m); + + /** + * Make the corresponding + * operator() from the TableBase + * base class available also in + * this class. + */ + T & + operator() (const TableIndices<5> &indices); + + /** + * Make the corresponding + * operator() from the TableBase + * base class available also in + * this class. + */ + const T & + operator() (const TableIndices<5> &indices) const; }; @@ -1330,8 +1417,7 @@ class Table<6,T> : public TableBase<6,T> const unsigned int k, const unsigned int l, const unsigned int m, - const unsigned int n) const; - + const unsigned int n) const; /** * Direct access to one element @@ -1348,6 +1434,24 @@ class Table<6,T> : public TableBase<6,T> const unsigned int l, const unsigned int m, const unsigned int n); + + /** + * Make the corresponding + * operator() from the TableBase + * base class available also in + * this class. + */ + T & + operator() (const TableIndices<6> &indices); + + /** + * Make the corresponding + * operator() from the TableBase + * base class available also in + * this class. + */ + const T & + operator() (const TableIndices<6> &indices) const; }; @@ -1427,8 +1531,7 @@ class Table<7,T> : public TableBase<7,T> const unsigned int l, const unsigned int m, const unsigned int n, - const unsigned int o) const; - + const unsigned int o) const; /** * Direct access to one element @@ -1446,6 +1549,24 @@ class Table<7,T> : public TableBase<7,T> const unsigned int m, const unsigned int n, const unsigned int o); + + /** + * Make the corresponding + * operator() from the TableBase + * base class available also in + * this class. + */ + T & + operator() (const TableIndices<7> &indices); + + /** + * Make the corresponding + * operator() from the TableBase + * base class available also in + * this class. + */ + const T & + operator() (const TableIndices<7> &indices) const; }; @@ -1505,7 +1626,6 @@ class TransposeTable : public TableBase<2,T> */ const T & operator () (const unsigned int i, const unsigned int j) const; - /** * Direct access to one element @@ -1518,7 +1638,6 @@ class TransposeTable : public TableBase<2,T> */ T & operator () (const unsigned int i, const unsigned int j); - /** * Number of rows. This function @@ -1976,6 +2095,7 @@ TableBase::memory_consumption () const } + template inline unsigned int @@ -2007,7 +2127,6 @@ TableBase::position (const TableIndices &indices) const - template inline const T & TableBase::operator() (const TableIndices &indices) const @@ -2120,6 +2239,26 @@ Table<1,T>::operator () (const unsigned int i) } + +template +inline +const T & +Table<1,T>::operator () (const TableIndices<1> &indices) const +{ + return TableBase<1,T>::operator() (indices); +} + + + +template +inline +T & +Table<1,T>::operator () (const TableIndices<1> &indices) +{ + return TableBase<1,T>::operator() (indices); +} + + //--------------------------------------------------------------------------- template @@ -2203,6 +2342,26 @@ Table<2,T>::operator () (const unsigned int i, +template +inline +const T & +Table<2,T>::operator () (const TableIndices<2> &indices) const +{ + return TableBase<2,T>::operator() (indices); +} + + + +template +inline +T & +Table<2,T>::operator () (const TableIndices<2> &indices) +{ + return TableBase<2,T>::operator() (indices); +} + + + template inline const T & @@ -2433,6 +2592,26 @@ Table<3,T>::operator () (const unsigned int i, +template +inline +const T & +Table<3,T>::operator () (const TableIndices<3> &indices) const +{ + return TableBase<3,T>::operator() (indices); +} + + + +template +inline +T & +Table<3,T>::operator () (const TableIndices<3> &indices) +{ + return TableBase<3,T>::operator() (indices); +} + + + template Table<4,T>::Table () {} @@ -2530,6 +2709,26 @@ Table<4,T>::operator () (const unsigned int i, +template +inline +const T & +Table<4,T>::operator () (const TableIndices<4> &indices) const +{ + return TableBase<4,T>::operator() (indices); +} + + + +template +inline +T & +Table<4,T>::operator () (const TableIndices<4> &indices) +{ + return TableBase<4,T>::operator() (indices); +} + + + template Table<5,T>::Table () @@ -2639,6 +2838,26 @@ Table<5,T>::operator () (const unsigned int i, +template +inline +const T & +Table<5,T>::operator () (const TableIndices<5> &indices) const +{ + return TableBase<5,T>::operator() (indices); +} + + + +template +inline +T & +Table<5,T>::operator () (const TableIndices<5> &indices) +{ + return TableBase<5,T>::operator() (indices); +} + + + template Table<6,T>::Table () {} @@ -2758,6 +2977,26 @@ Table<6,T>::operator () (const unsigned int i, +template +inline +const T & +Table<6,T>::operator () (const TableIndices<6> &indices) const +{ + return TableBase<6,T>::operator() (indices); +} + + + +template +inline +T & +Table<6,T>::operator () (const TableIndices<6> &indices) +{ + return TableBase<6,T>::operator() (indices); +} + + + template Table<7,T>::Table () {} @@ -2886,6 +3125,27 @@ Table<7,T>::operator () (const unsigned int i, *this->table_size[6] + o]; } + + +template +inline +const T & +Table<7,T>::operator () (const TableIndices<7> &indices) const +{ + return TableBase<7,T>::operator() (indices); +} + + + +template +inline +T & +Table<7,T>::operator () (const TableIndices<7> &indices) +{ + return TableBase<7,T>::operator() (indices); +} + + #endif // DOXYGEN #endif diff --git a/deal.II/doc/news/changes.html b/deal.II/doc/news/changes.html index 6b96d045ed..098e8b5203 100644 --- a/deal.II/doc/news/changes.html +++ b/deal.II/doc/news/changes.html @@ -247,6 +247,18 @@ inconvenience this causes.

base

    +
  1. Improved: The TableBase base class of all + the Table classes had an + operator() that takes a TableIndices object + that represents the entire set of indices at once. However, due to C++ + name lookup rules, this operator wasn't accessible through the + Table class without explicitly specifying the base class + name. This is now fixed by also providing a similar + operator() in the derived classes. +
    + (WB 2006/02/21) +

    +
  2. Fixed: The QGauss constructor hangs on x86 linux systems when deal.II is run from inside MATLAB. The reason is that while the processor offers long -- 2.39.5