21 #ifndef TNT_FORTRAN_ARRAY3D_UTILS_H
22 #define TNT_FORTRAN_ARRAY3D_UTILS_H
38 s << M <<
" " << N <<
" " << K <<
"\n";
40 for (
int i=1; i<=M; i++)
42 for (
int j=1; j<=N; j++)
44 for (
int k=1; k<=K; k++)
65 for (
int i=1; i<=M; i++)
66 for (
int j=1; j<=N; j++)
67 for (
int k=1; k<=K; k++)
89 for (
int i=1; i<=m; i++)
90 for (
int j=1; j<=n; j++)
91 for (
int k=1; k<=p; k++)
92 C(i,j,k) = A(i,j,k)+ B(i,j,k);
113 for (
int i=1; i<=m; i++)
114 for (
int j=1; j<=n; j++)
115 for (
int k=1; k<=p; k++)
116 C(i,j,k) = A(i,j,k)- B(i,j,k);
137 for (
int i=1; i<=m; i++)
138 for (
int j=1; j<=n; j++)
139 for (
int k=1; k<=p; k++)
140 C(i,j,k) = A(i,j,k)* B(i,j,k);
161 for (
int i=1; i<=m; i++)
162 for (
int j=1; j<=n; j++)
163 for (
int k=1; k<=p; k++)
164 C(i,j,k) = A(i,j,k)/ B(i,j,k);
180 for (
int i=1; i<=m; i++)
181 for (
int j=1; j<=n; j++)
182 for (
int k=1; k<=p; k++)
183 A(i,j,k) += B(i,j,k);
199 for (
int i=1; i<=m; i++)
200 for (
int j=1; j<=n; j++)
201 for (
int k=1; k<=p; k++)
202 A(i,j,k) -= B(i,j,k);
218 for (
int i=1; i<=m; i++)
219 for (
int j=1; j<=n; j++)
220 for (
int k=1; k<=p; k++)
221 A(i,j,k) *= B(i,j,k);
237 for (
int i=1; i<=m; i++)
238 for (
int j=1; j<=n; j++)
239 for (
int k=1; k<=p; k++)
240 A(i,j,k) /= B(i,j,k);
Definition: tnt_fortran_array3d.h:37
int dim3() const
Definition: tnt_fortran_array3d.h:204
int dim1() const
Definition: tnt_fortran_array3d.h:198
int dim2() const
Definition: tnt_fortran_array3d.h:201
Definition: tnt_array1d.h:36
Array1D< T > operator+(const Array1D< T > &A, const Array1D< T > &B)
Definition: tnt_array1d_utils.h:64
Array1D< T > & operator-=(Array1D< T > &A, const Array1D< T > &B)
Definition: tnt_array1d_utils.h:174
Array1D< T > & operator/=(Array1D< T > &A, const Array1D< T > &B)
Definition: tnt_array1d_utils.h:209
Array1D< T > operator*(const Array1D< T > &A, const Array1D< T > &B)
Definition: tnt_array1d_utils.h:107
Array1D< T > operator-(const Array1D< T > &A, const Array1D< T > &B)
Definition: tnt_array1d_utils.h:86
Array1D< T > & operator+=(Array1D< T > &A, const Array1D< T > &B)
Definition: tnt_array1d_utils.h:156
Array1D< T > & operator*=(Array1D< T > &A, const Array1D< T > &B)
Definition: tnt_array1d_utils.h:191
Array1D< T > operator/(const Array1D< T > &A, const Array1D< T > &B)
Definition: tnt_array1d_utils.h:128
std::ostream & operator<<(std::ostream &s, const Array1D< T > &A)
Definition: tnt_array1d_utils.h:31
std::istream & operator>>(std::istream &s, Array1D< T > &A)
Definition: tnt_array1d_utils.h:49