35 #ifndef _BLAZE_MATH_EXPRESSIONS_TSMATTDMATMULTEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_TSMATTDMATMULTEXPR_H_ 139 template<
typename MT1
145 class TSMatTDMatMultExpr :
public DenseMatrix< TSMatTDMatMultExpr<MT1,MT2,SF,HF,LF,UF>, true >
146 ,
private MatMatMultExpr
147 ,
private Computation
172 SYM = ( SF && !( HF || LF || UF ) ),
173 HERM = ( HF && !( LF || UF ) ),
174 LOW = ( LF || ( ( SF || HF ) && UF ) ),
175 UPP = ( UF || ( ( SF || HF ) && LF ) )
186 template<
typename T1,
typename T2,
typename T3 >
187 struct CanExploitSymmetry {
199 template<
typename T1,
typename T2,
typename T3 >
200 struct IsEvaluationRequired {
201 enum :
bool { value = ( evaluateLeft || evaluateRight ) &&
202 !CanExploitSymmetry<T1,T2,T3>::value };
213 template<
typename T1,
typename T2,
typename T3 >
214 struct UseOptimizedKernel {
228 template<
typename T1,
typename T2,
typename T3 >
229 struct UseDefaultKernel {
230 enum :
bool { value = !UseOptimizedKernel<T1,T2,T3>::value };
250 ,
Noop > > > > ForwardFunctor;
281 enum :
bool { simdEnabled =
false };
284 enum :
bool { smpAssignable = !evaluateLeft && MT1::smpAssignable &&
285 !evaluateRight && MT2::smpAssignable };
335 :(
lhs_.columns() ) ) );
339 const size_t n(
end - begin );
357 inline ReturnType
at(
size_t i,
size_t j )
const {
358 if( i >=
lhs_.rows() ) {
361 if( j >=
rhs_.columns() ) {
373 inline size_t rows() const noexcept {
384 return rhs_.columns();
414 template<
typename T >
415 inline bool canAlias(
const T* alias )
const noexcept {
416 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
426 template<
typename T >
427 inline bool isAliased(
const T* alias )
const noexcept {
428 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
438 return rhs_.isAligned();
471 template<
typename MT
481 LT A(
serial( rhs.lhs_ ) );
482 RT B(
serial( rhs.rhs_ ) );
491 TSMatTDMatMultExpr::selectAssignKernel( ~lhs, A, B );
507 template<
typename MT3
510 static inline void selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
512 const size_t size( C.rows() * C.columns() );
516 selectSmallAssignKernel( C, A, B );
518 selectLargeAssignKernel( C, A, B );
538 template<
typename MT3
541 static inline void selectDefaultAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
549 for(
size_t i=0UL; i<A.columns(); ++i )
551 const ConstIterator
end( A.end(i) );
552 ConstIterator element( A.begin(i) );
554 for( ; element!=
end; ++element ) {
555 C(element->index(),i) = element->value() * B(i,i);
561 const size_t block( 64UL );
563 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
565 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
567 for(
size_t i=0UL; i<A.columns(); ++i )
569 const ConstIterator
end( A.end(i) );
570 ConstIterator element( A.begin(i) );
572 for( ; element!=
end; ++element )
574 const size_t i1( element->index() );
577 ?( ( SYM || HERM || UPP )
580 :( SYM || HERM || UPP ?
max(i1,jj) : jj ) );
585 :( LOW ?
min(i1+1UL,jpos) : jpos ) );
590 for(
size_t j=jbegin; j<jend; ++j ) {
592 C(i1,j) = element->value() * B(i,j);
594 C(i1,j) += element->value() * B(i,j);
602 for(
size_t j=0UL; j<B.columns(); ++j ) {
603 for(
size_t i=j+1UL; i<A.rows(); ++i ) {
604 C(i,j) = HERM ?
conj( C(j,i) ) : C(j,i);
626 template<
typename MT3
630 selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
632 selectDefaultAssignKernel( C, A, B );
652 template<
typename MT3
656 selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
662 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
664 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
666 for(
size_t i=0UL; i<A.rows(); ++i ) {
667 for(
size_t j=jj; j<jpos; ++j ) {
672 for(
size_t i=0UL; i<A.columns(); ++i )
674 const ConstIterator
end( A.end(i) );
675 ConstIterator element( A.begin(i) );
677 const size_t nonzeros( A.nonZeros(i) );
678 const size_t kpos( nonzeros &
size_t(-4) );
681 for(
size_t k=0UL; k<kpos; k+=4UL )
683 const size_t i1( element->index() );
684 const ET1 v1( element->value() );
686 const size_t i2( element->index() );
687 const ET1 v2( element->value() );
689 const size_t i3( element->index() );
690 const ET1 v3( element->value() );
692 const size_t i4( element->index() );
693 const ET1 v4( element->value() );
699 ?( ( SYM || HERM || UPP )
702 :( SYM || HERM || UPP ?
max(i1,jj) : jj ) );
707 :( LOW ?
min(i4+1UL,jpos) : jpos ) );
712 for(
size_t j=jbegin; j<jend; ++j ) {
713 C(i1,j) += v1 * B(i,j);
714 C(i2,j) += v2 * B(i,j);
715 C(i3,j) += v3 * B(i,j);
716 C(i4,j) += v4 * B(i,j);
720 for( ; element!=
end; ++element )
722 const size_t i1( element->index() );
725 ?( ( SYM || HERM || UPP )
728 :( SYM || HERM || UPP ?
max(i1,jj) : jj ) );
733 :( LOW ?
min(i1+1UL,jpos) : jpos ) );
738 for(
size_t j=jbegin; j<jend; ++j ) {
739 C(i1,j) += element->value() * B(i,j);
746 for(
size_t j=0UL; j<B.columns(); ++j ) {
747 for(
size_t i=j+1UL; i<A.rows(); ++i ) {
748 C(i,j) = HERM ?
conj( C(j,i) ) : C(j,i);
770 template<
typename MT3
774 selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
776 selectDefaultAssignKernel( C, A, B );
796 template<
typename MT3
800 selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
804 const ForwardFunctor fwd;
807 assign( C, fwd( tmp * B ) );
825 template<
typename MT
844 const ForwardFunctor fwd;
846 const TmpType tmp(
serial( rhs ) );
847 assign( ~lhs, fwd( tmp ) );
867 template<
typename MT
879 const ForwardFunctor fwd;
882 assign( ~lhs, fwd(
trans( rhs.lhs_ ) *
trans( rhs.rhs_ ) ) );
884 assign( ~lhs, fwd(
trans( rhs.lhs_ ) * rhs.rhs_ ) );
886 assign( ~lhs, fwd( rhs.lhs_ *
trans( rhs.rhs_ ) ) );
904 template<
typename MT
914 LT A(
serial( rhs.lhs_ ) );
915 RT B(
serial( rhs.rhs_ ) );
924 TSMatTDMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
940 template<
typename MT3
943 static inline void selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
945 const size_t size( C.rows() * C.columns() );
949 selectSmallAddAssignKernel( C, A, B );
951 selectLargeAddAssignKernel( C, A, B );
971 template<
typename MT3
974 static inline void selectDefaultAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
980 for(
size_t i=0UL; i<A.columns(); ++i )
982 const ConstIterator
end( A.end(i) );
983 ConstIterator element( A.begin(i) );
985 for( ; element!=
end; ++element ) {
986 C(element->index(),i) += element->value() * B(i,i);
992 const size_t block( 64UL );
994 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
996 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
998 for(
size_t i=0UL; i<A.columns(); ++i )
1000 const ConstIterator
end( A.end(i) );
1001 ConstIterator element( A.begin(i) );
1003 for( ; element!=
end; ++element )
1005 const size_t i1( element->index() );
1011 :( UPP ?
max(i1,jj) : jj ) );
1016 :( LOW ?
min(i1+1UL,jpos) : jpos ) );
1018 if( jbegin >= jend )
1021 for(
size_t j=jbegin; j<jend; ++j ) {
1022 C(i1,j) += element->value() * B(i,j);
1046 template<
typename MT3
1050 selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1052 selectDefaultAddAssignKernel( C, A, B );
1072 template<
typename MT3
1076 selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1082 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1084 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
1086 for(
size_t i=0UL; i<A.columns(); ++i )
1088 const ConstIterator
end( A.end(i) );
1089 ConstIterator element( A.begin(i) );
1091 const size_t nonzeros( A.nonZeros(i) );
1092 const size_t kpos( nonzeros &
size_t(-4) );
1095 for(
size_t k=0UL; k<kpos; k+=4UL )
1097 const size_t i1( element->index() );
1098 const ET1 v1( element->value() );
1100 const size_t i2( element->index() );
1101 const ET1 v2( element->value() );
1103 const size_t i3( element->index() );
1104 const ET1 v3( element->value() );
1106 const size_t i4( element->index() );
1107 const ET1 v4( element->value() );
1116 :( UPP ?
max(i1,jj) : jj ) );
1121 :( LOW ?
min(i4+1UL,jpos) : jpos ) );
1123 if( jbegin >= jend )
1126 for(
size_t j=jbegin; j<jend; ++j ) {
1127 C(i1,j) += v1 * B(i,j);
1128 C(i2,j) += v2 * B(i,j);
1129 C(i3,j) += v3 * B(i,j);
1130 C(i4,j) += v4 * B(i,j);
1134 for( ; element!=
end; ++element )
1136 const size_t i1( element->index() );
1142 :( UPP ?
max(i1,jj) : jj ) );
1147 :( LOW ?
min(i1+1UL,jpos) : jpos ) );
1149 if( jbegin >= jend )
1152 for(
size_t j=jbegin; j<jend; ++j ) {
1153 C(i1,j) += element->value() * B(i,j);
1176 template<
typename MT3
1180 selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1182 selectDefaultAddAssignKernel( C, A, B );
1202 template<
typename MT3
1206 selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1210 const ForwardFunctor fwd;
1213 addAssign( C, fwd( tmp * B ) );
1233 template<
typename MT
1245 const ForwardFunctor fwd;
1248 addAssign( ~lhs, fwd(
trans( rhs.lhs_ ) *
trans( rhs.rhs_ ) ) );
1250 addAssign( ~lhs, fwd(
trans( rhs.lhs_ ) * rhs.rhs_ ) );
1252 addAssign( ~lhs, fwd( rhs.lhs_ *
trans( rhs.rhs_ ) ) );
1274 template<
typename MT
1284 LT A(
serial( rhs.lhs_ ) );
1285 RT B(
serial( rhs.rhs_ ) );
1294 TSMatTDMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1310 template<
typename MT3
1313 static inline void selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1315 const size_t size( C.rows() * C.columns() );
1319 selectSmallSubAssignKernel( C, A, B );
1321 selectLargeSubAssignKernel( C, A, B );
1341 template<
typename MT3
1344 static inline void selectDefaultSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1350 for(
size_t i=0UL; i<A.columns(); ++i )
1352 const ConstIterator
end( A.end(i) );
1353 ConstIterator element( A.begin(i) );
1355 for( ; element!=
end; ++element ) {
1356 C(element->index(),i) -= element->value() * B(i,i);
1362 const size_t block( 64UL );
1364 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1366 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
1368 for(
size_t i=0UL; i<A.columns(); ++i )
1370 const ConstIterator
end( A.end(i) );
1371 ConstIterator element( A.begin(i) );
1373 for( ; element!=
end; ++element )
1375 const size_t i1( element->index() );
1381 :( UPP ?
max(i1,jj) : jj ) );
1386 :( LOW ?
min(i1+1UL,jpos) : jpos ) );
1388 if( jbegin >= jend )
1391 for(
size_t j=jbegin; j<jend; ++j ) {
1392 C(i1,j) -= element->value() * B(i,j);
1416 template<
typename MT3
1420 selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1422 selectDefaultSubAssignKernel( C, A, B );
1442 template<
typename MT3
1446 selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1452 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1454 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
1456 for(
size_t i=0UL; i<A.columns(); ++i )
1458 const ConstIterator
end( A.end(i) );
1459 ConstIterator element( A.begin(i) );
1461 const size_t nonzeros( A.nonZeros(i) );
1462 const size_t kpos( nonzeros &
size_t(-4) );
1465 for(
size_t k=0UL; k<kpos; k+=4UL )
1467 const size_t i1( element->index() );
1468 const ET1 v1( element->value() );
1470 const size_t i2( element->index() );
1471 const ET1 v2( element->value() );
1473 const size_t i3( element->index() );
1474 const ET1 v3( element->value() );
1476 const size_t i4( element->index() );
1477 const ET1 v4( element->value() );
1486 :( UPP ?
max(i1,jj) : jj ) );
1491 :( LOW ?
min(i4+1UL,jpos) : jpos ) );
1493 if( jbegin >= jend )
1496 for(
size_t j=jbegin; j<jend; ++j ) {
1497 C(i1,j) -= v1 * B(i,j);
1498 C(i2,j) -= v2 * B(i,j);
1499 C(i3,j) -= v3 * B(i,j);
1500 C(i4,j) -= v4 * B(i,j);
1504 for( ; element!=
end; ++element )
1506 const size_t i1( element->index() );
1512 :( UPP ?
max(i1,jj) : jj ) );
1517 :( LOW ?
min(i1+1UL,jpos) : jpos ) );
1519 if( jbegin >= jend )
1522 for(
size_t j=jbegin; j<jend; ++j ) {
1523 C(i1,j) -= element->value() * B(i,j);
1546 template<
typename MT3
1550 selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1552 selectDefaultSubAssignKernel( C, A, B );
1572 template<
typename MT3
1576 selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1580 const ForwardFunctor fwd;
1583 subAssign( C, fwd( tmp * B ) );
1603 template<
typename MT
1615 const ForwardFunctor fwd;
1618 subAssign( ~lhs, fwd(
trans( rhs.lhs_ ) *
trans( rhs.rhs_ ) ) );
1620 subAssign( ~lhs, fwd(
trans( rhs.lhs_ ) * rhs.rhs_ ) );
1622 subAssign( ~lhs, fwd( rhs.lhs_ *
trans( rhs.rhs_ ) ) );
1655 template<
typename MT
1696 template<
typename MT
1715 const ForwardFunctor fwd;
1717 const TmpType tmp( rhs );
1738 template<
typename MT
1750 const ForwardFunctor fwd;
1778 template<
typename MT
1818 template<
typename MT
1830 const ForwardFunctor fwd;
1862 template<
typename MT
1902 template<
typename MT
1914 const ForwardFunctor fwd;
1988 template<
typename T1
2036 template<
typename MT1
2081 template<
typename MT1
2126 template<
typename MT1
2171 template<
typename MT1
2216 template<
typename MT1
2247 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2248 struct Rows< TSMatTDMatMultExpr<MT1,MT2,SF,HF,LF,UF> > :
public Rows<MT1>
2264 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2265 struct Columns< TSMatTDMatMultExpr<MT1,MT2,SF,HF,LF,UF> > :
public Columns<MT2>
2281 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2282 struct IsAligned< TSMatTDMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2299 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2300 struct IsSymmetric< TSMatTDMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2303 , IsBuiltin< ElementType_< TSMatTDMatMultExpr<MT1,MT2,false,true,false,false> > > >
2304 , And< Bool<LF>, Bool<UF> > >::value >
2320 template<
typename MT1,
typename MT2,
bool SF,
bool LF,
bool UF >
2321 struct IsHermitian< TSMatTDMatMultExpr<MT1,MT2,SF,true,LF,UF> >
2338 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2339 struct IsLower< TSMatTDMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2341 , And< IsLower<MT1>, IsLower<MT2> >
2342 , And< Or< Bool<SF>, Bool<HF> >
2343 , IsUpper<MT1>, IsUpper<MT2> > >::value >
2359 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2360 struct IsUniLower< TSMatTDMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2361 :
public BoolConstant< Or< And< IsUniLower<MT1>, IsUniLower<MT2> >
2362 , And< Or< Bool<SF>, Bool<HF> >
2363 , IsUniUpper<MT1>, IsUniUpper<MT2> > >::value >
2379 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2381 :
public BoolConstant< Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
2382 , And< IsStrictlyLower<MT2>, IsLower<MT1> >
2383 , And< Or< Bool<SF>, Bool<HF> >
2384 , Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
2385 , And< IsStrictlyUpper<MT2>, IsUpper<MT1> > > > >::value >
2401 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2402 struct IsUpper< TSMatTDMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2404 , And< IsUpper<MT1>, IsUpper<MT2> >
2405 , And< Or< Bool<SF>, Bool<HF> >
2406 , IsLower<MT1>, IsLower<MT2> > >::value >
2422 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2423 struct IsUniUpper< TSMatTDMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2424 :
public BoolConstant< Or< And< IsUniUpper<MT1>, IsUniUpper<MT2> >
2425 , And< Or< Bool<SF>, Bool<HF> >
2426 , IsUniLower<MT1>, IsUniLower<MT2> > >::value >
2442 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2444 :
public BoolConstant< Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
2445 , And< IsStrictlyUpper<MT2>, IsUpper<MT1> >
2446 , And< Or< Bool<SF>, Bool<HF> >
2447 , Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
2448 , And< IsStrictlyLower<MT2>, IsLower<MT1> > > > >::value >
2464 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF,
typename VT >
2482 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF,
typename VT >
2500 template<
typename VT,
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2518 template<
typename VT,
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2536 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2553 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2570 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2587 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2604 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2621 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF,
bool AF >
2636 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2637 struct RowExprTrait< TSMatTDMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2650 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
typename SubmatrixExprTrait< MT, AF >::Type SubmatrixExprTrait_
Auxiliary alias declaration for the SubmatrixExprTrait type trait.The SubmatrixExprTrait_ alias decla...
Definition: SubmatrixExprTrait.h:134
ElementType_< RT1 > ET1
Element type of the left-hand side dense matrix expression.
Definition: TSMatTDMatMultExpr.h:153
#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
Evaluation of the expression type of a dense matrix declherm operation.Via this type trait it is poss...
Definition: TDMatDeclHermExprTrait.h:75
Compile time check for row vector types.This type trait tests whether or not the given template argum...
Definition: IsRowVector.h:80
const DMatForEachExpr< MT, Conj, SO > conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatForEachExpr.h:1214
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
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: TSMatTDMatMultExpr.h:447
Evaluation of the expression type of a dense matrix decllow operation.Via this type trait it is possi...
Definition: TDMatDeclLowExprTrait.h:75
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
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
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:156
Flag for Hermitian matrices.
Definition: TSMatTDMatMultExpr.h:173
ElementType_< RT2 > ET2
Element type of the right-hand side sparse matrix expression.
Definition: TSMatTDMatMultExpr.h:154
typename TSVecTDMatMultExprTrait< VT, MT >::Type TSVecTDMatMultExprTrait_
Auxiliary alias declaration for the TSVecTDMatMultExprTrait class template.The TSVecTDMatMultExprTrai...
Definition: TSVecTDMatMultExprTrait.h:124
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.
TSMatTDMatMultExpr< MT1, MT2, SF, HF, LF, UF > This
Type of this TSMatTDMatMultExpr instance.
Definition: TSMatTDMatMultExpr.h:257
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:261
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
#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
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: TSMatTDMatMultExpr.h:437
Header file for the ColumnExprTrait class template.
Header file for the DeclUpp functor.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: TSMatTDMatMultExpr.h:427
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:194
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
MultTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: TSMatTDMatMultExpr.h:259
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:1755
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TSMatTDMatMultExpr.h:263
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
Evaluation of the expression type of a sparse vector/transpose dense matrix multiplication.Via this type trait it is possible to evaluate the resulting expression type of a sparse vector/transpose dense matrix multiplication. Given the transpose sparse vector type VT and the column-major dense matrix type MT, the nested type Type corresponds to the resulting expression type. In case either VT is not a transpose sparse vector type or MT is not a column-major dense matrix type, the resulting data type Type is set to INVALID_TYPE.
Definition: TSVecTDMatMultExprTrait.h:81
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.
DisableIf_< IsSymmetric< MT >, const DMatDeclSymExpr< MT, SO > > declsym(const DenseMatrix< MT, SO > &dm)
Declares the given non-symmetric dense matrix expression dm as symmetric.
Definition: DMatDeclSymExpr.h:841
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.
CompositeType_< MT2 > CT2
Composite type of the right-hand side dense matrix expression.
Definition: TSMatTDMatMultExpr.h:156
Header file for the TDMatDeclDiagExprTrait class template.
Header file for the RequiresEvaluation type trait.
System settings for performance optimizations.
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:1802
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
RightOperand rhs_
Right-hand side dense matrix of the multiplication expression.
Definition: TSMatTDMatMultExpr.h:455
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:71
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:119
Constraint on the data type.
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
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
Constraint on the data type.
Constraint on the data type.
typename MultExprTrait< T1, T2 >::Type MultExprTrait_
Auxiliary alias declaration for the MultExprTrait class template.The MultExprTrait_ alias declaration...
Definition: MultExprTrait.h:344
Header file for the MultExprTrait class template.
DisableIf_< IsHermitian< MT >, const DMatDeclHermExpr< MT, SO > > declherm(const DenseMatrix< MT, SO > &dm)
Declares the given non-Hermitian dense matrix expression dm as Hermitian.
Definition: DMatDeclHermExpr.h:841
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
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: TSMatTDMatMultExpr.h:415
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
Header file for the DisableIf class template.
Compile time check for dense vector types.This type trait tests whether or not the given template par...
Definition: IsDenseVector.h:78
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
CompositeType_< MT1 > CT1
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatTDMatMultExpr.h:155
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the DeclLow functor.
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.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2939
Evaluation of the expression type of a dense matrix declupp operation.Via this type trait it is possi...
Definition: TDMatDeclUppExprTrait.h:75
ResultType_< MT2 > RT2
Result type of the right-hand side dense matrix expression.
Definition: TSMatTDMatMultExpr.h:152
Generic wrapper for the decllow() function.
Definition: DeclLow.h:58
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.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: TSMatTDMatMultExpr.h:309
Header file for the TDMatDeclHermExprTrait 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.
LeftOperand lhs_
Left-hand side sparse matrix of the multiplication expression.
Definition: TSMatTDMatMultExpr.h:454
Header file for the TSMatDVecMultExprTrait class template.
If_< IsExpression< MT1 >, const MT1, const MT1 &> LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatTDMatMultExpr.h:267
Header file for the TDMatDeclUppExprTrait class template.
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
TSMatTDMatMultExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the TSMatTDMatMultExpr class.
Definition: TSMatTDMatMultExpr.h:294
Evaluation of the expression type of a dense matrix decldiag operation.Via this type trait it is poss...
Definition: TDMatDeclDiagExprTrait.h:75
Compile time check for sparse vector types.This type trait tests whether or not the given template pa...
Definition: IsSparseVector.h:78
Evaluation of the expression type type of a submatrix operation.Via this type trait it is possible to...
Definition: SubmatrixExprTrait.h:80
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
Compile time check for diagonal matrices.This type trait tests whether or not the given template para...
Definition: IsDiagonal.h:90
typename TSMatDVecMultExprTrait< MT, VT >::Type TSMatDVecMultExprTrait_
Auxiliary alias declaration for the TSMatDVecMultExprTrait class template.The TSMatDVecMultExprTrait_...
Definition: TSMatDVecMultExprTrait.h:124
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT >, IsDeclExpr< 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:128
#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
Generic wrapper for the null function.
Definition: Noop.h:58
Header file for the IsTriangular type trait.
Compile time check for column vector types.This type trait tests whether or not the given template ar...
Definition: IsColumnVector.h:80
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: TSMatTDMatMultExpr.h:373
Evaluation of the expression type of a dense matrix declsym operation.Via this type trait it is possi...
Definition: TDMatDeclSymExprTrait.h:75
LeftOperand leftOperand() const noexcept
Returns the left-hand side transpose sparse matrix operand.
Definition: TSMatTDMatMultExpr.h:393
Constraints on the storage order of matrix types.
Compile time check for symmetric matrices.This type trait tests whether or not the given template par...
Definition: IsSymmetric.h:85
Header file for the exception macros of the math module.
DisableIf_< IsLower< MT >, const DMatDeclLowExpr< MT, SO > > decllow(const DenseMatrix< MT, SO > &dm)
Declares the given non-lower dense matrix expression dm as lower.
Definition: DMatDeclLowExpr.h:842
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Evaluation of the expression type type of a row operation.Via this type trait it is possible to evalu...
Definition: RowExprTrait.h:79
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:260
Header file for the DeclDiag functor.
Compile time check for dense matrix types.This type trait tests whether or not the given template par...
Definition: IsDenseMatrix.h:78
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Header file for the IsDenseMatrix type trait.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT >, IsDeclExpr< 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:128
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
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:86
Header file for the conjugate shim.
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:75
Evaluation of the expression type of a transpose dense matrix/sparse vector multiplication.Via this type trait it is possible to evaluate the resulting expression type of a transpose dense matrix/sparse vector multiplication. Given the column-major dense matrix type MT and the non-transpose sparse vector type VT, the nested type Type corresponds to the resulting expression type. In case either MT is not a column-major dense matrix type or VT is not a non-transpose sparse vector type, the resulting data type Type is set to INVALID_TYPE.
Definition: TDMatSVecMultExprTrait.h:79
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
typename TDVecTDMatMultExprTrait< VT, MT >::Type TDVecTDMatMultExprTrait_
Auxiliary alias declaration for the TDVecTDMatMultExprTrait class template.The TDVecTDMatMultExprTrai...
Definition: TDVecTDMatMultExprTrait.h:120
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
ResultType_< MT1 > RT1
Result type of the left-hand side sparse matrix expression.
Definition: TSMatTDMatMultExpr.h:151
Utility type for generic codes.
Header file for the TDMatDeclLowExprTrait class template.
If_< IsExpression< MT2 >, const MT2, const MT2 &> RightOperand
Composite type of the right-hand side dense matrix expression.
Definition: TSMatTDMatMultExpr.h:270
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.
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:93
Header file for the isDefault shim.
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:94
Flag for upper matrices.
Definition: TSMatTDMatMultExpr.h:175
Constraints on the storage order of matrix types.
const ResultType CompositeType
Data type for composite expression templates.
Definition: TSMatTDMatMultExpr.h:264
Generic wrapper for the declherm() function.
Definition: DeclHerm.h:58
Header file for the TDMatDeclSymExprTrait class template.
Header file for the Noop functor.
IfTrue_< evaluateRight, const RT2, CT2 > RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: TSMatTDMatMultExpr.h:276
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
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.
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: TSMatTDMatMultExpr.h:261
Generic wrapper for the declupp() function.
Definition: DeclUpp.h:58
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
Evaluation of the expression type of a dense vector/transpose dense matrix multiplication.Via this type trait it is possible to evaluate the resulting expression type of a dense vector/transpose dense matrix multiplication. Given the transpose dense vector type VT and the column-major dense matrix type MT, the nested type Type corresponds to the resulting expression type. In case either VT is not a transpose dense vector type or MT is not a column-major dense matrix type, the resulting data type Type is set to INVALID_TYPE.
Definition: TDVecTDMatMultExprTrait.h:79
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:733
Header file for the IsComputation type trait class.
RightOperand rightOperand() const noexcept
Returns the right-hand side transpose dense matrix operand.
Definition: TSMatTDMatMultExpr.h:403
Header file for the IsBuiltin type trait.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: TSMatTDMatMultExpr.h:383
Header file for the TDMatDVecMultExprTrait class template.
Evaluation of the expression type of a transpose dense matrix/dense vector multiplication.Via this type trait it is possible to evaluate the resulting expression type of a transpose dense matrix/dense vector multiplication. Given the column-major dense matrix type MT and the non-transpose dense vector type VT, the nested type Type corresponds to the resulting expression type. In case either MT is not a column-major dense matrix type or VT is not a non-transpose dense vector type, the resulting data type Type is set to INVALID_TYPE.
Definition: TDMatDVecMultExprTrait.h:79
Header file for the IntegralConstant class template.
Compile time evaluation of the number of columns of a matrix.The Columns type trait evaluates the num...
Definition: Columns.h:76
Generic wrapper for the decldiag() function.
Definition: DeclDiag.h:58
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:76
Compile time check for sparse matrix types.This type trait tests whether or not the given template pa...
Definition: IsSparseMatrix.h:78
ElementType_< ResultType > ElementType
Resulting element type.
Definition: TSMatTDMatMultExpr.h:262
Header file for the DeclHerm functor.
Flag for lower matrices.
Definition: TSMatTDMatMultExpr.h:174
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
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.
Flag for symmetric matrices.
Definition: TSMatTDMatMultExpr.h:172
Header file for the IsColumnVector type trait.
Constraint on the data type.
Generic wrapper for the declsym() function.
Definition: DeclSym.h:58
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:677
Header file for the IsResizable type trait.
const DMatDMatMultExpr< T1, T2, false, false, false, false > 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:7505
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
DisableIf_< IsDiagonal< MT >, const DMatDeclDiagExpr< MT, SO > > decldiag(const DenseMatrix< MT, SO > &dm)
Declares the given non-diagonal dense matrix expression dm as diagonal.
Definition: DMatDeclDiagExpr.h:841
DisableIf_< IsUpper< MT >, const DMatDeclUppExpr< MT, SO > > declupp(const DenseMatrix< MT, SO > &dm)
Declares the given non-upper dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:842
Evaluation of the expression type type of a column operation.Via this type trait it is possible to ev...
Definition: ColumnExprTrait.h:78
#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 Bool class template.
Header file for the TDVecTDMatMultExprTrait class template.
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: TSMatTDMatMultExpr.h:260
Header file for the DeclSym functor.
#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
IfTrue_< evaluateLeft, const RT1, CT1 > LT
Type for the assignment of the left-hand side sparse matrix operand.
Definition: TSMatTDMatMultExpr.h:273
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: TSMatTDMatMultExpr.h:357