]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Implement the TableIndices<N> and Table<N,T> classses for N=4,5 and 6.
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 24 Sep 2002 09:36:11 +0000 (09:36 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 24 Sep 2002 09:36:11 +0000 (09:36 +0000)
git-svn-id: https://svn.dealii.org/trunk@6497 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/table.h
deal.II/doc/news/2002/c-3-4.html

index b2f88f1f4068eace49ae3151b6530cab0fa87273..b6bd7c72594a95c03897a5c302c719adcf90e7ad 100644 (file)
@@ -164,6 +164,105 @@ class TableIndices<3> : public TableIndicesBase<3>
 };
 
 
+/**
+ * Array of indices of fixed size used for the @ref{TableBase}
+ * class.
+ *
+ * This is the specialization for a four-dimensional table. This class
+ * only differs in the non-default constructors from the other
+ * specializations. Actual storage of and access to data is done by
+ * the @ref{TableIndicesBase} base class of a specializations.
+ *
+ * @author Wolfgang Bangerth, Ralf Hartmann 2002
+ */
+template <>
+class TableIndices<4> : public TableIndicesBase<4>
+{
+  public:
+                                     /**
+                                      * Default constructor. Set all
+                                      * indices to zero.
+                                      */
+    TableIndices ();
+
+                                     /**
+                                      * Constructor. Set indices to
+                                      * the given values.
+                                      */
+    TableIndices (const unsigned int index1,
+                  const unsigned int index2,
+                  const unsigned int index3,
+                 const unsigned int index4);
+};
+
+
+/**
+ * Array of indices of fixed size used for the @ref{TableBase}
+ * class.
+ *
+ * This is the specialization for a five-dimensional table. This class
+ * only differs in the non-default constructors from the other
+ * specializations. Actual storage of and access to data is done by
+ * the @ref{TableIndicesBase} base class of a specializations.
+ *
+ * @author Wolfgang Bangerth, Ralf Hartmann 2002
+ */
+template <>
+class TableIndices<5> : public TableIndicesBase<5>
+{
+  public:
+                                     /**
+                                      * Default constructor. Set all
+                                      * indices to zero.
+                                      */
+    TableIndices ();
+
+                                     /**
+                                      * Constructor. Set indices to
+                                      * the given values.
+                                      */
+    TableIndices (const unsigned int index1,
+                  const unsigned int index2,
+                  const unsigned int index3,
+                 const unsigned int index4,
+                 const unsigned int index5);
+};
+
+
+/**
+ * Array of indices of fixed size used for the @ref{TableBase}
+ * class.
+ *
+ * This is the specialization for a four-dimensional table. This class
+ * only differs in the non-default constructors from the other
+ * specializations. Actual storage of and access to data is done by
+ * the @ref{TableIndicesBase} base class of a specializations.
+ *
+ * @author Wolfgang Bangerth, Ralf Hartmann 2002
+ */
+template <>
+class TableIndices<6> : public TableIndicesBase<6>
+{
+  public:
+                                     /**
+                                      * Default constructor. Set all
+                                      * indices to zero.
+                                      */
+    TableIndices ();
+
+                                     /**
+                                      * Constructor. Set indices to
+                                      * the given values.
+                                      */
+    TableIndices (const unsigned int index1,
+                  const unsigned int index2,
+                  const unsigned int index3,
+                 const unsigned int index4,
+                 const unsigned int index5,
+                 const unsigned int index6);
+};
+
+
 /**
  * Have a namespace in which we declare some classes that are used to
  * access the elements of tables using the @p{operator[]}. These are
@@ -1053,63 +1152,340 @@ class Table<3,T> : public TableBase<3,T>
 
 
 
-
-/* --------------------- Template and inline functions ---------------- */
-
-
-template <unsigned int N>
-inline
-unsigned int
-TableIndicesBase<N>::operator [] (const unsigned int i) const 
+/**
+ * A class representing a four-dimensional table of objects (not
+ * necessarily only numbers).
+ *
+ * For the rationale of this class, and a description of the
+ * interface, see the base class.
+ * 
+ * @author Wolfgang Bangerth, Ralf Hartmann 2002
+ */
+template <typename T>
+class Table<4,T> : public TableBase<4,T>
 {
-  return indices[i];
-};
-
-
+  public:
+                                     /**
+                                      * Default constructor. Set all
+                                      * dimensions to zero.
+                                      */
+    Table ();
 
-inline
-TableIndices<1>::TableIndices () 
-{
-  this->indices[0] = 0;
-};
+                                     /**
+                                      * Constructor. Pass down the
+                                      * given dimensions to the base
+                                      * class.
+                                      */
+    Table (const unsigned int size1,
+           const unsigned int size2,
+           const unsigned int size3,
+          const unsigned int size4);
+    
+                                     /**
+                                      * Access operator. Generate an
+                                      * object that accesses the
+                                      * requested two-dimensional
+                                      * subobject of this
+                                      * three-dimensional table. Range
+                                      * checks are performed.
+                                      *
+                                      * This version of the function
+                                      * only allows read access.
+                                      */
+    TableBaseAccessors::Accessor<4,T,true,3>
+    operator [] (const unsigned int i) const;
 
+                                     /**
+                                      * Access operator. Generate an
+                                      * object that accesses the
+                                      * requested two-dimensional
+                                      * subobject of this
+                                      * three-dimensional table. Range
+                                      * checks are performed.
+                                      *
+                                      * This version of the function
+                                      * allows read-write access.
+                                      */
+    TableBaseAccessors::Accessor<4,T,false,3>
+    operator [] (const unsigned int i);
 
+                                     /**
+                                      * Direct access to one element
+                                      * of the table by specifying all
+                                      * indices at the same time. Range
+                                      * checks are performed.
+                                      *
+                                      * This version of the function
+                                      * only allows read access.
+                                      */
+    const T & operator () (const unsigned int i,
+                           const unsigned int j,
+                           const unsigned int k,
+                          const unsigned int l) const;
+    
 
-inline
-TableIndices<1>::TableIndices (const unsigned int index1) 
-{
-  this->indices[0] = index1;
+                                     /**
+                                      * Direct access to one element
+                                      * of the table by specifying all
+                                      * indices at the same time. Range
+                                      * checks are performed.
+                                      *
+                                      * This version of the function
+                                      * allows read-write access.
+                                      */
+    T & operator () (const unsigned int i,
+                     const unsigned int j,
+                     const unsigned int k,
+                    const unsigned int l);
 };
 
 
 
-inline
-TableIndices<2>::TableIndices () 
+/**
+ * A class representing a five-dimensional table of objects (not
+ * necessarily only numbers).
+ *
+ * For the rationale of this class, and a description of the
+ * interface, see the base class.
+ * 
+ * @author Wolfgang Bangerth, Ralf Hartmann 2002
+ */
+template <typename T>
+class Table<5,T> : public TableBase<5,T>
 {
-  this->indices[0] = this->indices[1] = 0;
-};
-
+  public:
+                                     /**
+                                      * Default constructor. Set all
+                                      * dimensions to zero.
+                                      */
+    Table ();
 
+                                     /**
+                                      * Constructor. Pass down the
+                                      * given dimensions to the base
+                                      * class.
+                                      */
+    Table (const unsigned int size1,
+           const unsigned int size2,
+           const unsigned int size3,
+          const unsigned int size4,
+          const unsigned int size5);
 
-inline
-TableIndices<2>::TableIndices (const unsigned int index1,
-                               const unsigned int index2)
-{
-  this->indices[0] = index1;
-  this->indices[1] = index2;
-};
+                                     /**
+                                      * Access operator. Generate an
+                                      * object that accesses the
+                                      * requested two-dimensional
+                                      * subobject of this
+                                      * three-dimensional table. Range
+                                      * checks are performed.
+                                      *
+                                      * This version of the function
+                                      * only allows read access.
+                                      */
+    TableBaseAccessors::Accessor<5,T,true,4>
+    operator [] (const unsigned int i) const;
 
+                                     /**
+                                      * Access operator. Generate an
+                                      * object that accesses the
+                                      * requested two-dimensional
+                                      * subobject of this
+                                      * three-dimensional table. Range
+                                      * checks are performed.
+                                      *
+                                      * This version of the function
+                                      * allows read-write access.
+                                      */
+    TableBaseAccessors::Accessor<5,T,false,4>
+    operator [] (const unsigned int i);
 
+                                     /**
+                                      * Direct access to one element
+                                      * of the table by specifying all
+                                      * indices at the same time. Range
+                                      * checks are performed.
+                                      *
+                                      * This version of the function
+                                      * only allows read access.
+                                      */
+    const T & operator () (const unsigned int i,
+                           const unsigned int j,
+                           const unsigned int k,
+                          const unsigned int l,
+                          const unsigned int m) const;
+    
 
-inline
-TableIndices<3>::TableIndices () 
-{
-  this->indices[0] = this->indices[1] = this->indices[2] = 0;
+                                     /**
+                                      * Direct access to one element
+                                      * of the table by specifying all
+                                      * indices at the same time. Range
+                                      * checks are performed.
+                                      *
+                                      * This version of the function
+                                      * allows read-write access.
+                                      */
+    T & operator () (const unsigned int i,
+                     const unsigned int j,
+                     const unsigned int k,
+                    const unsigned int l,
+                    const unsigned int m);
 };
 
 
 
-inline
+/**
+ * A class representing a six-dimensional table of objects (not
+ * necessarily only numbers).
+ *
+ * For the rationale of this class, and a description of the
+ * interface, see the base class.
+ * 
+ * @author Wolfgang Bangerth, Ralf Hartmann 2002
+ */
+template <typename T>
+class Table<6,T> : public TableBase<6,T>
+{
+  public:
+                                     /**
+                                      * Default constructor. Set all
+                                      * dimensions to zero.
+                                      */
+    Table ();
+
+                                     /**
+                                      * Constructor. Pass down the
+                                      * given dimensions to the base
+                                      * class.
+                                      */
+    Table (const unsigned int size1,
+           const unsigned int size2,
+           const unsigned int size3,
+          const unsigned int size4,
+          const unsigned int size5,
+          const unsigned int size6);
+
+                                     /**
+                                      * Access operator. Generate an
+                                      * object that accesses the
+                                      * requested two-dimensional
+                                      * subobject of this
+                                      * three-dimensional table. Range
+                                      * checks are performed.
+                                      *
+                                      * This version of the function
+                                      * only allows read access.
+                                      */
+    TableBaseAccessors::Accessor<6,T,true,5>
+    operator [] (const unsigned int i) const;
+
+                                     /**
+                                      * Access operator. Generate an
+                                      * object that accesses the
+                                      * requested two-dimensional
+                                      * subobject of this
+                                      * three-dimensional table. Range
+                                      * checks are performed.
+                                      *
+                                      * This version of the function
+                                      * allows read-write access.
+                                      */
+    TableBaseAccessors::Accessor<6,T,false,5>
+    operator [] (const unsigned int i);
+
+                                     /**
+                                      * Direct access to one element
+                                      * of the table by specifying all
+                                      * indices at the same time. Range
+                                      * checks are performed.
+                                      *
+                                      * This version of the function
+                                      * only allows read access.
+                                      */
+    const T & operator () (const unsigned int i,
+                           const unsigned int j,
+                           const unsigned int k,
+                          const unsigned int l,
+                          const unsigned int m,
+                          const unsigned int n) const;
+    
+
+                                     /**
+                                      * Direct access to one element
+                                      * of the table by specifying all
+                                      * indices at the same time. Range
+                                      * checks are performed.
+                                      *
+                                      * This version of the function
+                                      * allows read-write access.
+                                      */
+    T & operator () (const unsigned int i,
+                     const unsigned int j,
+                     const unsigned int k,
+                    const unsigned int l,
+                    const unsigned int m,
+                    const unsigned int n);
+};
+
+
+
+
+
+/* --------------------- Template and inline functions ---------------- */
+
+
+template <unsigned int N>
+inline
+unsigned int
+TableIndicesBase<N>::operator [] (const unsigned int i) const 
+{
+  return indices[i];
+};
+
+
+
+inline
+TableIndices<1>::TableIndices () 
+{
+  this->indices[0] = 0;
+};
+
+
+
+inline
+TableIndices<1>::TableIndices (const unsigned int index1) 
+{
+  this->indices[0] = index1;
+};
+
+
+
+inline
+TableIndices<2>::TableIndices () 
+{
+  this->indices[0] = this->indices[1] = 0;
+};
+
+
+
+inline
+TableIndices<2>::TableIndices (const unsigned int index1,
+                               const unsigned int index2)
+{
+  this->indices[0] = index1;
+  this->indices[1] = index2;
+};
+
+
+
+inline
+TableIndices<3>::TableIndices () 
+{
+  this->indices[0] = this->indices[1] = this->indices[2] = 0;
+};
+
+
+
+inline
 TableIndices<3>::TableIndices (const unsigned int index1,
                                const unsigned int index2,
                                const unsigned int index3)
@@ -1120,6 +1496,78 @@ TableIndices<3>::TableIndices (const unsigned int index1,
 };
 
 
+inline
+TableIndices<4>::TableIndices () 
+{
+  this->indices[0] = this->indices[1] = this->indices[2] = this->indices[3] = 0;
+};
+
+
+
+inline
+TableIndices<4>::TableIndices (const unsigned int index1,
+                               const unsigned int index2,
+                               const unsigned int index3,
+                              const unsigned int index4)
+{
+  this->indices[0] = index1;
+  this->indices[1] = index2;
+  this->indices[2] = index3;
+  this->indices[3] = index4;
+};
+
+
+
+inline
+TableIndices<5>::TableIndices () 
+{
+  this->indices[0] = this->indices[1] = this->indices[2] = this->indices[3] = this->indices[4] = 0;
+};
+
+
+
+inline
+TableIndices<5>::TableIndices (const unsigned int index1,
+                               const unsigned int index2,
+                               const unsigned int index3,
+                              const unsigned int index4,
+                              const unsigned int index5)
+{
+  this->indices[0] = index1;
+  this->indices[1] = index2;
+  this->indices[2] = index3;
+  this->indices[3] = index4;
+  this->indices[4] = index5;
+};
+
+
+
+inline
+TableIndices<6>::TableIndices () 
+{
+  this->indices[0] = this->indices[1] = this->indices[2]
+                  = this->indices[3] = this->indices[4] = 0;
+};
+
+
+
+inline
+TableIndices<6>::TableIndices (const unsigned int index1,
+                               const unsigned int index2,
+                               const unsigned int index3,
+                              const unsigned int index4,
+                              const unsigned int index5,
+                              const unsigned int index6)
+{
+  this->indices[0] = index1;
+  this->indices[1] = index2;
+  this->indices[2] = index3;
+  this->indices[3] = index4;
+  this->indices[4] = index5;
+  this->indices[5] = index6;
+};
+
+
 
 template <unsigned int N, typename T>
 TableBase<N,T>::TableBase ()
@@ -1738,7 +2186,8 @@ Table<3,T>::operator () (const unsigned int i,
           ExcIndexRange (j, 0, this->table_size[1]));
   Assert (k < this->table_size[2],
           ExcIndexRange (k, 0, this->table_size[2]));
-  return this->val[(i*this->table_size[1]+j)*this->table_size[2] + k];
+  return this->val[(i*this->table_size[1]+j)
+                 *this->table_size[2] + k];
 };
 
 
@@ -1756,8 +2205,335 @@ Table<3,T>::operator () (const unsigned int i,
           ExcIndexRange (j, 0, this->table_size[1]));
   Assert (k < this->table_size[2],
           ExcIndexRange (k, 0, this->table_size[2]));
-  return this->val[(i*this->table_size[1]+j)*this->table_size[2] + k];
+  return this->val[(i*this->table_size[1]+j)
+                 *this->table_size[2] + k];
 };
 
 
+
+template <typename T>
+Table<4,T>::Table () 
+{};
+
+
+
+template <typename T>
+Table<4,T>::Table (const unsigned int size1,
+                   const unsigned int size2,
+                   const unsigned int size3,
+                  const unsigned int size4)
+                :
+                TableBase<4,T> (TableIndices<4> (size1, size2, size3, size4))
+{};
+
+
+
+template <typename T>
+inline
+TableBaseAccessors::Accessor<4,T,true,3>
+Table<4,T>::operator [] (const unsigned int i) const
+{
+  Assert (i < this->table_size[0],
+          ExcIndexRange (i, 0, this->table_size[0]));
+  const unsigned int subobject_size = this->table_size[1] *
+                                      this->table_size[2] *
+                                     this->table_size[3];
+  return (TableBaseAccessors::Accessor<4,T,true,3>
+          (*this,
+           this->val+i*subobject_size));
+};
+
+
+
+template <typename T>
+inline
+TableBaseAccessors::Accessor<4,T,false,3>
+Table<4,T>::operator [] (const unsigned int i)
+{
+  Assert (i < this->table_size[0],
+          ExcIndexRange (i, 0, this->table_size[0]));
+  const unsigned int subobject_size = this->table_size[1] *
+                                      this->table_size[2] *
+                                     this->table_size[3];
+  return (TableBaseAccessors::Accessor<4,T,false,3>
+          (*this,
+           this->val+i*subobject_size));
+};
+
+
+
+template <typename T>
+inline
+const T &
+Table<4,T>::operator () (const unsigned int i,
+                         const unsigned int j,
+                         const unsigned int k,
+                        const unsigned int l) const
+{
+  Assert (i < this->table_size[0],
+          ExcIndexRange (i, 0, this->table_size[0]));
+  Assert (j < this->table_size[1],
+          ExcIndexRange (j, 0, this->table_size[1]));
+  Assert (k < this->table_size[2],
+          ExcIndexRange (k, 0, this->table_size[2]));
+  Assert (l < this->table_size[3],
+          ExcIndexRange (l, 0, this->table_size[3]));
+  return this->val[((i*this->table_size[1]+j)
+                   *this->table_size[2] + k)
+                 *this->table_size[3] + l];
+};
+
+
+
+template <typename T>
+inline
+T &
+Table<4,T>::operator () (const unsigned int i,
+                         const unsigned int j,
+                         const unsigned int k,
+                        const unsigned int l)
+{
+  Assert (i < this->table_size[0],
+          ExcIndexRange (i, 0, this->table_size[0]));
+  Assert (j < this->table_size[1],
+          ExcIndexRange (j, 0, this->table_size[1]));
+  Assert (k < this->table_size[2],
+          ExcIndexRange (k, 0, this->table_size[2]));
+  Assert (l < this->table_size[3],
+          ExcIndexRange (l, 0, this->table_size[3]));
+  return this->val[((i*this->table_size[1]+j)
+                   *this->table_size[2] + k)
+                 *this->table_size[3] + l];
+};
+
+
+
+
+template <typename T>
+Table<5,T>::Table () 
+{};
+
+
+
+template <typename T>
+Table<5,T>::Table (const unsigned int size1,
+                   const unsigned int size2,
+                   const unsigned int size3,
+                  const unsigned int size4,
+                  const unsigned int size5)
+                :
+                TableBase<5,T> (TableIndices<5> (size1, size2, size3, size4, size5))
+{};
+
+
+
+template <typename T>
+inline
+TableBaseAccessors::Accessor<5,T,true,4>
+Table<5,T>::operator [] (const unsigned int i) const
+{
+  Assert (i < this->table_size[0],
+          ExcIndexRange (i, 0, this->table_size[0]));
+  const unsigned int subobject_size = this->table_size[1] *
+                                      this->table_size[2] *
+                                     this->table_size[3] *
+                                     this->table_size[4];
+  return (TableBaseAccessors::Accessor<5,T,true,4>
+          (*this,
+           this->val+i*subobject_size));
+};
+
+
+
+template <typename T>
+inline
+TableBaseAccessors::Accessor<5,T,false,4>
+Table<5,T>::operator [] (const unsigned int i)
+{
+  Assert (i < this->table_size[0],
+          ExcIndexRange (i, 0, this->table_size[0]));
+  const unsigned int subobject_size = this->table_size[1] *
+                                      this->table_size[2] *
+                                     this->table_size[3] *
+                                     this->table_size[4];
+  return (TableBaseAccessors::Accessor<5,T,false,4>
+          (*this,
+           this->val+i*subobject_size));
+};
+
+
+
+template <typename T>
+inline
+const T &
+Table<5,T>::operator () (const unsigned int i,
+                         const unsigned int j,
+                         const unsigned int k,
+                        const unsigned int l,
+                        const unsigned int m) const
+{
+  Assert (i < this->table_size[0],
+          ExcIndexRange (i, 0, this->table_size[0]));
+  Assert (j < this->table_size[1],
+          ExcIndexRange (j, 0, this->table_size[1]));
+  Assert (k < this->table_size[2],
+          ExcIndexRange (k, 0, this->table_size[2]));
+  Assert (l < this->table_size[3],
+          ExcIndexRange (l, 0, this->table_size[3]));
+  Assert (m < this->table_size[4],
+          ExcIndexRange (m, 0, this->table_size[4]));
+  return this->val[(((i*this->table_size[1]+j)
+                    *this->table_size[2] + k)
+                   *this->table_size[3] + l)
+                 *this->table_size[4] + m];
+};
+
+
+
+template <typename T>
+inline
+T &
+Table<5,T>::operator () (const unsigned int i,
+                         const unsigned int j,
+                         const unsigned int k,
+                        const unsigned int l,
+                        const unsigned int m)
+{
+  Assert (i < this->table_size[0],
+          ExcIndexRange (i, 0, this->table_size[0]));
+  Assert (j < this->table_size[1],
+          ExcIndexRange (j, 0, this->table_size[1]));
+  Assert (k < this->table_size[2],
+          ExcIndexRange (k, 0, this->table_size[2]));
+  Assert (l < this->table_size[3],
+          ExcIndexRange (l, 0, this->table_size[3]));
+  Assert (m < this->table_size[4],
+          ExcIndexRange (m, 0, this->table_size[4]));
+  return this->val[(((i*this->table_size[1]+j)
+                    *this->table_size[2] + k)
+                   *this->table_size[3] + l)
+                 *this->table_size[4] + m];
+};
+
+
+
+template <typename T>
+Table<6,T>::Table () 
+{};
+
+
+
+template <typename T>
+Table<6,T>::Table (const unsigned int size1,
+                   const unsigned int size2,
+                   const unsigned int size3,
+                  const unsigned int size4,
+                  const unsigned int size5,
+                  const unsigned int size6)
+                :
+                TableBase<6,T> (TableIndices<6> (size1, size2, size3, size4, size5, size6))
+{};
+
+
+
+template <typename T>
+inline
+TableBaseAccessors::Accessor<6,T,true,5>
+Table<6,T>::operator [] (const unsigned int i) const
+{
+  Assert (i < this->table_size[0],
+          ExcIndexRange (i, 0, this->table_size[0]));
+  const unsigned int subobject_size = this->table_size[1] *
+                                      this->table_size[2] *
+                                     this->table_size[3] *
+                                     this->table_size[4] *
+                                     this->table_size[5];
+  return (TableBaseAccessors::Accessor<6,T,true,5>
+          (*this,
+           this->val+i*subobject_size));
+};
+
+
+
+template <typename T>
+inline
+TableBaseAccessors::Accessor<6,T,false,5>
+Table<6,T>::operator [] (const unsigned int i)
+{
+  Assert (i < this->table_size[0],
+          ExcIndexRange (i, 0, this->table_size[0]));
+  const unsigned int subobject_size = this->table_size[1] *
+                                      this->table_size[2] *
+                                     this->table_size[3] *
+                                     this->table_size[4] *
+                                     this->table_size[5];
+  return (TableBaseAccessors::Accessor<6,T,false,5>
+          (*this,
+           this->val+i*subobject_size));
+};
+
+
+
+template <typename T>
+inline
+const T &
+Table<6,T>::operator () (const unsigned int i,
+                         const unsigned int j,
+                         const unsigned int k,
+                        const unsigned int l,
+                        const unsigned int m,
+                        const unsigned int n) const
+{
+  Assert (i < this->table_size[0],
+          ExcIndexRange (i, 0, this->table_size[0]));
+  Assert (j < this->table_size[1],
+          ExcIndexRange (j, 0, this->table_size[1]));
+  Assert (k < this->table_size[2],
+          ExcIndexRange (k, 0, this->table_size[2]));
+  Assert (l < this->table_size[3],
+          ExcIndexRange (l, 0, this->table_size[3]));
+  Assert (m < this->table_size[4],
+          ExcIndexRange (m, 0, this->table_size[4]));
+  Assert (n < this->table_size[5],
+          ExcIndexRange (n, 0, this->table_size[5]));
+  return this->val[((((i*this->table_size[1]+j)
+                     *this->table_size[2] + k)
+                    *this->table_size[3] + l)
+                   *this->table_size[4] + m)
+                 *this->table_size[5] + n];
+};
+
+
+
+template <typename T>
+inline
+T &
+Table<6,T>::operator () (const unsigned int i,
+                         const unsigned int j,
+                         const unsigned int k,
+                        const unsigned int l,
+                        const unsigned int m,
+                        const unsigned int n)
+{
+  Assert (i < this->table_size[0],
+          ExcIndexRange (i, 0, this->table_size[0]));
+  Assert (j < this->table_size[1],
+          ExcIndexRange (j, 0, this->table_size[1]));
+  Assert (k < this->table_size[2],
+          ExcIndexRange (k, 0, this->table_size[2]));
+  Assert (l < this->table_size[3],
+          ExcIndexRange (l, 0, this->table_size[3]));
+  Assert (m < this->table_size[4],
+          ExcIndexRange (m, 0, this->table_size[4]));
+  Assert (n < this->table_size[5],
+          ExcIndexRange (n, 0, this->table_size[5]));
+  return this->val[((((i*this->table_size[1]+j)
+                     *this->table_size[2] + k)
+                    *this->table_size[3] + l)
+                   *this->table_size[4] + m)
+                 *this->table_size[5] + n];
+};
+
+
+
 #endif
index b6b2595ab4c9e33257d52d144862cc4db58a8827..0ca6b512d015837189974bdc480d1d0e740e84e7 100644 (file)
@@ -143,6 +143,18 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
 <h3>base</h3>
 
 <ol>
+  <li> <p> New: The classes <code
+       class="class">TableIndices&lt;N&gt;</code> and <code
+       class="class">Table&lt;N,T&gt;</code> are now implemented also
+       for <code>N=4,5</code> and <code>6</code>. The <code
+       class="class">Table&lt;N,T&gt;</code> class represents an
+       <code>N</code>-dimensional array and might replace the
+       N-times-nested-use of the <code
+       class="class">std::vector</code> class.
+       <br>
+       (RH 2002/09/24)
+       </p>
+
   <li> <p> 
        New: The <code class="member">Threads::n_existing_threads</code>
        function returns the present number of existing threads, allowing an

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.