]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Import the operator() that takes a TableIndices object from the base class also into...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 22 Feb 2006 04:30:53 +0000 (04:30 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 22 Feb 2006 04:30:53 +0000 (04:30 +0000)
git-svn-id: https://svn.dealii.org/trunk@12453 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/table.h
deal.II/doc/news/changes.html

index 13909f92eeffaf8b1edfecbcb0f8cbcc7e03bdb7..d510a4411440bd54764f1c01b285b6bb501dfb65 100644 (file)
@@ -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<N,T>::memory_consumption () const
 }
 
 
+
 template <int N, typename T>
 inline
 unsigned int
@@ -2007,7 +2127,6 @@ TableBase<N,T>::position (const TableIndices<N> &indices) const
 
 
 
-
 template <int N, typename T>
 inline const T &
 TableBase<N,T>::operator() (const TableIndices<N> &indices) const
@@ -2120,6 +2239,26 @@ Table<1,T>::operator () (const unsigned int i)
 }
 
 
+
+template <typename T>
+inline
+const T &
+Table<1,T>::operator () (const TableIndices<1> &indices) const
+{
+  return TableBase<1,T>::operator() (indices);
+}
+
+
+
+template <typename T>
+inline
+T &
+Table<1,T>::operator () (const TableIndices<1> &indices)
+{
+  return TableBase<1,T>::operator() (indices);
+}
+
+
 //---------------------------------------------------------------------------
 
 template <typename T>
@@ -2203,6 +2342,26 @@ Table<2,T>::operator () (const unsigned int i,
 
 
 
+template <typename T>
+inline
+const T &
+Table<2,T>::operator () (const TableIndices<2> &indices) const
+{
+  return TableBase<2,T>::operator() (indices);
+}
+
+
+
+template <typename T>
+inline
+T &
+Table<2,T>::operator () (const TableIndices<2> &indices)
+{
+  return TableBase<2,T>::operator() (indices);
+}
+
+
+
 template <typename T>
 inline
 const T &
@@ -2433,6 +2592,26 @@ Table<3,T>::operator () (const unsigned int i,
 
 
 
+template <typename T>
+inline
+const T &
+Table<3,T>::operator () (const TableIndices<3> &indices) const
+{
+  return TableBase<3,T>::operator() (indices);
+}
+
+
+
+template <typename T>
+inline
+T &
+Table<3,T>::operator () (const TableIndices<3> &indices)
+{
+  return TableBase<3,T>::operator() (indices);
+}
+
+
+
 template <typename T>
 Table<4,T>::Table ()
 {}
@@ -2530,6 +2709,26 @@ Table<4,T>::operator () (const unsigned int i,
 
 
 
+template <typename T>
+inline
+const T &
+Table<4,T>::operator () (const TableIndices<4> &indices) const
+{
+  return TableBase<4,T>::operator() (indices);
+}
+
+
+
+template <typename T>
+inline
+T &
+Table<4,T>::operator () (const TableIndices<4> &indices)
+{
+  return TableBase<4,T>::operator() (indices);
+}
+
+
+
 
 template <typename T>
 Table<5,T>::Table ()
@@ -2639,6 +2838,26 @@ Table<5,T>::operator () (const unsigned int i,
 
 
 
+template <typename T>
+inline
+const T &
+Table<5,T>::operator () (const TableIndices<5> &indices) const
+{
+  return TableBase<5,T>::operator() (indices);
+}
+
+
+
+template <typename T>
+inline
+T &
+Table<5,T>::operator () (const TableIndices<5> &indices)
+{
+  return TableBase<5,T>::operator() (indices);
+}
+
+
+
 template <typename T>
 Table<6,T>::Table ()
 {}
@@ -2758,6 +2977,26 @@ Table<6,T>::operator () (const unsigned int i,
 
 
 
+template <typename T>
+inline
+const T &
+Table<6,T>::operator () (const TableIndices<6> &indices) const
+{
+  return TableBase<6,T>::operator() (indices);
+}
+
+
+
+template <typename T>
+inline
+T &
+Table<6,T>::operator () (const TableIndices<6> &indices)
+{
+  return TableBase<6,T>::operator() (indices);
+}
+
+
+
 template <typename T>
 Table<7,T>::Table ()
 {}
@@ -2886,6 +3125,27 @@ Table<7,T>::operator () (const unsigned int i,
                   *this->table_size[6] + o];
 }
 
+
+
+template <typename T>
+inline
+const T &
+Table<7,T>::operator () (const TableIndices<7> &indices) const
+{
+  return TableBase<7,T>::operator() (indices);
+}
+
+
+
+template <typename T>
+inline
+T &
+Table<7,T>::operator () (const TableIndices<7> &indices)
+{
+  return TableBase<7,T>::operator() (indices);
+}
+
+
 #endif // DOXYGEN
 
 #endif
index 6b96d045ed41307b361fde52cd68a460da96f3e9..098e8b5203dd2089460c60cdaf96b565ad01a487 100644 (file)
@@ -247,6 +247,18 @@ inconvenience this causes.
 <h3>base</h3>
 
 <ol>
+  <li> <p>Improved: The <code class="member">TableBase</code> base class of all
+       the <code class="member">Table</code> classes had an
+       <code>operator()</code> that takes a <code>TableIndices</code> object
+       that represents the entire set of indices at once. However, due to C++
+       name lookup rules, this operator wasn't accessible through the
+       <code>Table</code> class without explicitly specifying the base class
+       name. This is now fixed by also providing a similar
+       <code>operator()</code> in the derived classes.
+       <br>
+       (WB 2006/02/21)
+       </p>
+
   <li> <p>Fixed: The <code class="member">QGauss</code> constructor
        hangs on x86 linux systems when deal.II is run from inside
        MATLAB. The reason is that while the processor offers long

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.