35 #ifndef _BLAZE_MATH_EXPRESSIONS_TDMATSMATMULTEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_TDMATSMATMULTEXPR_H_ 118 template<
typename MT1
124 class TDMatSMatMultExpr
125 :
public MatMatMultExpr< DenseMatrix< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>, true > >
126 ,
private Computation
151 SYM = ( SF && !( HF || LF || UF ) ),
152 HERM = ( HF && !( LF || UF ) ),
153 LOW = ( LF || ( ( SF || HF ) && UF ) ),
154 UPP = ( UF || ( ( SF || HF ) && LF ) )
165 template<
typename T1,
typename T2,
typename T3 >
166 struct CanExploitSymmetry {
178 template<
typename T1,
typename T2,
typename T3 >
179 struct IsEvaluationRequired {
180 enum :
bool { value = ( evaluateLeft || evaluateRight ) &&
181 !CanExploitSymmetry<T1,T2,T3>::value };
192 template<
typename T1,
typename T2,
typename T3 >
193 struct UseOptimizedKernel {
194 enum :
bool { value = useOptimizedKernels &&
207 template<
typename T1,
typename T2,
typename T3 >
208 struct UseDefaultKernel {
209 enum :
bool { value = !UseOptimizedKernel<T1,T2,T3>::value };
260 enum :
bool { simdEnabled =
false };
263 enum :
bool { smpAssignable = !evaluateLeft && MT1::smpAssignable &&
264 !evaluateRight && MT2::smpAssignable };
314 :(
lhs_.columns() ) ) );
318 const size_t n(
end - begin );
337 if( i >=
lhs_.rows() ) {
340 if( j >=
rhs_.columns() ) {
352 inline size_t rows() const noexcept {
363 return rhs_.columns();
393 template<
typename T >
394 inline bool canAlias(
const T* alias )
const noexcept {
395 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
405 template<
typename T >
407 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
417 return lhs_.isAligned();
450 template<
typename MT
470 TDMatSMatMultExpr::selectAssignKernel( ~lhs, A, B );
486 template<
typename MT3
489 static inline void selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
491 if( C.rows() * C.columns() < TDMATSMATMULT_THRESHOLD )
492 selectSmallAssignKernel( C, A, B );
494 selectLargeAssignKernel( C, A, B );
514 template<
typename MT3
517 static inline void selectDefaultAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
523 for(
size_t j=0UL; j<B.rows(); ++j )
530 for( ; element!=
end; ++element ) {
531 C(j,element->index()) = A(j,j) * element->value();
536 for( ; element!=
end; ++element )
538 const size_t j1( element->index() );
542 ?( SYM || HERM || LOW ?
max(j1,j+1UL) : j+1UL )
543 :( SYM || HERM || LOW ?
max(j1,j) : j ) )
544 :( SYM || HERM || LOW ? j1 : 0UL ) );
547 ?( UPP ?
min(j1+1UL,j) : j )
548 :( UPP ?
min(j1,j)+1UL : j+1UL ) )
549 :( UPP ? j1+1UL : A.rows() ) );
551 if( ( SYM || HERM || LOW || UPP ) && ( ibegin >= iend ) )
continue;
554 for(
size_t i=ibegin; i<iend; ++i ) {
556 C(i,j1) = A(i,j) * element->value();
558 C(i,j1) += A(i,j) * element->value();
565 for(
size_t j=1UL; j<B.columns(); ++j ) {
566 for(
size_t i=0UL; i<j; ++i ) {
567 C(i,j) = HERM ?
conj( C(j,i) ) : C(j,i);
589 template<
typename MT3
593 selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
595 selectDefaultAssignKernel( C, A, B );
615 template<
typename MT3
619 selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
625 for(
size_t j=0UL; j<B.rows(); ++j )
630 const size_t nonzeros( B.nonZeros(j) );
631 const size_t kpos( nonzeros &
size_t(-4) );
634 for(
size_t k=0UL; k<kpos; k+=4UL )
636 const size_t j1( element->index() );
637 const ET2 v1( element->value() );
639 const size_t j2( element->index() );
640 const ET2 v2( element->value() );
642 const size_t j3( element->index() );
643 const ET2 v3( element->value() );
645 const size_t j4( element->index() );
646 const ET2 v4( element->value() );
653 ?( SYM || HERM || LOW ?
max(j1,j+1UL) : j+1UL )
654 :( SYM || HERM || LOW ?
max(j1,j) : j ) )
655 :( SYM || HERM || LOW ? j1 : 0UL ) );
658 ?( UPP ?
min(j4+1UL,j) : j )
659 :( UPP ?
min(j4,j)+1UL : j+1UL ) )
660 :( UPP ? j4+1UL : A.rows() ) );
662 if( ( SYM || HERM || LOW || UPP ) && ( ibegin >= iend ) )
continue;
665 const size_t inum( iend - ibegin );
666 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
671 for( ; i<ipos; i+=4UL ) {
672 C(i ,j1) += A(i ,j) * v1;
673 C(i+1UL,j1) += A(i+1UL,j) * v1;
674 C(i+2UL,j1) += A(i+2UL,j) * v1;
675 C(i+3UL,j1) += A(i+3UL,j) * v1;
676 C(i ,j2) += A(i ,j) * v2;
677 C(i+1UL,j2) += A(i+1UL,j) * v2;
678 C(i+2UL,j2) += A(i+2UL,j) * v2;
679 C(i+3UL,j2) += A(i+3UL,j) * v2;
680 C(i ,j3) += A(i ,j) * v3;
681 C(i+1UL,j3) += A(i+1UL,j) * v3;
682 C(i+2UL,j3) += A(i+2UL,j) * v3;
683 C(i+3UL,j3) += A(i+3UL,j) * v3;
684 C(i ,j4) += A(i ,j) * v4;
685 C(i+1UL,j4) += A(i+1UL,j) * v4;
686 C(i+2UL,j4) += A(i+2UL,j) * v4;
687 C(i+3UL,j4) += A(i+3UL,j) * v4;
689 for( ; i<iend; ++i ) {
690 C(i,j1) += A(i,j) * v1;
691 C(i,j2) += A(i,j) * v2;
692 C(i,j3) += A(i,j) * v3;
693 C(i,j4) += A(i,j) * v4;
697 for( ; element!=
end; ++element )
699 const size_t j1( element->index() );
700 const ET2 v1( element->value() );
704 ?( SYM || HERM || LOW ?
max(j1,j+1UL) : j+1UL )
705 :( SYM || HERM || LOW ?
max(j1,j) : j ) )
706 :( SYM || HERM || LOW ? j1 : 0UL ) );
709 ?( UPP ?
min(j1+1UL,j) : j )
710 :( UPP ?
min(j1,j)+1UL : j+1UL ) )
711 :( UPP ? j1+1UL : A.rows() ) );
713 if( ( SYM || HERM || LOW || UPP ) && ( ibegin >= iend ) )
continue;
716 const size_t inum( iend - ibegin );
717 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
722 for( ; i<ipos; i+=4UL ) {
723 C(i ,j1) += A(i ,j) * v1;
724 C(i+1UL,j1) += A(i+1UL,j) * v1;
725 C(i+2UL,j1) += A(i+2UL,j) * v1;
726 C(i+3UL,j1) += A(i+3UL,j) * v1;
728 for( ; i<iend; ++i ) {
729 C(i,j1) += A(i,j) * v1;
735 for(
size_t j=1UL; j<B.columns(); ++j ) {
736 for(
size_t i=0UL; i<j; ++i ) {
737 C(i,j) = HERM ?
conj( C(j,i) ) : C(j,i);
759 template<
typename MT3
763 selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
765 selectDefaultAssignKernel( C, A, B );
785 template<
typename MT3
789 selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
793 const ForwardFunctor fwd;
796 assign( C, fwd( A * tmp ) );
814 template<
typename MT
833 const ForwardFunctor fwd;
835 const TmpType tmp(
serial( rhs ) );
836 assign( ~lhs, fwd( tmp ) );
856 template<
typename MT
868 const ForwardFunctor fwd;
870 assign( ~lhs, fwd( rhs.lhs_ *
trans( rhs.rhs_ ) ) );
888 template<
typename MT
908 TDMatSMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
924 template<
typename MT3
927 static inline void selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
929 if( C.rows() * C.columns() < TDMATSMATMULT_THRESHOLD )
930 selectSmallAddAssignKernel( C, A, B );
932 selectLargeAddAssignKernel( C, A, B );
952 template<
typename MT3
955 static inline void selectDefaultAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
961 for(
size_t j=0UL; j<B.rows(); ++j )
968 for( ; element!=
end; ++element ) {
969 C(j,element->index()) += A(j,j) * element->value();
974 for( ; element!=
end; ++element )
976 const size_t j1( element->index() );
980 ?( LOW ?
max(j1,j+1UL) : j+1UL )
981 :( LOW ?
max(j1,j) : j ) )
982 :( LOW ? j1 : 0UL ) );
985 ?( UPP ?
min(j1+1UL,j) : j )
986 :( UPP ?
min(j1,j)+1UL : j+1UL ) )
987 :( UPP ? j1+1UL : A.rows() ) );
989 if( ( LOW || UPP ) && ( ibegin >= iend ) )
continue;
992 const size_t inum( iend - ibegin );
993 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
996 for( i=ibegin; i<ipos; i+=4UL ) {
997 C(i ,j1) += A(i ,j) * element->value();
998 C(i+1UL,j1) += A(i+1UL,j) * element->value();
999 C(i+2UL,j1) += A(i+2UL,j) * element->value();
1000 C(i+3UL,j1) += A(i+3UL,j) * element->value();
1002 for( ; i<iend; ++i ) {
1003 C(i,j1) += A(i,j) * element->value();
1026 template<
typename MT3
1030 selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1032 selectDefaultAddAssignKernel( C, A, B );
1052 template<
typename MT3
1056 selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1060 for(
size_t j=0UL; j<B.rows(); ++j )
1065 const size_t nonzeros( B.nonZeros(j) );
1066 const size_t kpos( nonzeros &
size_t(-4) );
1069 for(
size_t k=0UL; k<kpos; k+=4UL )
1071 const size_t j1( element->index() );
1072 const ET2 v1( element->value() );
1074 const size_t j2( element->index() );
1075 const ET2 v2( element->value() );
1077 const size_t j3( element->index() );
1078 const ET2 v3( element->value() );
1080 const size_t j4( element->index() );
1081 const ET2 v4( element->value() );
1088 ?( LOW ?
max(j1,j+1UL) : j+1UL )
1089 :( LOW ?
max(j1,j) : j ) )
1090 :( LOW ? j1 : 0UL ) );
1093 ?( UPP ?
min(j4+1UL,j) : j )
1094 :( UPP ?
min(j4,j)+1UL : j+1UL ) )
1095 :( UPP ? j4+1UL : A.rows() ) );
1097 if( ( LOW || UPP ) && ( ibegin >= iend ) )
continue;
1100 const size_t inum( iend - ibegin );
1101 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
1106 for( i=ibegin; i<ipos; i+=4UL ) {
1107 C(i ,j1) += A(i ,j) * v1;
1108 C(i+1UL,j1) += A(i+1UL,j) * v1;
1109 C(i+2UL,j1) += A(i+2UL,j) * v1;
1110 C(i+3UL,j1) += A(i+3UL,j) * v1;
1111 C(i ,j2) += A(i ,j) * v2;
1112 C(i+1UL,j2) += A(i+1UL,j) * v2;
1113 C(i+2UL,j2) += A(i+2UL,j) * v2;
1114 C(i+3UL,j2) += A(i+3UL,j) * v2;
1115 C(i ,j3) += A(i ,j) * v3;
1116 C(i+1UL,j3) += A(i+1UL,j) * v3;
1117 C(i+2UL,j3) += A(i+2UL,j) * v3;
1118 C(i+3UL,j3) += A(i+3UL,j) * v3;
1119 C(i ,j4) += A(i ,j) * v4;
1120 C(i+1UL,j4) += A(i+1UL,j) * v4;
1121 C(i+2UL,j4) += A(i+2UL,j) * v4;
1122 C(i+3UL,j4) += A(i+3UL,j) * v4;
1124 for( ; i<iend; ++i ) {
1125 C(i,j1) += A(i,j) * v1;
1126 C(i,j2) += A(i,j) * v2;
1127 C(i,j3) += A(i,j) * v3;
1128 C(i,j4) += A(i,j) * v4;
1132 for( ; element!=
end; ++element )
1134 const size_t j1( element->index() );
1135 const ET2 v1( element->value() );
1139 ?( LOW ?
max(j1,j+1UL) : j+1UL )
1140 :( LOW ?
max(j1,j) : j ) )
1141 :( LOW ? j1 : 0UL ) );
1144 ?( UPP ?
min(j1+1UL,j) : j )
1145 :( UPP ?
min(j1,j)+1UL : j+1UL ) )
1146 :( UPP ? j1+1UL : A.rows() ) );
1148 if( ( LOW || UPP ) && ( ibegin >= iend ) )
continue;
1151 const size_t inum( iend - ibegin );
1152 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
1157 for( ; i<ipos; i+=4UL ) {
1158 C(i ,j1) += A(i ,j) * v1;
1159 C(i+1UL,j1) += A(i+1UL,j) * v1;
1160 C(i+2UL,j1) += A(i+2UL,j) * v1;
1161 C(i+3UL,j1) += A(i+3UL,j) * v1;
1163 for( ; i<iend; ++i ) {
1164 C(i,j1) += A(i,j) * v1;
1186 template<
typename MT3
1190 selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1192 selectDefaultAddAssignKernel( C, A, B );
1212 template<
typename MT3
1216 selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1220 const ForwardFunctor fwd;
1223 addAssign( C, fwd( A * tmp ) );
1243 template<
typename MT
1253 const ForwardFunctor fwd;
1255 addAssign( ~lhs, fwd( rhs.lhs_ *
trans( rhs.rhs_ ) ) );
1277 template<
typename MT
1297 TDMatSMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1313 template<
typename MT3
1316 static inline void selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1318 if( C.rows() * C.columns() < TDMATSMATMULT_THRESHOLD )
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 j=0UL; j<B.rows(); ++j )
1357 for( ; element!=
end; ++element ) {
1358 C(j,element->index()) -= A(j,j) * element->value();
1363 for( ; element!=
end; ++element )
1365 const size_t j1( element->index() );
1369 ?( LOW ?
max(j1,j+1UL) : j+1UL )
1370 :( LOW ?
max(j1,j) : j ) )
1371 :( LOW ? j1 : 0UL ) );
1374 ?( UPP ?
min(j1+1UL,j) : j )
1375 :( UPP ?
min(j1,j)+1UL : j+1UL ) )
1376 :( UPP ? j1+1UL : A.rows() ) );
1378 if( ( LOW || UPP ) && ( ibegin >= iend ) )
continue;
1381 const size_t inum( iend - ibegin );
1382 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
1385 for( i=ibegin; i<ipos; i+=4UL ) {
1386 C(i ,j1) -= A(i ,j) * element->value();
1387 C(i+1UL,j1) -= A(i+1UL,j) * element->value();
1388 C(i+2UL,j1) -= A(i+2UL,j) * element->value();
1389 C(i+3UL,j1) -= A(i+3UL,j) * element->value();
1391 for( ; i<iend; ++i ) {
1392 C(i,j1) -= A(i,j) * element->value();
1415 template<
typename MT3
1419 selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1421 selectDefaultSubAssignKernel( C, A, B );
1441 template<
typename MT3
1445 selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1449 for(
size_t j=0UL; j<B.rows(); ++j )
1454 const size_t nonzeros( B.nonZeros(j) );
1455 const size_t kpos( nonzeros &
size_t(-4) );
1458 for(
size_t k=0UL; k<kpos; k+=4UL )
1460 const size_t j1( element->index() );
1461 const ET2 v1( element->value() );
1463 const size_t j2( element->index() );
1464 const ET2 v2( element->value() );
1466 const size_t j3( element->index() );
1467 const ET2 v3( element->value() );
1469 const size_t j4( element->index() );
1470 const ET2 v4( element->value() );
1477 ?( LOW ?
max(j1,j+1UL) : j+1UL )
1478 :( LOW ?
max(j1,j) : j ) )
1479 :( LOW ? j1 : 0UL ) );
1482 ?( UPP ?
min(j4+1UL,j) : j )
1483 :( UPP ?
min(j4,j)+1UL : j+1UL ) )
1484 :( UPP ? j4+1UL : A.rows() ) );
1486 if( ( LOW || UPP ) && ( ibegin >= iend ) )
continue;
1489 const size_t inum( iend - ibegin );
1490 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
1495 for( ; i<ipos; i+=4UL ) {
1496 C(i ,j1) -= A(i ,j) * v1;
1497 C(i+1UL,j1) -= A(i+1UL,j) * v1;
1498 C(i+2UL,j1) -= A(i+2UL,j) * v1;
1499 C(i+3UL,j1) -= A(i+3UL,j) * v1;
1500 C(i ,j2) -= A(i ,j) * v2;
1501 C(i+1UL,j2) -= A(i+1UL,j) * v2;
1502 C(i+2UL,j2) -= A(i+2UL,j) * v2;
1503 C(i+3UL,j2) -= A(i+3UL,j) * v2;
1504 C(i ,j3) -= A(i ,j) * v3;
1505 C(i+1UL,j3) -= A(i+1UL,j) * v3;
1506 C(i+2UL,j3) -= A(i+2UL,j) * v3;
1507 C(i+3UL,j3) -= A(i+3UL,j) * v3;
1508 C(i ,j4) -= A(i ,j) * v4;
1509 C(i+1UL,j4) -= A(i+1UL,j) * v4;
1510 C(i+2UL,j4) -= A(i+2UL,j) * v4;
1511 C(i+3UL,j4) -= A(i+3UL,j) * v4;
1513 for( ; i<iend; ++i ) {
1514 C(i,j1) -= A(i,j) * v1;
1515 C(i,j2) -= A(i,j) * v2;
1516 C(i,j3) -= A(i,j) * v3;
1517 C(i,j4) -= A(i,j) * v4;
1521 for( ; element!=
end; ++element )
1523 const size_t j1( element->index() );
1524 const ET2 v1( element->value() );
1528 ?( LOW ?
max(j1,j+1UL) : j+1UL )
1529 :( LOW ?
max(j1,j) : j ) )
1530 :( LOW ? j1 : 0UL ) );
1533 ?( UPP ?
min(j1+1UL,j) : j )
1534 :( UPP ?
min(j1,j)+1UL : j+1UL ) )
1535 :( UPP ? j1+1UL : A.rows() ) );
1537 if( ( LOW || UPP ) && ( ibegin >= iend ) )
continue;
1540 const size_t inum( iend - ibegin );
1541 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
1546 for( ; i<ipos; i+=4UL ) {
1547 C(i ,j1) -= A(i ,j) * v1;
1548 C(i+1UL,j1) -= A(i+1UL,j) * v1;
1549 C(i+2UL,j1) -= A(i+2UL,j) * v1;
1550 C(i+3UL,j1) -= A(i+3UL,j) * v1;
1552 for( ; i<iend; ++i ) {
1553 C(i,j1) -= A(i,j) * v1;
1575 template<
typename MT3
1579 selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1581 selectDefaultSubAssignKernel( C, A, B );
1601 template<
typename MT3
1605 selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1609 const ForwardFunctor fwd;
1612 subAssign( C, fwd( A * tmp ) );
1632 template<
typename MT
1644 const ForwardFunctor fwd;
1646 subAssign( ~lhs, fwd( rhs.lhs_ *
trans( rhs.rhs_ ) ) );
1668 template<
typename MT
1682 schurAssign( ~lhs, tmp );
1715 template<
typename MT
1756 template<
typename MT
1775 const ForwardFunctor fwd;
1777 const TmpType tmp( rhs );
1798 template<
typename MT
1808 const ForwardFunctor fwd;
1831 template<
typename MT
1871 template<
typename MT
1883 const ForwardFunctor fwd;
1910 template<
typename MT
1950 template<
typename MT
1962 const ForwardFunctor fwd;
1986 template<
typename MT
2068 template<
typename MT1
2070 inline decltype(
auto)
2119 template<
typename MT1
2134 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2165 template<
typename MT1
2180 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2211 template<
typename MT1
2226 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2257 template<
typename MT1
2272 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2303 template<
typename MT1
2318 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2334 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2335 struct Rows< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2352 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2353 struct Columns< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2370 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2371 struct IsAligned< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2388 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2389 struct IsSymmetric< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2392 , IsBuiltin< ElementType_< TDMatSMatMultExpr<MT1,MT2,false,true,false,false> > > >
2393 , And< Bool<LF>, Bool<UF> > >::value >
2409 template<
typename MT1,
typename MT2,
bool SF,
bool LF,
bool UF >
2410 struct IsHermitian< TDMatSMatMultExpr<MT1,MT2,SF,true,LF,UF> >
2427 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2428 struct IsLower< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2430 , And< IsLower<MT1>, IsLower<MT2> >
2431 , And< Or< Bool<SF>, Bool<HF> >
2432 , IsUpper<MT1>, IsUpper<MT2> > >::value >
2448 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2449 struct IsUniLower< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2450 :
public BoolConstant< Or< And< IsUniLower<MT1>, IsUniLower<MT2> >
2451 , And< Or< Bool<SF>, Bool<HF> >
2452 , IsUniUpper<MT1>, IsUniUpper<MT2> > >::value >
2468 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2470 :
public BoolConstant< Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
2471 , And< IsStrictlyLower<MT2>, IsLower<MT1> >
2472 , And< Or< Bool<SF>, Bool<HF> >
2473 , Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
2474 , And< IsStrictlyUpper<MT2>, IsUpper<MT1> > > > >::value >
2490 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2491 struct IsUpper< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2493 , And< IsUpper<MT1>, IsUpper<MT2> >
2494 , And< Or< Bool<SF>, Bool<HF> >
2495 , IsLower<MT1>, IsLower<MT2> > >::value >
2511 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2512 struct IsUniUpper< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2513 :
public BoolConstant< Or< And< IsUniUpper<MT1>, IsUniUpper<MT2> >
2514 , And< Or< Bool<SF>, Bool<HF> >
2515 , IsUniLower<MT1>, IsUniLower<MT2> > >::value >
2531 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2533 :
public BoolConstant< Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
2534 , And< IsStrictlyUpper<MT2>, IsUpper<MT1> >
2535 , And< Or< Bool<SF>, Bool<HF> >
2536 , Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
2537 , And< IsStrictlyLower<MT2>, IsLower<MT1> > > > >::value >
#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
If_< IsExpression< MT2 >, const MT2, const MT2 &> RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TDMatSMatMultExpr.h:249
Header file for auxiliary alias declarations.
Headerfile for the generic min algorithm.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:72
decltype(auto) decldiag(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as diagonal.
Definition: DMatDeclDiagExpr.h:996
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: TDMatSMatMultExpr.h:352
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
EnableIf_< IsDenseMatrix< MT1 > > smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:196
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: TDMatSMatMultExpr.h:288
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.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: TDMatSMatMultExpr.h:336
LeftOperand leftOperand() const noexcept
Returns the left-hand side transpose dense matrix operand.
Definition: TDMatSMatMultExpr.h:372
Subvector< VT, AF > 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:322
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:164
Header file for the serial shim.
Header file for the IsDiagonal type trait.
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
Header file for the DeclUpp functor.
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:198
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:560
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse matrix operand.
Definition: TDMatSMatMultExpr.h:382
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
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:1762
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:1027
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:250
Column< MT > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:124
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.
Expression object for transpose dense matrix-sparse matrix multiplications.The TDMatSMatMultExpr clas...
Definition: Forward.h:151
Header file for the IsUniLower type trait.
CompositeType_< MT2 > CT2
Composite type of the right-hand side sparse matrix expression.
Definition: TDMatSMatMultExpr.h:135
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1809
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:133
const ResultType CompositeType
Data type for composite expression templates.
Definition: TDMatSMatMultExpr.h:243
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:78
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
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
ElementType_< RT2 > ET2
Element type of the right-hand side sparse matrix expression.
Definition: TDMatSMatMultExpr.h:133
Row< MT > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:124
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
RightOperand rhs_
Right-hand side sparse matrix of the multiplication expression.
Definition: TDMatSMatMultExpr.h:434
Constraint on the data type.
Constraint on the data type.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: TDMatSMatMultExpr.h:394
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
Headerfile for the generic max algorithm.
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 DeclLow functor.
Header file for the If class template.
#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
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:102
Header file for the Or class template.
Flag for lower matrices.
Definition: TDMatSMatMultExpr.h:153
#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.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3087
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
decltype(auto) decllow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as lower.
Definition: DMatDeclLowExpr.h:1027
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
ResultType_< MT2 > RT2
Result type of the right-hand side sparse matrix expression.
Definition: TDMatSMatMultExpr.h:131
Generic wrapper for the null function.
Definition: Noop.h:58
Header file for the IsTriangular type trait.
ResultType_< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: TDMatSMatMultExpr.h:130
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.
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
CompositeType_< MT1 > CT1
Composite type of the left-hand side dense matrix expression.
Definition: TDMatSMatMultExpr.h:134
ElementType_< RT1 > ET1
Element type of the left-hand side dense matrix expression.
Definition: TDMatSMatMultExpr.h:132
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:264
Header file for the DeclDiag functor.
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: TDMatSMatMultExpr.h:416
Constraint on the data type.
Header file for all forward declarations for expression class templates.
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: TDMatSMatMultExpr.h:239
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:108
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
IfTrue_< evaluateLeft, const RT1, CT1 > LT
Type for the assignment of the left-hand side dense matrix operand.
Definition: TDMatSMatMultExpr.h:252
#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
#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
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TDMatSMatMultExpr.h:242
Header file for run time assertion macros.
TDMatSMatMultExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the TDMatSMatMultExpr class.
Definition: TDMatSMatMultExpr.h:273
Compile time check for column-major matrix types.This type trait tests whether or not the given templ...
Definition: IsColumnMajorMatrix.h:110
Utility type for generic codes.
MultTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: TDMatSMatMultExpr.h:238
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:154
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:94
ElementType_< ResultType > ElementType
Resulting element type.
Definition: TDMatSMatMultExpr.h:241
LeftOperand lhs_
Left-hand side dense matrix of the multiplication expression.
Definition: TDMatSMatMultExpr.h:433
decltype(auto) declsym(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as symmetric.
Definition: DMatDeclSymExpr.h:1029
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:101
Flag for Hermitian matrices.
Definition: TDMatSMatMultExpr.h:152
Constraint on the data type.
Constraints on the storage order of matrix types.
Generic wrapper for the declherm() function.
Definition: DeclHerm.h:58
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:819
Header file for the Noop functor.
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: TDMatSMatMultExpr.h:362
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:263
#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
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
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3082
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:790
decltype(auto) declherm(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as Hermitian.
Definition: DMatDeclHermExpr.h:1029
If_< IsExpression< MT1 >, const MT1, const MT1 &> LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: TDMatSMatMultExpr.h:246
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: TDMatSMatMultExpr.h:406
Header file for the IsComputation type trait class.
Header file for the IsBuiltin type trait.
Flag for upper matrices.
Definition: TDMatSMatMultExpr.h:154
IfTrue_< evaluateRight, const RT2, CT2 > RT
Type for the assignment of the right-hand side sparse matrix operand.
Definition: TDMatSMatMultExpr.h:255
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:75
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: TDMatSMatMultExpr.h:426
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:75
Header file for the DeclHerm functor.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:600
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
Header file for the IsUpper type trait.
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1321
Constraint on the data type.
Flag for symmetric matrices.
Definition: TDMatSMatMultExpr.h:151
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:742
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 Bool class template.
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
Header file for the IsExpression type trait class.
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: TDMatSMatMultExpr.h:240
Header file for the function trace functionality.