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 :
bool { value = ( IsSymmetric<T2>::value || IsSymmetric<T3>::value ) };
170 template<
typename T1,
typename T2,
typename T3 >
171 struct IsEvaluationRequired {
172 enum :
bool { 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< ElementType_<T1> >::value &&
189 !IsResizable<ET1>::value };
199 template<
typename T1,
typename T2,
typename T3 >
200 struct UseDefaultKernel {
201 enum :
bool { value = !UseOptimizedKernel<T1,T2,T3>::value };
231 enum :
bool { simdEnabled =
false };
234 enum :
bool { smpAssignable = !evaluateLeft && MT1::smpAssignable &&
235 !evaluateRight && MT2::smpAssignable };
285 :(
lhs_.columns() ) ) );
289 const size_t n(
end - begin );
307 inline ReturnType
at(
size_t i,
size_t j )
const {
308 if( i >=
lhs_.rows() ) {
311 if( j >=
rhs_.columns() ) {
323 inline size_t rows() const noexcept {
334 return rhs_.columns();
364 template<
typename T >
365 inline bool canAlias(
const T* alias )
const noexcept {
366 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
376 template<
typename T >
377 inline bool isAliased(
const T* alias )
const noexcept {
378 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
388 return rhs_.isAligned();
398 return (
rows() *
columns() >= SMP_TSMATTDMATMULT_THRESHOLD );
421 template<
typename MT
431 LT A(
serial( rhs.lhs_ ) );
432 RT B(
serial( rhs.rhs_ ) );
441 TSMatTDMatMultExpr::selectAssignKernel( ~lhs, A, B );
457 template<
typename MT3
460 static inline void selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
462 const size_t size( C.rows() * C.columns() );
466 selectSmallAssignKernel( C, A, B );
468 selectLargeAssignKernel( C, A, B );
488 template<
typename MT3
491 static inline void selectDefaultAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
497 if( IsDiagonal<MT5>::value )
499 for(
size_t i=0UL; i<A.columns(); ++i )
501 const ConstIterator
end( A.end(i) );
502 ConstIterator element( A.begin(i) );
504 for( ; element!=
end; ++element ) {
505 C(element->index(),i) = element->value() * B(i,i);
511 const size_t block( 64UL );
513 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
515 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
517 for(
size_t i=0UL; i<A.columns(); ++i )
519 const ConstIterator
end( A.end(i) );
520 ConstIterator element( A.begin(i) );
522 const size_t jbegin( ( IsUpper<MT5>::value )
523 ?(
max( IsStrictlyUpper<MT5>::value ? i+1UL : i, jj ) )
525 const size_t jend( ( IsLower<MT5>::value )
526 ?(
min( IsStrictlyLower<MT5>::value ? i : i+1UL, jpos ) )
532 for( ; element!=
end; ++element ) {
533 for(
size_t j=jbegin; j<jend; ++j ) {
535 C(element->index(),j) = element->value() * B(i,j);
537 C(element->index(),j) += element->value() * B(i,j);
561 template<
typename MT3
564 static inline EnableIf_< UseDefaultKernel<MT3,MT4,MT5> >
565 selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
567 selectDefaultAssignKernel( C, A, B );
587 template<
typename MT3
590 static inline EnableIf_< UseOptimizedKernel<MT3,MT4,MT5> >
591 selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
595 const size_t block( IsRowMajorMatrix<MT3>::value ? 128UL : 64UL );
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.rows(); ++i ) {
602 for(
size_t j=jj; j<jpos; ++j ) {
607 for(
size_t i=0UL; i<A.columns(); ++i )
609 const size_t jbegin( ( IsUpper<MT5>::value )
610 ?(
max( IsStrictlyUpper<MT5>::value ? i+1UL : i, jj ) )
612 const size_t jend( ( IsLower<MT5>::value )
613 ?(
min( IsStrictlyLower<MT5>::value ? i : i+1UL, jpos ) )
619 const ConstIterator
end( A.end(i) );
620 ConstIterator element( A.begin(i) );
622 const size_t nonzeros( A.nonZeros(i) );
623 const size_t kpos( nonzeros &
size_t(-4) );
626 for(
size_t k=0UL; k<kpos; k+=4UL )
628 const size_t i1( element->index() );
629 const ET1 v1( element->value() );
631 const size_t i2( element->index() );
632 const ET1 v2( element->value() );
634 const size_t i3( element->index() );
635 const ET1 v3( element->value() );
637 const size_t i4( element->index() );
638 const ET1 v4( element->value() );
643 for(
size_t j=jbegin; j<jend; ++j ) {
644 C(i1,j) += v1 * B(i,j);
645 C(i2,j) += v2 * B(i,j);
646 C(i3,j) += v3 * B(i,j);
647 C(i4,j) += v4 * B(i,j);
651 for( ; element!=
end; ++element ) {
652 for(
size_t j=jbegin; j<jend; ++j ) {
653 C(element->index(),j) += element->value() * B(i,j);
676 template<
typename MT3
679 static inline EnableIf_< UseDefaultKernel<MT3,MT4,MT5> >
680 selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
682 selectDefaultAssignKernel( C, A, B );
702 template<
typename MT3
705 static inline EnableIf_< UseOptimizedKernel<MT3,MT4,MT5> >
706 selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
710 const OppositeType_<MT4> tmp(
serial( A ) );
711 assign( C, tmp * B );
729 template<
typename MT
731 friend inline DisableIf_< CanExploitSymmetry<MT,MT1,MT2> >
736 typedef IfTrue_< SO, ResultType, OppositeType > TmpType;
748 const TmpType tmp(
serial( rhs ) );
769 template<
typename MT
771 friend inline EnableIf_< CanExploitSymmetry<MT,MT1,MT2> >
781 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
782 assign( ~lhs,
trans( rhs.lhs_ ) *
trans( rhs.rhs_ ) );
783 else if( IsSymmetric<MT1>::value )
784 assign( ~lhs,
trans( rhs.lhs_ ) * rhs.rhs_ );
786 assign( ~lhs, rhs.lhs_ *
trans( rhs.rhs_ ) );
804 template<
typename MT
806 friend inline DisableIf_< CanExploitSymmetry<MT,MT1,MT2> >
814 LT A(
serial( rhs.lhs_ ) );
815 RT B(
serial( rhs.rhs_ ) );
824 TSMatTDMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
840 template<
typename MT3
843 static inline void selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
845 const size_t size( C.rows() * C.columns() );
847 if( ( IsRowMajorMatrix<MT3>::value &&
size < TSMATTDMATMULT_THRESHOLD ) ||
848 ( IsColumnMajorMatrix<MT3>::value &&
size < 625UL ) )
849 selectSmallAddAssignKernel( C, A, B );
851 selectLargeAddAssignKernel( C, A, B );
871 template<
typename MT3
874 static inline void selectDefaultAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
878 if( IsDiagonal<MT5>::value )
880 for(
size_t i=0UL; i<A.columns(); ++i )
882 const ConstIterator
end( A.end(i) );
883 ConstIterator element( A.begin(i) );
885 for( ; element!=
end; ++element ) {
886 C(element->index(),i) += element->value() * B(i,i);
892 const size_t block( 64UL );
894 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
896 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
898 for(
size_t i=0UL; i<A.columns(); ++i )
900 const ConstIterator
end( A.end(i) );
901 ConstIterator element( A.begin(i) );
903 const size_t jbegin( ( IsUpper<MT5>::value )
904 ?(
max( IsStrictlyUpper<MT5>::value ? i+1UL : i, jj ) )
906 const size_t jend( ( IsLower<MT5>::value )
907 ?(
min( IsStrictlyLower<MT5>::value ? i : i+1UL, jpos ) )
913 for( ; element!=
end; ++element ) {
914 for(
size_t j=jbegin; j<jend; ++j ) {
915 C(element->index(),j) += element->value() * B(i,j);
939 template<
typename MT3
942 static inline EnableIf_< UseDefaultKernel<MT3,MT4,MT5> >
943 selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
945 selectDefaultAddAssignKernel( C, A, B );
965 template<
typename MT3
968 static inline EnableIf_< UseOptimizedKernel<MT3,MT4,MT5> >
969 selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
973 const size_t block( IsRowMajorMatrix<MT3>::value ? 128UL : 64UL );
975 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
977 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
979 for(
size_t i=0UL; i<A.columns(); ++i )
981 const size_t jbegin( ( IsUpper<MT5>::value )
982 ?(
max( IsStrictlyUpper<MT5>::value ? i+1UL : i, jj ) )
984 const size_t jend( ( IsLower<MT5>::value )
985 ?(
min( IsStrictlyLower<MT5>::value ? i : i+1UL, jpos ) )
991 const ConstIterator
end( A.end(i) );
992 ConstIterator element( A.begin(i) );
994 const size_t nonzeros( A.nonZeros(i) );
995 const size_t kpos( nonzeros &
size_t(-4) );
998 for(
size_t k=0UL; k<kpos; k+=4UL )
1000 const size_t i1( element->index() );
1001 const ET1 v1( element->value() );
1003 const size_t i2( element->index() );
1004 const ET1 v2( element->value() );
1006 const size_t i3( element->index() );
1007 const ET1 v3( element->value() );
1009 const size_t i4( element->index() );
1010 const ET1 v4( element->value() );
1015 for(
size_t j=jbegin; j<jend; ++j ) {
1016 C(i1,j) += v1 * B(i,j);
1017 C(i2,j) += v2 * B(i,j);
1018 C(i3,j) += v3 * B(i,j);
1019 C(i4,j) += v4 * B(i,j);
1023 for( ; element!=
end; ++element ) {
1024 for(
size_t j=jbegin; j<jend; ++j ) {
1025 C(element->index(),j) += element->value() * B(i,j);
1048 template<
typename MT3
1051 static inline EnableIf_< UseDefaultKernel<MT3,MT4,MT5> >
1052 selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1054 selectDefaultAddAssignKernel( C, A, B );
1074 template<
typename MT3
1077 static inline EnableIf_< UseOptimizedKernel<MT3,MT4,MT5> >
1078 selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1082 const OppositeType_<MT4> tmp(
serial( A ) );
1083 addAssign( C, tmp * B );
1103 template<
typename MT
1105 friend inline EnableIf_< CanExploitSymmetry<MT,MT1,MT2> >
1115 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
1116 addAssign( ~lhs,
trans( rhs.lhs_ ) *
trans( rhs.rhs_ ) );
1117 else if( IsSymmetric<MT1>::value )
1118 addAssign( ~lhs,
trans( rhs.lhs_ ) * rhs.rhs_ );
1120 addAssign( ~lhs, rhs.lhs_ *
trans( rhs.rhs_ ) );
1142 template<
typename MT
1144 friend inline DisableIf_< CanExploitSymmetry<MT,MT1,MT2> >
1152 LT A(
serial( rhs.lhs_ ) );
1153 RT B(
serial( rhs.rhs_ ) );
1162 TSMatTDMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1178 template<
typename MT3
1181 static inline void selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1183 const size_t size( C.rows() * C.columns() );
1185 if( ( IsRowMajorMatrix<MT3>::value &&
size < TSMATTDMATMULT_THRESHOLD ) ||
1186 ( IsColumnMajorMatrix<MT3>::value &&
size < 625UL ) )
1187 selectSmallSubAssignKernel( C, A, B );
1189 selectLargeSubAssignKernel( C, A, B );
1209 template<
typename MT3
1212 static inline void selectDefaultSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1216 if( IsDiagonal<MT5>::value )
1218 for(
size_t i=0UL; i<A.columns(); ++i )
1220 const ConstIterator
end( A.end(i) );
1221 ConstIterator element( A.begin(i) );
1223 for( ; element!=
end; ++element ) {
1224 C(element->index(),i) -= element->value() * B(i,i);
1230 const size_t block( 64UL );
1232 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1234 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
1236 for(
size_t i=0UL; i<A.columns(); ++i )
1238 const ConstIterator
end( A.end(i) );
1239 ConstIterator element( A.begin(i) );
1241 const size_t jbegin( ( IsUpper<MT5>::value )
1242 ?(
max( IsStrictlyUpper<MT5>::value ? i+1UL : i, jj ) )
1244 const size_t jend( ( IsLower<MT5>::value )
1245 ?(
min( IsStrictlyLower<MT5>::value ? i : i+1UL, jpos ) )
1248 if( jbegin >= jend )
1251 for( ; element!=
end; ++element ) {
1252 for(
size_t j=jbegin; j<jend; ++j ) {
1253 C(element->index(),j) -= element->value() * B(i,j);
1277 template<
typename MT3
1280 static inline EnableIf_< UseDefaultKernel<MT3,MT4,MT5> >
1281 selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1283 selectDefaultSubAssignKernel( C, A, B );
1303 template<
typename MT3
1306 static inline EnableIf_< UseOptimizedKernel<MT3,MT4,MT5> >
1307 selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1311 const size_t block( IsRowMajorMatrix<MT3>::value ? 128UL : 64UL );
1313 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1315 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
1317 for(
size_t i=0UL; i<A.columns(); ++i )
1319 const size_t jbegin( ( IsUpper<MT5>::value )
1320 ?(
max( IsStrictlyUpper<MT5>::value ? i+1UL : i, jj ) )
1322 const size_t jend( ( IsLower<MT5>::value )
1323 ?(
min( IsStrictlyLower<MT5>::value ? i : i+1UL, jpos ) )
1326 if( jbegin >= jend )
1329 const ConstIterator
end( A.end(i) );
1330 ConstIterator element( A.begin(i) );
1332 const size_t nonzeros( A.nonZeros(i) );
1333 const size_t kpos( nonzeros &
size_t(-4) );
1336 for(
size_t k=0UL; k<kpos; k+=4UL )
1338 const size_t i1( element->index() );
1339 const ET1 v1( element->value() );
1341 const size_t i2( element->index() );
1342 const ET1 v2( element->value() );
1344 const size_t i3( element->index() );
1345 const ET1 v3( element->value() );
1347 const size_t i4( element->index() );
1348 const ET1 v4( element->value() );
1353 for(
size_t j=jbegin; j<jend; ++j ) {
1354 C(i1,j) -= v1 * B(i,j);
1355 C(i2,j) -= v2 * B(i,j);
1356 C(i3,j) -= v3 * B(i,j);
1357 C(i4,j) -= v4 * B(i,j);
1361 for( ; element!=
end; ++element ) {
1362 for(
size_t j=jbegin; j<jend; ++j ) {
1363 C(element->index(),j) -= element->value() * B(i,j);
1386 template<
typename MT3
1389 static inline EnableIf_< UseDefaultKernel<MT3,MT4,MT5> >
1390 selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1392 selectDefaultSubAssignKernel( C, A, B );
1412 template<
typename MT3
1415 static inline EnableIf_< UseOptimizedKernel<MT3,MT4,MT5> >
1416 selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1420 const OppositeType_<MT4> tmp(
serial( A ) );
1421 subAssign( C, tmp * B );
1441 template<
typename MT
1443 friend inline EnableIf_< CanExploitSymmetry<MT,MT1,MT2> >
1453 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
1454 subAssign( ~lhs,
trans( rhs.lhs_ ) *
trans( rhs.rhs_ ) );
1455 else if( IsSymmetric<MT1>::value )
1456 subAssign( ~lhs,
trans( rhs.lhs_ ) * rhs.rhs_ );
1458 subAssign( ~lhs, rhs.lhs_ *
trans( rhs.rhs_ ) );
1491 template<
typename MT
1493 friend inline EnableIf_< IsEvaluationRequired<MT,MT1,MT2> >
1532 template<
typename MT
1534 friend inline EnableIf_< IsEvaluationRequired<MT,MT1,MT2> >
1539 typedef IfTrue_< SO, ResultType, OppositeType > TmpType;
1551 const TmpType tmp( rhs );
1572 template<
typename MT
1574 friend inline EnableIf_< CanExploitSymmetry<MT,MT1,MT2> >
1584 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
1586 else if( IsSymmetric<MT1>::value )
1610 template<
typename MT
1612 friend inline EnableIf_< IsEvaluationRequired<MT,MT1,MT2> >
1650 template<
typename MT
1652 friend inline EnableIf_< CanExploitSymmetry<MT,MT1,MT2> >
1662 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
1664 else if( IsSymmetric<MT1>::value )
1692 template<
typename MT
1694 friend inline EnableIf_< IsEvaluationRequired<MT,MT1,MT2> >
1732 template<
typename MT
1734 friend inline EnableIf_< CanExploitSymmetry<MT,MT1,MT2> >
1744 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
1746 else if( IsSymmetric<MT1>::value )
1816 template<
typename T1
1818 inline const TSMatTDMatMultExpr<T1,T2>
1842 template<
typename MT1,
typename MT2 >
1859 template<
typename MT1,
typename MT2 >
1876 template<
typename MT1,
typename MT2 >
1894 template<
typename MT1,
typename MT2 >
1896 :
public BoolConstant< And< IsLower<MT1>, IsLower<MT2> >::value >
1912 template<
typename MT1,
typename MT2 >
1914 :
public BoolConstant< And< IsUniLower<MT1>, IsUniLower<MT2> >::value >
1930 template<
typename MT1,
typename MT2 >
1932 :
public BoolConstant< Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
1933 , And< IsStrictlyLower<MT2>, IsLower<MT1> > >::value >
1949 template<
typename MT1,
typename MT2 >
1951 :
public BoolConstant< And< IsUpper<MT1>, IsUpper<MT2> >::value >
1967 template<
typename MT1,
typename MT2 >
1969 :
public BoolConstant< And< IsUniUpper<MT1>, IsUniUpper<MT2> >::value >
1985 template<
typename MT1,
typename MT2 >
1987 :
public BoolConstant< Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
1988 , And< IsStrictlyUpper<MT2>, IsUpper<MT1> > >::value >
2004 template<
typename MT1,
typename MT2,
typename VT >
2009 using Type = If_< And< IsSparseMatrix<MT1>, IsColumnMajorMatrix<MT1>
2010 , IsDenseMatrix<MT2>, IsColumnMajorMatrix<MT2>
2011 , IsDenseVector<VT>, IsColumnVector<VT> >
2012 , TSMatDVecMultExprTrait_< MT1, TDMatDVecMultExprTrait_<MT2,VT> >
2022 template<
typename MT1,
typename MT2,
typename VT >
2027 using Type = If_< And< IsSparseMatrix<MT1>, IsColumnMajorMatrix<MT1>
2028 , IsDenseMatrix<MT2>, IsColumnMajorMatrix<MT2>
2029 , IsSparseVector<VT>, IsColumnVector<VT> >
2030 , TSMatDVecMultExprTrait_< MT1, TDMatSVecMultExprTrait_<MT2,VT> >
2040 template<
typename VT,
typename MT1,
typename MT2 >
2045 using Type = If_< And< IsDenseVector<VT>, IsRowVector<VT>
2046 , IsSparseMatrix<MT1>, IsColumnMajorMatrix<MT1>
2047 , IsDenseMatrix<MT2>, IsColumnMajorMatrix<MT2> >
2048 , TDVecTDMatMultExprTrait_< TDVecTSMatMultExprTrait_<VT,MT1>, MT2 >
2058 template<
typename VT,
typename MT1,
typename MT2 >
2063 using Type = If_< And< IsSparseVector<VT>, IsRowVector<VT>
2064 , IsSparseMatrix<MT1>, IsColumnMajorMatrix<MT1>
2065 , IsDenseMatrix<MT2>, IsColumnMajorMatrix<MT2> >
2066 , TSVecTDMatMultExprTrait_< TSVecTSMatMultExprTrait_<VT,MT1>, MT2 >
2076 template<
typename MT1,
typename MT2,
bool AF >
2081 using Type = MultExprTrait_< SubmatrixExprTrait_<const MT1,AF>
2082 , SubmatrixExprTrait_<const MT2,AF> >;
2091 template<
typename MT1,
typename MT2 >
2096 using Type = MultExprTrait_< RowExprTrait_<const MT1>, MT2 >;
2105 template<
typename MT1,
typename MT2 >
2110 using Type = MultExprTrait_< MT1, ColumnExprTrait_<const MT2> >;
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: TSMatTDMatMultExpr.h:211
Header file for auxiliary alias declarations.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:72
Header file for mathematical functions.
constexpr bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
ElementType_< ResultType > ElementType
Resulting element type.
Definition: TSMatTDMatMultExpr.h:212
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: TSMatTDMatMultExpr.h:307
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:7800
If_< IsExpression< MT1 >, const MT1, const MT1 & > LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatTDMatMultExpr.h:217
Compile time check for triangular matrix types.This type trait tests whether or not the given templat...
Definition: IsTriangular.h:87
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:146
IfTrue_< evaluateLeft, const RT1, CT1 > LT
Type for the assignment of the left-hand side sparse matrix operand.
Definition: TSMatTDMatMultExpr.h:223
EnableIf_< IsDenseMatrix< MT1 > > 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 IsSparseMatrix type trait.
Header file for the serial shim.
Header file for the IsDiagonal type trait.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
#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:61
Header file for the ColumnExprTrait class template.
TSMatTDMatMultExpr< MT1, MT2 > This
Type of this TSMatTDMatMultExpr instance.
Definition: TSMatTDMatMultExpr.h:208
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:188
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:533
Header file for the TSVecTSMatMultExprTrait class template.
Header file for the IsRowVector type trait.
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
Header file for the And class template.
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1669
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: TSMatTDMatMultExpr.h:333
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
IfTrue_< evaluateRight, const RT2, CT2 > RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: TSMatTDMatMultExpr.h:226
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:245
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:88
Constraints on the storage order of matrix types.
Header file for the RequiresEvaluation type trait.
System settings for performance optimizations.
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: TSMatTDMatMultExpr.h:210
Header file for the IsUniLower type trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1716
If_< IsExpression< MT2 >, const MT2, const MT2 & > RightOperand
Composite type of the right-hand side dense matrix expression.
Definition: TSMatTDMatMultExpr.h:220
EnableIf_< IsDenseMatrix< MT1 > > 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
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: TSMatTDMatMultExpr.h:365
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, ColumnExprTrait_< MT > > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:126
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:109
CompositeType_< MT1 > CT1
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatTDMatMultExpr.h:136
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
TSMatTDMatMultExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the TSMatTDMatMultExpr class.
Definition: TSMatTDMatMultExpr.h:244
Constraint on the data type.
Constraint on the data type.
Header file for the MultExprTrait class template.
ElementType_< RT1 > ET1
Element type of the left-hand side dense matrix expression.
Definition: TSMatTDMatMultExpr.h:134
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
SubvectorExprTrait_< VT, unaligned > subvector(Vector< VT, TF > &vector, size_t index, size_t size)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:152
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
RightOperand rightOperand() const noexcept
Returns the right-hand side transpose dense matrix operand.
Definition: TSMatTDMatMultExpr.h:353
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
Header file for the If class template.
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:83
#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:61
Header file for the TSVecTDMatMultExprTrait class template.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: TSMatTDMatMultExpr.h:377
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
EnableIf_< IsDenseMatrix< MT1 > > 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
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 exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
Header file for the Columns type trait.
Header file for the TSMatDVecMultExprTrait class template.
LeftOperand leftOperand() const noexcept
Returns the left-hand side transpose sparse matrix operand.
Definition: TSMatTDMatMultExpr.h:343
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Header file for the IsLower type trait.
RightOperand rhs_
Right-hand side dense matrix of the multiplication expression.
Definition: TSMatTDMatMultExpr.h:405
Header file for the IsAligned type trait.
ResultType_< MT2 > RT2
Result type of the right-hand side dense matrix expression.
Definition: TSMatTDMatMultExpr.h:133
Compile time check for diagonal matrices.This type trait tests whether or not the given template para...
Definition: IsDiagonal.h:90
ElementType_< RT2 > ET2
Element type of the right-hand side sparse matrix expression.
Definition: TSMatTDMatMultExpr.h:135
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: TSMatTDMatMultExpr.h:397
#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:60
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
Header file for the exception macros of the math module.
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
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:254
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.
#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:109
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, RowExprTrait_< MT > > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:126
LeftOperand lhs_
Left-hand side sparse matrix of the multiplication expression.
Definition: TSMatTDMatMultExpr.h:404
ResultType_< MT1 > RT1
Result type of the left-hand side sparse matrix expression.
Definition: TSMatTDMatMultExpr.h:132
const ResultType CompositeType
Data type for composite expression templates.
Definition: TSMatTDMatMultExpr.h:214
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:79
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:61
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: TSMatTDMatMultExpr.h:387
MultTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: TSMatTDMatMultExpr.h:209
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:83
Utility type for generic codes.
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:160
Header file for the reset shim.
Header file for the isDefault shim.
Constraints on the storage order of matrix types.
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
CompositeType_< MT2 > CT2
Composite type of the right-hand side dense matrix expression.
Definition: TSMatTDMatMultExpr.h:137
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
#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:84
Header file for the IsDenseVector type trait.
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.
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:950
Header file for the IsComputation type trait class.
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
Header file for the IntegralConstant class template.
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
Header file for the IsUpper type trait.
Header file for the IsColumnVector type trait.
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.
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: TSMatTDMatMultExpr.h:323
#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:61
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.