35 #ifndef _BLAZE_MATH_EXPRESSIONS_TSMATTDMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TSMATTDMATMULTEXPR_H_
124 template<
typename MT1
126 class TSMatTDMatMultExpr :
public DenseMatrix< TSMatTDMatMultExpr<MT1,MT2>, true >
127 ,
private MatMatMultExpr
128 ,
private Computation
157 template<
typename T1,
typename T2,
typename T3 >
158 struct CanExploitSymmetry {
159 enum { value = ( IsSymmetric<T2>::value || IsSymmetric<T3>::value ) };
170 template<
typename T1,
typename T2,
typename T3 >
171 struct IsEvaluationRequired {
172 enum { value = ( evaluateLeft || evaluateRight ) &&
173 !CanExploitSymmetry<T1,T2,T3>::value };
184 template<
typename T1,
typename T2,
typename T3 >
185 struct UseOptimizedKernel {
187 !IsDiagonal<T3>::value &&
188 !IsResizable<typename T1::ElementType>::value &&
189 !IsResizable<ET1>::value };
199 template<
typename T1,
typename T2,
typename T3 >
200 struct UseDefaultKernel {
201 enum { value = !UseOptimizedKernel<T1,T2,T3>::value };
231 enum { vectorizable = 0 };
234 enum { smpAssignable = !evaluateLeft && MT1::smpAssignable &&
235 !evaluateRight && MT2::smpAssignable };
278 :(
lhs_.columns() ) ) );
280 if(
lhs_.columns() == 0UL ||
284 ElementType tmp(
lhs_(i,kbegin) *
rhs_(kbegin,j) );
285 for(
size_t k=kbegin+1UL; k<kend; ++k ) {
301 inline ReturnType
at(
size_t i,
size_t j )
const {
302 if( i >=
lhs_.rows() ) {
305 if( j >=
rhs_.columns() ) {
328 return rhs_.columns();
358 template<
typename T >
360 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
370 template<
typename T >
372 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
382 return rhs_.isAligned();
392 return (
columns() > SMP_TSMATTDMATMULT_THRESHOLD );
415 template<
typename MT
425 LT A(
serial( rhs.lhs_ ) );
426 RT B(
serial( rhs.rhs_ ) );
435 TSMatTDMatMultExpr::selectAssignKernel( ~lhs, A, B );
451 template<
typename MT3
454 static inline void selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
456 const size_t size( C.rows() * C.columns() );
460 selectSmallAssignKernel( C, A, B );
462 selectLargeAssignKernel( C, A, B );
482 template<
typename MT3
485 static inline void selectDefaultAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
491 if( IsDiagonal<MT5>::value )
493 for(
size_t i=0UL; i<A.columns(); ++i )
495 const ConstIterator
end( A.end(i) );
496 ConstIterator element( A.begin(i) );
498 for( ; element!=
end; ++element ) {
499 C(element->index(),i) = element->value() * B(i,i);
505 const size_t block( 64UL );
507 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
509 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
511 for(
size_t i=0UL; i<A.columns(); ++i )
513 const ConstIterator
end( A.end(i) );
514 ConstIterator element( A.begin(i) );
516 const size_t jbegin( ( IsUpper<MT5>::value )
517 ?(
max( IsStrictlyUpper<MT5>::value ? i+1UL : i, jj ) )
519 const size_t jend( ( IsLower<MT5>::value )
520 ?(
min( IsStrictlyLower<MT5>::value ? i : i+1UL, jpos ) )
526 for( ; element!=
end; ++element ) {
527 for(
size_t j=jbegin; j<jend; ++j ) {
529 C(element->index(),j) = element->value() * B(i,j);
531 C(element->index(),j) += element->value() * B(i,j);
555 template<
typename MT3
558 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
559 selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
561 selectDefaultAssignKernel( C, A, B );
581 template<
typename MT3
584 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
585 selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
589 const size_t block( IsRowMajorMatrix<MT3>::value ? 128UL : 64UL );
591 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
593 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
595 for(
size_t i=0UL; i<A.rows(); ++i ) {
596 for(
size_t j=jj; j<jpos; ++j ) {
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 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
776 assign( ~lhs,
trans( rhs.lhs_ ) *
trans( rhs.rhs_ ) );
777 else if( IsSymmetric<MT1>::value )
778 assign( ~lhs,
trans( rhs.lhs_ ) * rhs.rhs_ );
780 assign( ~lhs, rhs.lhs_ *
trans( rhs.rhs_ ) );
798 template<
typename MT
800 friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
808 LT A(
serial( rhs.lhs_ ) );
809 RT B(
serial( rhs.rhs_ ) );
818 TSMatTDMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
834 template<
typename MT3
837 static inline void selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
839 const size_t size( C.rows() * C.columns() );
841 if( ( IsRowMajorMatrix<MT3>::value &&
size < TSMATTDMATMULT_THRESHOLD ) ||
842 ( IsColumnMajorMatrix<MT3>::value &&
size < 625UL ) )
843 selectSmallAddAssignKernel( C, A, B );
845 selectLargeAddAssignKernel( C, A, B );
865 template<
typename MT3
868 static inline void selectDefaultAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
872 if( IsDiagonal<MT5>::value )
874 for(
size_t i=0UL; i<A.columns(); ++i )
876 const ConstIterator
end( A.end(i) );
877 ConstIterator element( A.begin(i) );
879 for( ; element!=
end; ++element ) {
880 C(element->index(),i) += element->value() * B(i,i);
886 const size_t block( 64UL );
888 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
890 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
892 for(
size_t i=0UL; i<A.columns(); ++i )
894 const ConstIterator
end( A.end(i) );
895 ConstIterator element( A.begin(i) );
897 const size_t jbegin( ( IsUpper<MT5>::value )
898 ?(
max( IsStrictlyUpper<MT5>::value ? i+1UL : i, jj ) )
900 const size_t jend( ( IsLower<MT5>::value )
901 ?(
min( IsStrictlyLower<MT5>::value ? i : i+1UL, jpos ) )
907 for( ; element!=
end; ++element ) {
908 for(
size_t j=jbegin; j<jend; ++j ) {
909 C(element->index(),j) += element->value() * B(i,j);
933 template<
typename MT3
936 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
937 selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
939 selectDefaultAddAssignKernel( C, A, B );
959 template<
typename MT3
962 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
963 selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
967 const size_t block( IsRowMajorMatrix<MT3>::value ? 128UL : 64UL );
969 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
971 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
973 for(
size_t i=0UL; i<A.columns(); ++i )
975 const size_t jbegin( ( IsUpper<MT5>::value )
976 ?(
max( IsStrictlyUpper<MT5>::value ? i+1UL : i, jj ) )
978 const size_t jend( ( IsLower<MT5>::value )
979 ?(
min( IsStrictlyLower<MT5>::value ? i : i+1UL, jpos ) )
985 const ConstIterator
end( A.end(i) );
986 ConstIterator element( A.begin(i) );
988 const size_t nonzeros( A.nonZeros(i) );
989 const size_t kpos( nonzeros &
size_t(-4) );
992 for(
size_t k=0UL; k<kpos; k+=4UL )
994 const size_t i1( element->index() );
995 const ET1 v1( element->value() );
997 const size_t i2( element->index() );
998 const ET1 v2( element->value() );
1000 const size_t i3( element->index() );
1001 const ET1 v3( element->value() );
1003 const size_t i4( element->index() );
1004 const ET1 v4( element->value() );
1009 for(
size_t j=jbegin; j<jend; ++j ) {
1010 C(i1,j) += v1 * B(i,j);
1011 C(i2,j) += v2 * B(i,j);
1012 C(i3,j) += v3 * B(i,j);
1013 C(i4,j) += v4 * B(i,j);
1017 for( ; element!=
end; ++element ) {
1018 for(
size_t j=jbegin; j<jend; ++j ) {
1019 C(element->index(),j) += element->value() * B(i,j);
1042 template<
typename MT3
1045 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
1046 selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1048 selectDefaultAddAssignKernel( C, A, B );
1068 template<
typename MT3
1071 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
1072 selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1077 addAssign( C, tmp * B );
1097 template<
typename MT
1099 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1109 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
1110 addAssign( ~lhs,
trans( rhs.lhs_ ) *
trans( rhs.rhs_ ) );
1111 else if( IsSymmetric<MT1>::value )
1112 addAssign( ~lhs,
trans( rhs.lhs_ ) * rhs.rhs_ );
1114 addAssign( ~lhs, rhs.lhs_ *
trans( rhs.rhs_ ) );
1136 template<
typename MT
1138 friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1146 LT A(
serial( rhs.lhs_ ) );
1147 RT B(
serial( rhs.rhs_ ) );
1156 TSMatTDMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1172 template<
typename MT3
1175 static inline void selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1177 const size_t size( C.rows() * C.columns() );
1179 if( ( IsRowMajorMatrix<MT3>::value &&
size < TSMATTDMATMULT_THRESHOLD ) ||
1180 ( IsColumnMajorMatrix<MT3>::value &&
size < 625UL ) )
1181 selectSmallSubAssignKernel( C, A, B );
1183 selectLargeSubAssignKernel( C, A, B );
1203 template<
typename MT3
1206 static inline void selectDefaultSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1210 if( IsDiagonal<MT5>::value )
1212 for(
size_t i=0UL; i<A.columns(); ++i )
1214 const ConstIterator
end( A.end(i) );
1215 ConstIterator element( A.begin(i) );
1217 for( ; element!=
end; ++element ) {
1218 C(element->index(),i) -= element->value() * B(i,i);
1224 const size_t block( 64UL );
1226 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1228 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
1230 for(
size_t i=0UL; i<A.columns(); ++i )
1232 const ConstIterator
end( A.end(i) );
1233 ConstIterator element( A.begin(i) );
1235 const size_t jbegin( ( IsUpper<MT5>::value )
1236 ?(
max( IsStrictlyUpper<MT5>::value ? i+1UL : i, jj ) )
1238 const size_t jend( ( IsLower<MT5>::value )
1239 ?(
min( IsStrictlyLower<MT5>::value ? i : i+1UL, jpos ) )
1242 if( jbegin >= jend )
1245 for( ; element!=
end; ++element ) {
1246 for(
size_t j=jbegin; j<jend; ++j ) {
1247 C(element->index(),j) -= element->value() * B(i,j);
1271 template<
typename MT3
1274 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
1275 selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1277 selectDefaultSubAssignKernel( C, A, B );
1297 template<
typename MT3
1300 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
1301 selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1305 const size_t block( IsRowMajorMatrix<MT3>::value ? 128UL : 64UL );
1307 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1309 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
1311 for(
size_t i=0UL; i<A.columns(); ++i )
1313 const size_t jbegin( ( IsUpper<MT5>::value )
1314 ?(
max( IsStrictlyUpper<MT5>::value ? i+1UL : i, jj ) )
1316 const size_t jend( ( IsLower<MT5>::value )
1317 ?(
min( IsStrictlyLower<MT5>::value ? i : i+1UL, jpos ) )
1320 if( jbegin >= jend )
1323 const ConstIterator
end( A.end(i) );
1324 ConstIterator element( A.begin(i) );
1326 const size_t nonzeros( A.nonZeros(i) );
1327 const size_t kpos( nonzeros &
size_t(-4) );
1330 for(
size_t k=0UL; k<kpos; k+=4UL )
1332 const size_t i1( element->index() );
1333 const ET1 v1( element->value() );
1335 const size_t i2( element->index() );
1336 const ET1 v2( element->value() );
1338 const size_t i3( element->index() );
1339 const ET1 v3( element->value() );
1341 const size_t i4( element->index() );
1342 const ET1 v4( element->value() );
1347 for(
size_t j=jbegin; j<jend; ++j ) {
1348 C(i1,j) -= v1 * B(i,j);
1349 C(i2,j) -= v2 * B(i,j);
1350 C(i3,j) -= v3 * B(i,j);
1351 C(i4,j) -= v4 * B(i,j);
1355 for( ; element!=
end; ++element ) {
1356 for(
size_t j=jbegin; j<jend; ++j ) {
1357 C(element->index(),j) -= element->value() * B(i,j);
1380 template<
typename MT3
1383 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
1384 selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1386 selectDefaultSubAssignKernel( C, A, B );
1406 template<
typename MT3
1409 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
1410 selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1415 subAssign( C, tmp * B );
1435 template<
typename MT
1437 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1447 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
1448 subAssign( ~lhs,
trans( rhs.lhs_ ) *
trans( rhs.rhs_ ) );
1449 else if( IsSymmetric<MT1>::value )
1450 subAssign( ~lhs,
trans( rhs.lhs_ ) * rhs.rhs_ );
1452 subAssign( ~lhs, rhs.lhs_ *
trans( rhs.rhs_ ) );
1485 template<
typename MT
1487 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1526 template<
typename MT
1528 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1533 typedef typename SelectType< SO, ResultType, OppositeType >::Type TmpType;
1545 const TmpType tmp( rhs );
1566 template<
typename MT
1568 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1578 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
1580 else if( IsSymmetric<MT1>::value )
1604 template<
typename MT
1606 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1644 template<
typename MT
1646 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1656 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
1658 else if( IsSymmetric<MT1>::value )
1686 template<
typename MT
1688 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1726 template<
typename MT
1728 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1738 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
1740 else if( IsSymmetric<MT1>::value )
1810 template<
typename T1
1812 inline const TSMatTDMatMultExpr<T1,T2>
1836 template<
typename MT1,
typename MT2 >
1853 template<
typename MT1,
typename MT2 >
1870 template<
typename MT1,
typename MT2 >
1871 struct IsAligned<
TSMatTDMatMultExpr<MT1,MT2> > :
public IsTrue< IsAligned<MT2>::value >
1887 template<
typename MT1,
typename MT2 >
1889 :
public IsTrue< And< IsLower<MT1>, IsLower<MT2> >::value >
1905 template<
typename MT1,
typename MT2 >
1907 :
public IsTrue< And< IsUniLower<MT1>, IsUniLower<MT2> >::value >
1923 template<
typename MT1,
typename MT2 >
1925 :
public IsTrue< Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
1926 , And< IsStrictlyLower<MT2>, IsLower<MT1> > >::value >
1942 template<
typename MT1,
typename MT2 >
1944 :
public IsTrue< And< IsUpper<MT1>, IsUpper<MT2> >::value >
1960 template<
typename MT1,
typename MT2 >
1962 :
public IsTrue< And< IsUniUpper<MT1>, IsUniUpper<MT2> >::value >
1978 template<
typename MT1,
typename MT2 >
1980 :
public IsTrue< Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
1981 , And< IsStrictlyUpper<MT2>, IsUpper<MT1> > >::value >
1997 template<
typename MT1,
typename MT2,
typename VT >
2002 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2003 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2004 IsDenseVector<VT>::value && IsColumnVector<VT>::value
2005 ,
typename TSMatDVecMultExprTrait< MT1, typename TDMatDVecMultExprTrait<MT2,VT>::Type >::Type
2006 , INVALID_TYPE >::Type Type;
2015 template<
typename MT1,
typename MT2,
typename VT >
2020 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2021 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2022 IsSparseVector<VT>::value && IsColumnVector<VT>::value
2023 ,
typename TSMatDVecMultExprTrait< MT1, typename TDMatSVecMultExprTrait<MT2,VT>::Type >::Type
2024 , INVALID_TYPE >::Type Type;
2033 template<
typename VT,
typename MT1,
typename MT2 >
2038 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2039 IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2040 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value
2041 ,
typename TDVecTDMatMultExprTrait< typename TDVecTSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
2042 , INVALID_TYPE >::Type Type;
2051 template<
typename VT,
typename MT1,
typename MT2 >
2056 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
2057 IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2058 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value
2059 ,
typename TSVecTDMatMultExprTrait< typename TSVecTSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
2060 , INVALID_TYPE >::Type Type;
2069 template<
typename MT1,
typename MT2,
bool AF >
2074 typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT1,AF>::Type
2075 ,
typename SubmatrixExprTrait<const MT2,AF>::Type >::Type Type;
2084 template<
typename MT1,
typename MT2 >
2089 typedef typename MultExprTrait< typename RowExprTrait<const MT1>::Type, MT2 >::Type Type;
2098 template<
typename MT1,
typename MT2 >
2103 typedef typename MultExprTrait< MT1, typename ColumnExprTrait<const MT2>::Type >::Type Type;
#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.
MT1::CompositeType CT1
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatTDMatMultExpr.h:136
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: TSMatTDMatMultExpr.h:301
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
RT2::ElementType ET2
Element type of the right-hand side sparse matrix expression.
Definition: TSMatTDMatMultExpr.h:135
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.
Expression object for transpose sparse matrix-transpose dense matrix multiplications.The TSMatTDMatMultExpr class represents the compile time expression for multiplications between a column-major sparse matrix and a column-major dense matrix.
Definition: Forward.h:156
TSMatTDMatMultExpr(const MT1 &lhs, const MT2 &rhs)
Constructor for the TSMatTDMatMultExpr class.
Definition: TSMatTDMatMultExpr.h:244
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.
TSMatTDMatMultExpr< MT1, MT2 > This
Type of this TSMatTDMatMultExpr instance.
Definition: TSMatTDMatMultExpr.h:208
RT1::ElementType ET1
Element type of the left-hand side dense matrix expression.
Definition: TSMatTDMatMultExpr.h:134
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: TSMatTDMatMultExpr.h:359
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.
SelectType< evaluateRight, const RT2, CT2 >::Type RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: TSMatTDMatMultExpr.h:226
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: TSMatTDMatMultExpr.h:210
Header file for the IsUniLower type trait.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: TSMatTDMatMultExpr.h:371
MT2::ResultType RT2
Result type of the right-hand side dense matrix expression.
Definition: TSMatTDMatMultExpr.h:133
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 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.
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.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
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
#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
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.
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 IsLower type trait.
RightOperand rhs_
Right-hand side dense matrix of the multiplication expression.
Definition: TSMatTDMatMultExpr.h:399
Header file for the IsAligned type trait.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: TSMatTDMatMultExpr.h:317
#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
Header file for the IsTriangular type trait.
Constraints on the storage order of matrix types.
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TSMatTDMatMultExpr.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
SelectType< IsExpression< MT1 >::value, const MT1, const MT1 & >::Type LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatTDMatMultExpr.h:217
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.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Header file for the serial shim.
SelectType< evaluateLeft, const RT1, CT1 >::Type LT
Type for the assignment of the left-hand side sparse matrix operand.
Definition: TSMatTDMatMultExpr.h:223
#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
LeftOperand lhs_
Left-hand side sparse matrix of the multiplication expression.
Definition: TSMatTDMatMultExpr.h:398
const ResultType CompositeType
Data type for composite expression templates.
Definition: TSMatTDMatMultExpr.h:214
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
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
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: TSMatTDMatMultExpr.h:391
MT2::CompositeType CT2
Composite type of the right-hand side dense matrix expression.
Definition: TSMatTDMatMultExpr.h:137
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.
SelectType< IsExpression< MT2 >::value, const MT2, const MT2 & >::Type RightOperand
Composite type of the right-hand side dense matrix expression.
Definition: TSMatTDMatMultExpr.h:220
Header file for the isDefault shim.
MT1::ResultType RT1
Result type of the left-hand side sparse matrix expression.
Definition: TSMatTDMatMultExpr.h:132
Constraints on the storage order of matrix types.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: TSMatTDMatMultExpr.h:211
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
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: TSMatTDMatMultExpr.h:209
#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.
RightOperand rightOperand() const
Returns the right-hand side transpose dense matrix operand.
Definition: TSMatTDMatMultExpr.h:347
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
LeftOperand leftOperand() const
Returns the left-hand side transpose sparse matrix operand.
Definition: TSMatTDMatMultExpr.h:337
Header file for the IsRowMajorMatrix type trait.
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.
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
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: TSMatTDMatMultExpr.h:259
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
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: TSMatTDMatMultExpr.h:381
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
Header file for the IsTrue value trait.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: TSMatTDMatMultExpr.h:327
Header file for the IsUpper type trait.
Header file for exception macros.
Header file for the IsColumnVector type trait.
Constraint on the data type.
Header file for the IsResizable type trait.
ResultType::ElementType ElementType
Resulting element type.
Definition: TSMatTDMatMultExpr.h:212
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.