21 #ifndef TNT_FORTRAN_ARRAY2D_UTILS_H
22 #define TNT_FORTRAN_ARRAY2D_UTILS_H
36 s << M <<
" " << N <<
"\n";
38 for (
int i=1; i<=M; i++)
40 for (
int j=1; j<=N; j++)
61 for (
int i=1; i<=M; i++)
62 for (
int j=1; j<=N; j++)
87 for (
int i=1; i<=m; i++)
89 for (
int j=1; j<=n; j++)
90 C(i,j) = A(i,j) + B(i,j);
102 if (B.
dim1() != m || B.
dim2() != n )
109 for (
int i=1; i<=m; i++)
111 for (
int j=1; j<=n; j++)
112 C(i,j) = A(i,j) - B(i,j);
125 if (B.
dim1() != m || B.
dim2() != n )
132 for (
int i=1; i<=m; i++)
134 for (
int j=1; j<=n; j++)
135 C(i,j) = A(i,j) * B(i,j);
148 if (B.
dim1() != m || B.
dim2() != n )
155 for (
int i=1; i<=m; i++)
157 for (
int j=1; j<=n; j++)
158 C(i,j) = A(i,j) / B(i,j);
172 if (B.
dim1() == m || B.
dim2() == n )
174 for (
int i=1; i<=m; i++)
176 for (
int j=1; j<=n; j++)
189 if (B.
dim1() == m || B.
dim2() == n )
191 for (
int i=1; i<=m; i++)
193 for (
int j=1; j<=n; j++)
206 if (B.
dim1() == m || B.
dim2() == n )
208 for (
int i=1; i<=m; i++)
210 for (
int j=1; j<=n; j++)
223 if (B.
dim1() == m || B.
dim2() == n )
225 for (
int i=1; i<=m; i++)
227 for (
int j=1; j<=n; j++)
Definition: tnt_fortran_array2d.h:39
int dim1() const
Definition: tnt_fortran_array2d.h:186
int dim2() const
Definition: tnt_fortran_array2d.h:189
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