35 #ifndef _BLAZE_MATH_EXPRESSIONS_TSMATDMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TSMATDMATMULTEXPR_H_
128 template<
typename MT1
130 class TSMatDMatMultExpr :
public DenseMatrix< TSMatDMatMultExpr<MT1,MT2>, true >
131 ,
private MatMatMultExpr
132 ,
private Computation
161 template<
typename T1,
typename T2,
typename T3 >
162 struct CanExploitSymmetry {
163 enum { value = IsSymmetric<T2>::value };
174 template<
typename T1,
typename T2,
typename T3 >
175 struct IsEvaluationRequired {
176 enum { value = ( evaluateLeft || evaluateRight ) &&
177 !CanExploitSymmetry<T1,T2,T3>::value };
188 template<
typename T1,
typename T2,
typename T3 >
189 struct UseOptimizedKernel {
191 !IsDiagonal<T3>::value &&
192 !IsResizable<typename T1::ElementType>::value &&
193 !IsResizable<ET1>::value };
203 template<
typename T1,
typename T2,
typename T3 >
204 struct UseDefaultKernel {
205 enum { value = !UseOptimizedKernel<T1,T2,T3>::value };
235 enum { vectorizable = 0 };
238 enum { smpAssignable = !evaluateLeft && MT1::smpAssignable &&
239 !evaluateRight && MT2::smpAssignable };
282 :(
lhs_.columns() ) ) );
284 if(
lhs_.columns() == 0UL ||
288 ElementType tmp(
lhs_(i,kbegin) *
rhs_(kbegin,j) );
289 for(
size_t k=kbegin+1UL; k<kend; ++k ) {
305 inline ReturnType
at(
size_t i,
size_t j )
const {
306 if( i >=
lhs_.rows() ) {
309 if( j >=
rhs_.columns() ) {
332 return rhs_.columns();
362 template<
typename T >
364 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
374 template<
typename T >
376 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
386 return rhs_.isAligned();
396 return (
columns() > SMP_TSMATDMATMULT_THRESHOLD );
419 template<
typename MT
429 LT A(
serial( rhs.lhs_ ) );
430 RT B(
serial( rhs.rhs_ ) );
439 TSMatDMatMultExpr::selectAssignKernel( ~lhs, A, B );
455 template<
typename MT3
458 static inline void selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
460 const size_t size( C.rows() * C.columns() );
464 selectSmallAssignKernel( C, A, B );
466 selectLargeAssignKernel( C, A, B );
486 template<
typename MT3
489 static inline void selectDefaultAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
495 if( IsDiagonal<MT5>::value )
497 for(
size_t i=0UL; i<A.columns(); ++i )
499 const ConstIterator
end( A.end(i) );
500 ConstIterator element( A.begin(i) );
502 for( ; element!=
end; ++element ) {
503 C(element->index(),i) = element->value() * B(i,i);
509 const size_t block( IsRowMajorMatrix<MT3>::value ? 256UL : 8UL );
511 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
513 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
515 for(
size_t i=0UL; i<A.columns(); ++i )
517 const ConstIterator
end( A.end(i) );
518 ConstIterator element( A.begin(i) );
520 const size_t jbegin( ( IsUpper<MT5>::value )
521 ?(
max( IsStrictlyUpper<MT5>::value ? i+1UL : i, jj ) )
523 const size_t jend( ( IsLower<MT5>::value )
524 ?(
min( IsStrictlyLower<MT5>::value ? i : i+1UL, jpos ) )
530 for( ; element!=
end; ++element ) {
531 for(
size_t j=jbegin; j<jend; ++j ) {
533 C(element->index(),j) = element->value() * B(i,j);
535 C(element->index(),j) += element->value() * B(i,j);
559 template<
typename MT3
562 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
563 selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
565 selectDefaultAssignKernel( C, A, B );
585 template<
typename MT3
588 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
589 selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
593 const size_t block( ( IsRowMajorMatrix<MT3>::value )?( 256UL ):( 8UL ) );
597 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
599 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
601 for(
size_t i=0UL; i<A.columns(); ++i )
603 const size_t jbegin( ( IsUpper<MT5>::value )
604 ?(
max( IsStrictlyUpper<MT5>::value ? i+1UL : i, jj ) )
606 const size_t jend( ( IsLower<MT5>::value )
607 ?(
min( IsStrictlyLower<MT5>::value ? i : i+1UL, jpos ) )
613 const ConstIterator
end( A.end(i) );
614 ConstIterator element( A.begin(i) );
616 const size_t nonzeros( A.nonZeros(i) );
617 const size_t kpos( nonzeros &
size_t(-4) );
620 for(
size_t k=0UL; k<kpos; k+=4UL )
622 const size_t i1( element->index() );
623 const ET1 v1( element->value() );
625 const size_t i2( element->index() );
626 const ET1 v2( element->value() );
628 const size_t i3( element->index() );
629 const ET1 v3( element->value() );
631 const size_t i4( element->index() );
632 const ET1 v4( element->value() );
637 for(
size_t j=jbegin; j<jend; ++j ) {
638 C(i1,j) += v1 * B(i,j);
639 C(i2,j) += v2 * B(i,j);
640 C(i3,j) += v3 * B(i,j);
641 C(i4,j) += v4 * B(i,j);
645 for( ; element!=
end; ++element ) {
646 for(
size_t j=jbegin; j<jend; ++j ) {
647 C(element->index(),j) += element->value() * B(i,j);
670 template<
typename MT3
673 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
674 selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
676 selectDefaultAssignKernel( C, A, B );
696 template<
typename MT3
699 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
700 selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
705 assign( C, tmp * B );
723 template<
typename MT
725 friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
730 typedef typename SelectType< SO, ResultType, OppositeType >::Type TmpType;
742 const TmpType tmp(
serial( rhs ) );
763 template<
typename MT
765 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
775 assign( ~lhs,
trans( rhs.lhs_ ) * rhs.rhs_ );
793 template<
typename MT
795 friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
803 LT A(
serial( rhs.lhs_ ) );
804 RT B(
serial( rhs.rhs_ ) );
813 TSMatDMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
829 template<
typename MT3
832 static inline void selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
834 const size_t size( C.rows() * C.columns() );
836 if( ( IsRowMajorMatrix<MT3>::value &&
size < TSMATDMATMULT_THRESHOLD ) ||
837 ( IsColumnMajorMatrix<MT3>::value &&
size < 625UL ) )
838 selectSmallAddAssignKernel( C, A, B );
840 selectLargeAddAssignKernel( C, A, B );
860 template<
typename MT3
863 static inline void selectDefaultAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
867 if( IsDiagonal<MT5>::value )
869 for(
size_t i=0UL; i<A.columns(); ++i )
871 const ConstIterator
end( A.end(i) );
872 ConstIterator element( A.begin(i) );
874 for( ; element!=
end; ++element ) {
875 C(element->index(),i) += element->value() * B(i,i);
881 const size_t block( IsRowMajorMatrix<MT3>::value ? 256UL : 8UL );
883 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
885 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
887 for(
size_t i=0UL; i<A.columns(); ++i )
889 const ConstIterator
end( A.end(i) );
890 ConstIterator element( A.begin(i) );
892 const size_t jbegin( ( IsUpper<MT5>::value )
893 ?(
max( IsStrictlyUpper<MT5>::value ? i+1UL : i, jj ) )
895 const size_t jend( ( IsLower<MT5>::value )
896 ?(
min( IsStrictlyLower<MT5>::value ? i : i+1UL, jpos ) )
902 for( ; element!=
end; ++element ) {
903 for(
size_t j=jbegin; j<jend; ++j ) {
904 C(element->index(),j) += element->value() * B(i,j);
928 template<
typename MT3
931 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
932 selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
934 selectDefaultAddAssignKernel( C, A, B );
954 template<
typename MT3
957 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
958 selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
962 const size_t block( ( IsRowMajorMatrix<MT3>::value )?( 256UL ):( 8UL ) );
964 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
966 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
968 for(
size_t i=0UL; i<A.columns(); ++i )
970 const size_t jbegin( ( IsUpper<MT5>::value )
971 ?(
max( IsStrictlyUpper<MT5>::value ? i+1UL : i, jj ) )
973 const size_t jend( ( IsLower<MT5>::value )
974 ?(
min( IsStrictlyLower<MT5>::value ? i : i+1UL, jpos ) )
980 const ConstIterator
end( A.end(i) );
981 ConstIterator element( A.begin(i) );
983 const size_t nonzeros( A.nonZeros(i) );
984 const size_t kpos( nonzeros &
size_t(-4) );
987 for(
size_t k=0UL; k<kpos; k+=4UL )
989 const size_t i1( element->index() );
990 const ET1 v1( element->value() );
992 const size_t i2( element->index() );
993 const ET1 v2( element->value() );
995 const size_t i3( element->index() );
996 const ET1 v3( element->value() );
998 const size_t i4( element->index() );
999 const ET1 v4( element->value() );
1004 for(
size_t j=jbegin; j<jend; ++j ) {
1005 C(i1,j) += v1 * B(i,j);
1006 C(i2,j) += v2 * B(i,j);
1007 C(i3,j) += v3 * B(i,j);
1008 C(i4,j) += v4 * B(i,j);
1012 for( ; element!=
end; ++element ) {
1013 for(
size_t j=jbegin; j<jend; ++j ) {
1014 C(element->index(),j) += element->value() * B(i,j);
1037 template<
typename MT3
1040 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
1041 selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1043 selectDefaultAddAssignKernel( C, A, B );
1063 template<
typename MT3
1066 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
1067 selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1072 addAssign( C, tmp * B );
1092 template<
typename MT
1094 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1104 addAssign( ~lhs,
trans( rhs.lhs_ ) * rhs.rhs_ );
1126 template<
typename MT
1128 friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1136 LT A(
serial( rhs.lhs_ ) );
1137 RT B(
serial( rhs.rhs_ ) );
1146 TSMatDMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1162 template<
typename MT3
1165 static inline void selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1167 const size_t size( C.rows() * C.columns() );
1169 if( ( IsRowMajorMatrix<MT3>::value &&
size < TSMATDMATMULT_THRESHOLD ) ||
1170 ( IsColumnMajorMatrix<MT3>::value &&
size < 625UL ) )
1171 selectSmallSubAssignKernel( C, A, B );
1173 selectLargeSubAssignKernel( C, A, B );
1193 template<
typename MT3
1196 static inline void selectDefaultSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1200 if( IsDiagonal<MT5>::value )
1202 for(
size_t i=0UL; i<A.columns(); ++i )
1204 const ConstIterator
end( A.end(i) );
1205 ConstIterator element( A.begin(i) );
1207 for( ; element!=
end; ++element ) {
1208 C(element->index(),i) -= element->value() * B(i,i);
1214 const size_t block( IsRowMajorMatrix<MT3>::value ? 256UL : 8UL );
1216 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1218 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
1220 for(
size_t i=0UL; i<A.columns(); ++i )
1222 const ConstIterator
end( A.end(i) );
1223 ConstIterator element( A.begin(i) );
1225 const size_t jbegin( ( IsUpper<MT5>::value )
1226 ?(
max( IsStrictlyUpper<MT5>::value ? i+1UL : i, jj ) )
1228 const size_t jend( ( IsLower<MT5>::value )
1229 ?(
min( IsStrictlyLower<MT5>::value ? i : i+1UL, jpos ) )
1232 if( jbegin >= jend )
1235 for( ; element!=
end; ++element ) {
1236 for(
size_t j=jbegin; j<jend; ++j ) {
1237 C(element->index(),j) -= element->value() * B(i,j);
1261 template<
typename MT3
1264 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
1265 selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1267 selectDefaultSubAssignKernel( C, A, B );
1287 template<
typename MT3
1290 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
1291 selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1295 const size_t block( ( IsRowMajorMatrix<MT3>::value )?( 256UL ):( 8UL ) );
1297 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1299 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
1301 for(
size_t i=0UL; i<A.columns(); ++i )
1303 const size_t jbegin( ( IsUpper<MT5>::value )
1304 ?(
max( IsStrictlyUpper<MT5>::value ? i+1UL : i, jj ) )
1306 const size_t jend( ( IsLower<MT5>::value )
1307 ?(
min( IsStrictlyLower<MT5>::value ? i : i+1UL, jpos ) )
1310 if( jbegin >= jend )
1313 const ConstIterator
end( A.end(i) );
1314 ConstIterator element( A.begin(i) );
1316 const size_t nonzeros( A.nonZeros(i) );
1317 const size_t kpos( nonzeros &
size_t(-4) );
1320 for(
size_t k=0UL; k<kpos; k+=4UL )
1322 const size_t i1( element->index() );
1323 const ET1 v1( element->value() );
1325 const size_t i2( element->index() );
1326 const ET1 v2( element->value() );
1328 const size_t i3( element->index() );
1329 const ET1 v3( element->value() );
1331 const size_t i4( element->index() );
1332 const ET1 v4( element->value() );
1337 for(
size_t j=jbegin; j<jend; ++j ) {
1338 C(i1,j) -= v1 * B(i,j);
1339 C(i2,j) -= v2 * B(i,j);
1340 C(i3,j) -= v3 * B(i,j);
1341 C(i4,j) -= v4 * B(i,j);
1345 for( ; element!=
end; ++element ) {
1346 for(
size_t j=jbegin; j<jend; ++j ) {
1347 C(element->index(),j) -= element->value() * B(i,j);
1370 template<
typename MT3
1373 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
1374 selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1376 selectDefaultSubAssignKernel( C, A, B );
1396 template<
typename MT3
1399 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
1400 selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1405 subAssign( C, tmp * B );
1425 template<
typename MT
1427 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1437 subAssign( ~lhs,
trans( rhs.lhs_ ) * rhs.rhs_ );
1470 template<
typename MT
1472 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1511 template<
typename MT
1513 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1518 typedef typename SelectType< SO, ResultType, OppositeType >::Type TmpType;
1530 const TmpType tmp( rhs );
1551 template<
typename MT
1553 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1582 template<
typename MT
1584 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1622 template<
typename MT
1624 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1657 template<
typename MT
1659 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1697 template<
typename MT
1699 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1776 template<
typename T1
1778 inline const TSMatDMatMultExpr<T1,T2>
1802 template<
typename MT1,
typename MT2 >
1819 template<
typename MT1,
typename MT2 >
1836 template<
typename MT1,
typename MT2 >
1837 struct IsAligned<
TSMatDMatMultExpr<MT1,MT2> > :
public IsTrue< IsAligned<MT2>::value >
1853 template<
typename MT1,
typename MT2 >
1855 :
public IsTrue< And< IsLower<MT1>, IsLower<MT2> >::value >
1871 template<
typename MT1,
typename MT2 >
1873 :
public IsTrue< And< IsUniLower<MT1>, IsUniLower<MT2> >::value >
1889 template<
typename MT1,
typename MT2 >
1891 :
public IsTrue< Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
1892 , And< IsStrictlyLower<MT2>, IsLower<MT1> > >::value >
1908 template<
typename MT1,
typename MT2 >
1910 :
public IsTrue< And< IsUpper<MT1>, IsUpper<MT2> >::value >
1926 template<
typename MT1,
typename MT2 >
1928 :
public IsTrue< And< IsUniUpper<MT1>, IsUniUpper<MT2> >::value >
1944 template<
typename MT1,
typename MT2 >
1946 :
public IsTrue< Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
1947 , And< IsStrictlyUpper<MT2>, IsUpper<MT1> > >::value >
1963 template<
typename MT1,
typename MT2,
typename VT >
1968 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1969 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1970 IsDenseVector<VT>::value && IsColumnVector<VT>::value
1971 ,
typename TSMatDVecMultExprTrait< MT1, typename DMatDVecMultExprTrait<MT2,VT>::Type >::Type
1972 , INVALID_TYPE >::Type Type;
1981 template<
typename MT1,
typename MT2,
typename VT >
1986 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1987 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1988 IsSparseVector<VT>::value && IsColumnVector<VT>::value
1989 ,
typename TSMatDVecMultExprTrait< MT1, typename DMatSVecMultExprTrait<MT2,VT>::Type >::Type
1990 , INVALID_TYPE >::Type Type;
1999 template<
typename VT,
typename MT1,
typename MT2 >
2004 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2005 IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2006 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value
2007 ,
typename TDVecDMatMultExprTrait< typename TDVecTSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
2008 , INVALID_TYPE >::Type Type;
2017 template<
typename VT,
typename MT1,
typename MT2 >
2022 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
2023 IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2024 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value
2025 ,
typename TDVecDMatMultExprTrait< typename TDVecTSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
2026 , INVALID_TYPE >::Type Type;
2035 template<
typename MT1,
typename MT2,
bool AF >
2040 typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT1,AF>::Type
2041 ,
typename SubmatrixExprTrait<const MT2,AF>::Type >::Type Type;
2050 template<
typename MT1,
typename MT2 >
2055 typedef typename MultExprTrait< typename RowExprTrait<const MT1>::Type, MT2 >::Type Type;
2064 template<
typename MT1,
typename MT2 >
2069 typedef typename MultExprTrait< MT1, typename ColumnExprTrait<const MT2>::Type >::Type Type;
LeftOperand lhs_
Left-hand side sparse matrix of the multiplication expression.
Definition: TSMatDMatMultExpr.h:402
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
const MT::ElementType max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1729
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
Header file for mathematical functions.
SelectType< evaluateLeft, const RT1, CT1 >::Type LT
Type for the assignment of the left-hand side sparse matrix operand.
Definition: TSMatDMatMultExpr.h:227
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7820
Compile time check for triangular matrix types.This type trait tests whether or not the given templat...
Definition: IsTriangular.h:105
Header file for basic type definitions.
MT2::CompositeType CT2
Composite type of the right-hand side dense matrix expression.
Definition: TSMatDMatMultExpr.h:141
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:250
Header file for the IsSparseMatrix type trait.
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
Header file for the IsDiagonal type trait.
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:79
Header file for the ColumnExprTrait class template.
Header file for the IsColumnMajorMatrix type trait.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:507
Header file for the TSVecTSMatMultExprTrait class template.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:259
Header file for the And class template.
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:90
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
Header file for the Computation base class.
Header file for the MatMatMultExpr base class.
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:90
Constraints on the storage order of matrix types.
Header file for the RequiresEvaluation type trait.
System settings for performance optimizations.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: TSMatDMatMultExpr.h:321
Header file for the IsUniLower type trait.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2584
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:117
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: TSMatDMatMultExpr.h:395
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:547
Constraint on the data type.
Constraint on the data type.
Header file for the MultExprTrait class template.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: TSMatDMatMultExpr.h:331
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the DisableIf class template.
SelectType< IsExpression< MT2 >::value, const MT2, const MT2 & >::Type RightOperand
Composite type of the right-hand side dense matrix expression.
Definition: TSMatDMatMultExpr.h:224
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
SelectType< evaluateRight, const RT2, CT2 >::Type RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: TSMatDMatMultExpr.h:230
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:110
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: TSMatDMatMultExpr.h:214
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: ColumnMajorMatrix.h:79
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: TSMatDMatMultExpr.h:263
Header file for the TSVecTDMatMultExprTrait class template.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
Header file for the Or class template.
Header file for the TDMatSVecMultExprTrait class template.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: TSMatDMatMultExpr.h:375
Header file for the TDVecTSMatMultExprTrait class template.
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
const MT::ElementType min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1682
Header file for the DenseMatrix base class.
Header file for the Columns type trait.
Header file for the TSMatDVecMultExprTrait class template.
Header file for the DMatDVecMultExprTrait class template.
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
TSMatDMatMultExpr(const MT1 &lhs, const MT2 &rhs)
Constructor for the TSMatDMatMultExpr class.
Definition: TSMatDMatMultExpr.h:248
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:78
RT1::ElementType ET1
Element type of the left-hand side dense matrix expression.
Definition: TSMatDMatMultExpr.h:138
Header file for the IsTriangular type trait.
Constraints on the storage order of matrix types.
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: TSMatDMatMultExpr.h:213
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Header file for the IsDenseMatrix type trait.
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: TSMatDMatMultExpr.h:385
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
MT1::ResultType RT1
Result type of the left-hand side sparse matrix expression.
Definition: TSMatDMatMultExpr.h:136
Header file for the serial shim.
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATMATMULTEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid matrix/matrix ...
Definition: MatMatMultExpr.h:165
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: TSMatDMatMultExpr.h:215
TSMatDMatMultExpr< MT1, MT2 > This
Type of this TSMatDMatMultExpr instance.
Definition: TSMatDMatMultExpr.h:212
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the IsSparseVector type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:116
Header file for the SubmatrixExprTrait class template.
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a row-major dense or sparse matrix t...
Definition: RowMajorMatrix.h:79
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TSMatDMatMultExpr.h:217
LeftOperand leftOperand() const
Returns the left-hand side transpose sparse matrix operand.
Definition: TSMatDMatMultExpr.h:341
Header file for run time assertion macros.
Compile time check for column-major matrix types.This type trait tests whether or not the given templ...
Definition: IsColumnMajorMatrix.h:110
EnableIf< IsDenseMatrix< MT1 > >::Type smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
Utility type for generic codes.
Base template for the MultTrait class.
Definition: MultTrait.h:138
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: TSMatDMatMultExpr.h:305
RT2::ElementType ET2
Element type of the right-hand side sparse matrix expression.
Definition: TSMatDMatMultExpr.h:139
RightOperand rightOperand() const
Returns the right-hand side dense matrix operand.
Definition: TSMatDMatMultExpr.h:351
const ResultType CompositeType
Data type for composite expression templates.
Definition: TSMatDMatMultExpr.h:218
RightOperand rhs_
Right-hand side dense matrix of the multiplication expression.
Definition: TSMatDMatMultExpr.h:403
const bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
Header file for the reset shim.
Header file for the isDefault shim.
MT1::CompositeType CT1
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatDMatMultExpr.h:140
Constraints on the storage order of matrix types.
Header file for the RemoveReference type trait.
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.In case either of the two given data types T1 or T2 is not a matrix type ...
Definition: StorageOrder.h:122
Header file for the IsDenseVector type trait.
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: TSMatDMatMultExpr.h:363
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
Header file for the IsRowMajorMatrix type trait.
ResultType::ElementType ElementType
Resulting element type.
Definition: TSMatDMatMultExpr.h:216
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:944
Header file for the IsComputation type trait class.
MT2::ResultType RT2
Result type of the right-hand side dense matrix expression.
Definition: TSMatDMatMultExpr.h:137
Expression object for transpose sparse matrix-dense matrix multiplications.The TSMatDMatMultExpr clas...
Definition: Forward.h:150
Header file for the TDVecDMatMultExprTrait class template.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
Header file for the TDMatDVecMultExprTrait class template.
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
Header file for the IsTrue value trait.
Header file for the TSVecDMatMultExprTrait class template.
Header file for the IsUpper type trait.
Header file for exception macros.
Header file for the DMatSVecMultExprTrait class template.
Header file for the IsColumnVector type trait.
SelectType< IsExpression< MT1 >::value, const MT1, const MT1 & >::Type LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatDMatMultExpr.h:221
Constraint on the data type.
Header file for the IsResizable type trait.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the TDVecTDMatMultExprTrait class template.
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:79
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.