Main Page Namespace List Compound List File List Namespace Members Compound Members File Members

# tnt_array3d.h

Go to the documentation of this file.

    00001 /*
    00002 *
    00003 * Template Numerical Toolkit (TNT): Three-dimensional numerical array
    00004 *
    00005 * Mathematical and Computational Sciences Division
    00006 * National Institute of Technology,
    00007 * Gaithersburg, MD USA
    00008 *
    00009 *
    00010 * This software was developed at the National Institute of Standards and
    00011 * Technology (NIST) by employees of the Federal Government in the course
    00012 * of their official duties. Pursuant to title 17 Section 105 of the
    00013 * United States Code, this software is not subject to copyright protection
    00014 * and is in the public domain. NIST assumes no responsibility whatsoever for
    00015 * its use by other parties, and makes no guarantees, expressed or implied,
    00016 * about its quality, reliability, or any other characteristic.
    00017 *
    00018 */
    00019
    00020
    00021
    00022 #ifndef TNT_ARRAY3D_H
    00023 #define TNT_ARRAY3D_H
    00024
    00025 #include <cstdlib>
    00026 #include <iostream>
    00027 #ifdef TNT_BOUNDS_CHECK
    00028 #include <assert.h>
    00029 #endif
    00030
    00031 namespace TNT
    00032 {
    00033
    00059 template <class T>
    00060 class Array3D
    00061 {
    00062
    00063
    00064   private:
    00065
    00066   public:
    00067
    00068     typedef         T   value_type;
    00069
    00070                Array3D();
    00071                Array3D(int m, int n, int k);
    00072                Array3D(int m, int n, int k,  T *a);
    00073                Array3D(int m, int n, int k, const T &a);
    00074     inline Array3D(const Array3D &A);
    00075         inline Array3D & operator=(const T &a);
    00076         inline Array3D & operator=(const Array3D &A);
    00077         inline Array3D & ref(const Array3D &A);
    00078                Array3D copy() const;
    00079                    Array3D & inject(const Array3D & A);
    00080         inline T** operator[](int i);
    00081         inline const T* const * operator[](int i) const;
    00082         inline int dim1() const;
    00083         inline int dim2() const;
    00084         inline int dim3() const;
    00085                ~Array3D();
    00086
    00087
    00088 };
    00089
    00093 template <class T>
    00094 Array3D<T>::Array3D();
    00095
    00096
    00103 template <class T>
    00104 Array3D<T>::Array3D(const Array3D<T> &A);
    00105
    00106
    00107
    00120 template <class T>
    00121 Array3D<T>::Array3D(int m, int n, int k);
    00122
    00123
    00124
    00135 template <class T>
    00136 Array3D<T>::Array3D(int m, int n, int k, const T &val);
    00137
    00152 template <class T>
    00153 Array3D<T>::Array3D(int m, int n, int k, T *a) ;
    00154
    00155
    00165 template <class T>
    00166 inline T** Array3D<T>::operator[](int i) ;
    00167
    00168 template <class T>
    00169 inline const T* const * Array3D<T>::operator[](int i) const;
    00170
    00174 template <class T>
    00175 Array3D<T> & Array3D<T>::operator=(const T &a);
    00176
    00177
    00184 template <class T>
    00185 Array3D<T> Array3D<T>::copy() const;
    00186
    00187
    00211 template <class T>
    00212 Array3D<T> & Array3D<T>::inject(const Array3D &A);
    00213
    00214
    00215
    00216
    00227 template <class T>
    00228 Array3D<T> & Array3D<T>::ref(const Array3D<T> &A);
    00229
    00230
    00234 template <class T>
    00235 Array3D<T> & Array3D<T>::operator=(const Array3D<T> &A);
    00236
    00240 template <class T>
    00241 inline int Array3D<T>::dim1() const ;
    00242
    00246 template <class T>
    00247 inline int Array3D<T>::dim2() const ;
    00248
    00252 template <class T>
    00253 inline int Array3D<T>::dim3() const ;
    00254
    00255
    00256
    00257 template <class T>
    00258 Array3D<T>::~Array3D()
    00259
    00260
    00261 } /* namespace TNT */
    00262
    00263 #endif
    00264 /* TNT_ARRAY3D_H */
    00265