27 #ifdef TNT_BOUNDS_CHECK
56 Array3D(
int m,
int n,
int g, T val);
57 Array3D(
int m,
int n,
int g, T *a);
59 inline operator T***();
60 inline operator const T***();
69 inline const T*
const *
operator[](
int i)
const;
70 inline int dim1()
const;
71 inline int dim2()
const;
72 inline int dim3()
const;
87 v_(A.v_), m_(A.m_), n_(A.n_), g_(A.g_)
98 if (m>0 && n>0 && g>0)
103 for (
int i=0; i<
m_; i++)
106 for (
int j=0; j<n; j++)
107 v_[i][j] = ping + j*
g_;
116 v_(m,n), m_(m), n_(n), g_(g)
118 if (m>0 && n>0 && g>0)
124 for (
int i=0; i<
m_; i++)
127 for (
int j=0; j<n; j++)
128 v_[i][j] = ping + j*
g_;
137 data_(m*n*g, a), v_(m,n), m_(m), n_(n), g_(g)
140 if (m>0 && n>0 && g>0)
145 for (
int i=0; i<
m_; i++)
148 for (
int j=0; j<n; j++)
149 v_[i][j] = ping + j*
g_;
159 #ifdef TNT_BOUNDS_CHECK
175 for (
int i=0; i<m_; i++)
176 for (
int j=0; j<n_; j++)
177 for (
int k=0; k<g_; k++)
187 for (
int i=0; i<m_; i++)
188 for (
int j=0; j<n_; j++)
189 for (
int k=0; k<g_; k++)
190 A.
v_[i][j][k] = v_[i][j][k];
199 if (A.
m_ == m_ && A.
n_ == n_ && A.
g_ == g_)
201 for (
int i=0; i<m_; i++)
202 for (
int j=0; j<n_; j++)
203 for (
int k=0; k<g_; k++)
204 v_[i][j][k] = A.
v_[i][j][k];
262 int j1,
int k0,
int k1)
266 if (!( 0 <= i0 && i0 <= i1 && i1 < m_ &&
267 0 <= j0 && j0 <= j1 && j1 < n_ &&
268 0 <= k0 && k0 <= k1 && k1 < g_))
278 T* p = &(data_[0]) + i0*n_*g_ + j0*g_ + k0;
280 for (
int i=0; i<A.
m_; i++)
282 T* ping = p + i*n_*g_;
283 for (
int j=0; j<A.
n_; j++)
284 A.
v_[i][j] = ping + j*g_ ;
Definition: tnt_array1d.h:40
Definition: tnt_array3d.h:39
Array3D & inject(const Array3D &A)
Definition: tnt_array3d.h:197
Array3D & operator=(const Array3D &A)
int dim3() const
Definition: tnt_array3d.h:239
Array3D()
Definition: tnt_array3d.h:83
Array3D copy() const
Definition: tnt_array3d.h:184
T value_type
Definition: tnt_array3d.h:52
int dim1() const
Definition: tnt_array3d.h:233
Array3D & ref(const Array3D &A)
Definition: tnt_array3d.h:212
Array2D< T * > v_
Definition: tnt_array3d.h:44
int g_
Definition: tnt_array3d.h:47
T ** operator[](int i)
Definition: tnt_array3d.h:157
int ref_count()
Definition: tnt_array3d.h:77
Array3D & operator=(const T &a)
Definition: tnt_array3d.h:173
int m_
Definition: tnt_array3d.h:45
int dim2() const
Definition: tnt_array3d.h:236
Array3D subarray(int i0, int i1, int j0, int j1, int k0, int k1)
Definition: tnt_array3d.h:261
Array3D(const Array3D &A)
Array1D< T > data_
Definition: tnt_array3d.h:43
int n_
Definition: tnt_array3d.h:46
~Array3D()
Definition: tnt_array3d.h:244
Definition: tnt_array1d.h:36