39 #include "subscript.h"
45 #ifdef TNT_USE_REGIONS
90 BIASASSERT(
v_ != NULL);
91 BIASASSERT(
col_ != NULL);
111 #ifdef TNT_UNROLL_LOOPS
115 for (i=0; i<N4; i+=4)
123 for (i=N4; i< N; i++)
137 #ifdef TNT_UNROLL_LOOPS
141 for (i=0; i<N4; i+=4)
149 for (i=N4; i< N; i++)
164 if (
v_ == NULL) return ;
167 delete [] (
v_);
v_ = NULL;
207 std::istringstream ins(s);
252 #ifdef TNT_BOUNDS_CHECK
256 return (d==1) ?
m_ : ((d==2) ?
n_ : 0);
279 #ifdef TNT_BOUNDS_CHECK
281 BIASASSERT(i <=
m_) ;
290 #ifdef TNT_BOUNDS_CHECK
292 BIASASSERT(i <=
m_) ;
300 #ifdef TNT_USE_REGIONS
307 return Region(*
this, I,J);
310 const_Region
operator()(
const Index1D &I,
const Index1D &J)
const
312 return const_Region(*
this, I,J);
324 std::ostream& operator<<(std::ostream &s, const Fortran_Matrix<T> &A)
329 s << M <<
" " << N <<
"\n";
386 tmp(i,j) = A(i,j) + B(i,j);
406 tmp(i,j) = A(i,j) - B(i,j);
430 tmp(i,j) = A(i,j) * B(i,j);
459 #ifdef TNT_BOUNDS_CHECK
475 sum = sum + A(i,j) * B(j,k);
518 sum += *row_i * *col_k;
536 #ifdef TNT_BOUNDS_CHECK
550 sum = sum + A(i,j) * x(j);
573 const T* a = A.
begin();
577 for (t=res.
begin(); t < tend; t++, a++)
Matrix< T > transpose(const Matrix< T > &A)
Fortran_Matrix(const Fortran_Matrix< T > &A)
void initialize(Subscript M, Subscript N)
std::istream & operator>>(std::istream &s, Fortran_Matrix< T > &A)
Fortran_Matrix< T > operator-(const Fortran_Matrix< T > &A, const Fortran_Matrix< T > &B)
TNT_SUBSCRIPT_TYPE Subscript
Matrix< T > mult_element(const Matrix< T > &A, const Matrix< T > &B)
const T & const_reference
Matrix< T > matmult(const Matrix< T > &A, const Matrix< T > &B)
Fortran_Matrix< T > & operator=(const T &scalar)
reference operator()(Subscript i, Subscript j)
Fortran_Matrix(Subscript M, Subscript N, const T *v)
Fortran_Matrix< T > operator*(const Fortran_Matrix< T > &A, const Fortran_Matrix< T > &B)
Subscript num_cols() const
Subscript dim(Subscript d) const
Fortran_Matrix< T > operator+(const Fortran_Matrix< T > &A, const Fortran_Matrix< T > &B)
Fortran_Matrix(Subscript M, Subscript N, char *s)
Subscript num_rows() const
Fortran_Matrix< T > & newsize(Subscript M, Subscript N)
Fortran_Matrix< T > & operator=(const Fortran_Matrix< T > &A)