45 template <
class MaTRiX>
52 const typename MaTRiX::element_type
zero_;
75 #ifdef TNT_BOUNDS_CHECK
77 BIASASSERT(i<=
A_.num_rows() +
lbound() - 1);
79 BIASASSERT(j<=
A_.num_cols() +
lbound() - 1);
90 #ifdef TNT_BOUNDS_CHECK
92 BIASASSERT(i<=
A_.num_rows() +
lbound() - 1);
94 BIASASSERT(j<=
A_.num_cols() +
lbound() - 1);
102 #ifdef TNT_USE_REGIONS
110 return const_Region(*
this, I, J);
116 return const_Region(*
this, i1, i2, j1, j2);
129 template <
class MaTRiX,
class VecToR>
135 BIASASSERT(N == x.dim());
138 typename MaTRiX::element_type sum=0.0;
144 for (i=start; i<=Mend; i++)
147 for (j=start; j<=i; j++)
148 sum = sum + A(i,j)*x(j);
155 template <
class MaTRiX,
class VecToR>
161 template <
class MaTRiX>
167 const typename MaTRiX::element_type
zero;
168 const typename MaTRiX::element_type
one;
190 #ifdef TNT_BOUNDS_CHECK
192 BIASASSERT(i<=
A_.dim(1));
194 BIASASSERT(j<=
A_.dim(2));
195 BIASASSERT(0<=i && i<
A_.dim(0) && 0<=j && j<
A_.dim(1));
208 #ifdef TNT_BOUNDS_CHECK
210 BIASASSERT(i<=
A_.dim(1));
212 BIASASSERT(j<=
A_.dim(2));
223 #ifdef TNT_USE_REGIONS
232 return const_Region(*
this, I, J);
238 return const_Region(*
this, i1, i2, j1, j2);
244 template <
class MaTRiX>
252 template <
class MaTRiX>
259 template <
class MaTRiX,
class VecToR>
265 BIASASSERT(N == x.dim());
268 typename MaTRiX::element_type sum=0.0;
274 for (i=start; i<=Mend; i++)
277 for (j=start; j<i; j++)
278 sum = sum + A(i,j)*x(j);
279 result(i) = sum + x(i);
285 template <
class MaTRiX,
class VecToR>
296 template <
class MaTRiX>
297 std::ostream& operator<<(std::ostream &s, const LowerTriangularView<MaTRiX>&A)
302 s << M <<
" " << N << endl;
317 template <
class MaTRiX>
324 s << M <<
" " << N << endl;
343 template <
class MaTRiX>
350 typename MaTRiX::element_type
zero_;
373 #ifdef TNT_BOUNDS_CHECK
375 BIASASSERT(i<=
A_.num_rows() +
lbound() - 1);
377 BIASASSERT(j<=
A_.num_cols() +
lbound() - 1);
388 #ifdef TNT_BOUNDS_CHECK
390 BIASASSERT(i<=
A_.num_rows() +
lbound() - 1);
392 BIASASSERT(j<=
A_.num_cols() +
lbound() - 1);
400 #ifdef TNT_USE_REGIONS
408 return const_Region(*
this, I, J);
414 return const_Region(*
this, i1, i2, j1, j2);
427 template <
class MaTRiX,
class VecToR>
433 BIASASSERT(N == x.dim());
436 typename VecToR::element_type sum=0.0;
442 for (i=start; i<=Mend; i++)
446 sum = sum + A(i,j)*x(j);
453 template <
class MaTRiX,
class VecToR>
459 template <
class MaTRiX>
465 const typename MaTRiX::element_type
zero;
466 const typename MaTRiX::element_type
one;
488 #ifdef TNT_BOUNDS_CHECK
490 BIASASSERT(i<=
A_.dim(1));
492 BIASASSERT(j<=
A_.dim(2));
493 BIASASSERT(0<=i && i<
A_.dim(0) && 0<=j && j<
A_.dim(1));
506 #ifdef TNT_BOUNDS_CHECK
508 BIASASSERT(i<=
A_.dim(1));
510 BIASASSERT(j<=
A_.dim(2));
521 #ifdef TNT_USE_REGIONS
530 return const_Region(*
this, I, J);
536 return const_Region(*
this, i1, i2, j1, j2);
542 template <
class MaTRiX>
550 template <
class MaTRiX>
557 template <
class MaTRiX,
class VecToR>
563 BIASASSERT(N == x.dim());
566 typename VecToR::element_type sum=0.0;
572 for (i=start; i<=Mend; i++)
575 for (j=i+1; j<=N; j++)
576 sum = sum + A(i,j)*x(j);
577 result(i) = sum + x(i);
583 template <
class MaTRiX,
class VecToR>
594 template <
class MaTRiX>
601 s << M <<
" " << N << endl;
616 template <
class MaTRiX>
623 s << M <<
" " << N << endl;
const_reference operator()(Subscript i, Subscript j) const
Subscript dim(Subscript d) const
Subscript dim(Subscript d) const
MaTRiX::const_reference const_reference
UnitLowerTriangularView< MaTRiX > Unit_lower_triangular_view(MaTRiX &A)
MaTRiX::element_type element_type
Subscript num_rows() const
const MaTRiX::element_type value_type
Subscript dim(Subscript d) const
MaTRiX::const_reference const_reference
MaTRiX::element_type value_type
MaTRiX::const_reference const_reference
Subscript num_cols() const
const MaTRiX::element_type one
Subscript num_cols() const
UnitUpperTriangularView< MaTRiX > Unit_upper_triangular_view(MaTRiX &A)
TNT_SUBSCRIPT_TYPE Subscript
ostream & operator<<(ostream &s, const Fortran_Sparse_Col_Matrix< T > &A)
const MaTRiX::element_type one
Matrix< T > matmult(const Matrix< T > &A, const Matrix< T > &B)
UnitLowerTriangularView(MaTRiX &A)
MaTRiX::element_type element_type
Fortran_Matrix< T > operator*(const Fortran_Matrix< T > &A, const Fortran_Matrix< T > &B)
UpperTriangularView< MaTRiX > Upper_triangular_view(MaTRiX &A)
const_reference operator()(Subscript i, Subscript j) const
Subscript num_rows() const
MaTRiX::element_type element_type
const MaTRiX::element_type zero
LowerTriangularView(MaTRiX &A)
MaTRiX::element_type value_type
MaTRiX::element_type value_type
const MaTRiX::element_type zero
Subscript dim(Subscript d) const
UpperTriangularView(MaTRiX &A)
Subscript num_cols() const
Subscript num_rows() const
Subscript num_rows() const
const MaTRiX::element_type element_type
const_reference operator()(Subscript i, Subscript j) const
Subscript num_cols() const
MaTRiX::element_type zero_
UnitUpperTriangularView(MaTRiX &A)
const_reference operator()(Subscript i, Subscript j) const
MaTRiX::const_reference const_reference
const MaTRiX::element_type zero_
LowerTriangularView< MaTRiX > Lower_triangular_view(MaTRiX &A)