22 #ifndef TNT_FORTRAN_ARRAY3D_H
23 #define TNT_FORTRAN_ARRAY3D_H
27 #ifdef TNT_BOUNDS_CHECK
64 inline const T&
operator()(
int i,
int j,
int k)
const ;
65 inline int dim1()
const;
66 inline int dim2()
const;
67 inline int dim3()
const;
80 v_(A.v_), m_(A.m_), n_(A.n_), k_(A.k_), data_(A.data_) {}
86 v_(m*n*k), m_(m), n_(n), k_(k), data_(v_.begin()) {}
92 v_(m*n*k), m_(m), n_(n), k_(k), data_(v_.begin())
100 v_(a), m_(m), n_(n), k_(k), data_(v_.begin()) {}
108 #ifdef TNT_BOUNDS_CHECK
117 return data_[(k-1)*m_*n_ + (j-1) * m_ + i-1];
124 #ifdef TNT_BOUNDS_CHECK
133 return data_[(k-1)*m_*n_ + (j-1) * m_ + i-1];
141 T *end = data_ + m_*n_*k_;
143 for (T *p=data_; p != end; *p++ = a);
163 if (m_ == A.
m_ && n_ == A.
n_ && k_ == A.
k_)
166 T *end = data_ + m_*n_*k_;
167 const T* q = A.
data_;
168 for (; p < end; *p++ = *q++);
210 return v_.ref_count();
Definition: tnt_fortran_array3d.h:37
T & operator()(int i, int j, int k)
Definition: tnt_fortran_array3d.h:106
int dim3() const
Definition: tnt_fortran_array3d.h:204
T value_type
Definition: tnt_fortran_array3d.h:51
int k_
Definition: tnt_fortran_array3d.h:46
~Fortran_Array3D()
Definition: tnt_fortran_array3d.h:214
Fortran_Array3D & operator=(const T &a)
Definition: tnt_fortran_array3d.h:138
Fortran_Array3D & inject(const Fortran_Array3D &A)
Definition: tnt_fortran_array3d.h:160
int dim1() const
Definition: tnt_fortran_array3d.h:198
Fortran_Array3D copy() const
Definition: tnt_fortran_array3d.h:149
Fortran_Array3D & ref(const Fortran_Array3D &A)
Definition: tnt_fortran_array3d.h:177
Fortran_Array3D & operator=(const Fortran_Array3D &A)
Fortran_Array3D()
Definition: tnt_fortran_array3d.h:75
Fortran_Array3D(const Fortran_Array3D &A)
i_refvec< T > v_
Definition: tnt_fortran_array3d.h:43
int m_
Definition: tnt_fortran_array3d.h:44
T * data_
Definition: tnt_fortran_array3d.h:47
int dim2() const
Definition: tnt_fortran_array3d.h:201
int n_
Definition: tnt_fortran_array3d.h:45
int ref_count() const
Definition: tnt_fortran_array3d.h:208
Definition: tnt_i_refvec.h:56
Definition: tnt_array1d.h:36