22 #ifndef TNT_FORTRAN_ARRAY2D_H
23 #define TNT_FORTRAN_ARRAY2D_H
28 #ifdef TNT_BOUNDS_CHECK
50 void copy_(T* p,
const T* q,
int len);
51 void set_(T* begin, T* end,
const T& val);
68 inline const T&
operator()(
int i,
int j)
const ;
69 inline int dim1()
const;
70 inline int dim2()
const;
85 m_(A.m_), n_(A.n_), data_(A.data_) {}
95 v_(m*n), m_(m), n_(n), data_(v_.begin())
103 m_(m), n_(n), data_(v_.begin()) {}
111 #ifdef TNT_BOUNDS_CHECK
118 return v_[ (j-1)*m_ + (i-1) ];
125 #ifdef TNT_BOUNDS_CHECK
132 return v_[ (j-1)*m_ + (i-1) ];
140 set_(data_, data_+m_*n_, a);
158 if (m_ == A.
m_ && n_ == A.
n_)
159 copy_(data_, A.
data_, m_*n_);
206 for (T* p=begin; p<end; p++)
Definition: tnt_fortran_array2d.h:39
Fortran_Array2D(const Fortran_Array2D &A)
Fortran_Array2D copy() const
Definition: tnt_fortran_array2d.h:145
~Fortran_Array2D()
Definition: tnt_fortran_array2d.h:193
T value_type
Definition: tnt_fortran_array2d.h:55
int dim1() const
Definition: tnt_fortran_array2d.h:186
Fortran_Array2D & inject(const Fortran_Array2D &A)
Definition: tnt_fortran_array2d.h:156
i_refvec< T > v_
Definition: tnt_fortran_array2d.h:43
Fortran_Array2D & operator=(const Fortran_Array2D &A)
int m_
Definition: tnt_fortran_array2d.h:44
T * data_
Definition: tnt_fortran_array2d.h:46
int dim2() const
Definition: tnt_fortran_array2d.h:189
Fortran_Array2D & operator=(const T &a)
Definition: tnt_fortran_array2d.h:138
T & operator()(int i, int j)
Definition: tnt_fortran_array2d.h:109
Fortran_Array2D & ref(const Fortran_Array2D &A)
Definition: tnt_fortran_array2d.h:167
void set_(T *begin, T *end, const T &val)
Definition: tnt_fortran_array2d.h:204
int n_
Definition: tnt_fortran_array2d.h:45
Fortran_Array2D()
Definition: tnt_fortran_array2d.h:80
void copy_(T *p, const T *q, int len)
Definition: tnt_fortran_array2d.h:212
int ref_count() const
Definition: tnt_fortran_array2d.h:198
Definition: tnt_i_refvec.h:56
Definition: tnt_array1d.h:36