35 #ifndef _BLAZE_MATH_EXPRESSIONS_TDMATSMATMULTEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_TDMATSMATMULTEXPR_H_ 116 template<
typename MT1
122 class TDMatSMatMultExpr
123 :
public MatMatMultExpr< DenseMatrix< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>, true > >
124 ,
private Computation
149 SYM = ( SF && !( HF || LF || UF ) ),
150 HERM = ( HF && !( LF || UF ) ),
151 LOW = ( LF || ( ( SF || HF ) && UF ) ),
152 UPP = ( UF || ( ( SF || HF ) && LF ) )
163 template<
typename T1,
typename T2,
typename T3 >
164 struct CanExploitSymmetry {
176 template<
typename T1,
typename T2,
typename T3 >
177 struct IsEvaluationRequired {
178 enum :
bool { value = ( evaluateLeft || evaluateRight ) &&
179 !CanExploitSymmetry<T1,T2,T3>::value };
190 template<
typename T1,
typename T2,
typename T3 >
191 struct UseOptimizedKernel {
192 enum :
bool { value = useOptimizedKernels &&
205 template<
typename T1,
typename T2,
typename T3 >
206 struct UseDefaultKernel {
207 enum :
bool { value = !UseOptimizedKernel<T1,T2,T3>::value };
258 enum :
bool { simdEnabled =
false };
261 enum :
bool { smpAssignable = !evaluateLeft && MT1::smpAssignable &&
262 !evaluateRight && MT2::smpAssignable };
312 :(
lhs_.columns() ) ) );
316 const size_t n(
end - begin );
336 if( i >=
lhs_.rows() ) {
339 if( j >=
rhs_.columns() ) {
351 inline size_t rows() const noexcept {
362 return rhs_.columns();
392 template<
typename T >
393 inline bool canAlias(
const T* alias )
const noexcept {
394 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
404 template<
typename T >
406 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
416 return lhs_.isAligned();
449 template<
typename MT
469 TDMatSMatMultExpr::selectAssignKernel( ~lhs, A, B );
485 template<
typename MT3
488 static inline void selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
490 if( C.rows() * C.columns() < TDMATSMATMULT_THRESHOLD )
491 selectSmallAssignKernel( C, A, B );
493 selectLargeAssignKernel( C, A, B );
513 template<
typename MT3
516 static inline void selectDefaultAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
522 for(
size_t j=0UL; j<B.rows(); ++j )
529 for( ; element!=
end; ++element ) {
530 C(j,element->index()) = A(j,j) * element->value();
535 for( ; element!=
end; ++element )
537 const size_t j1( element->index() );
541 ?( SYM || HERM || LOW ?
max(j1,j+1UL) : j+1UL )
542 :( SYM || HERM || LOW ?
max(j1,j) : j ) )
543 :( SYM || HERM || LOW ? j1 : 0UL ) );
546 ?( UPP ?
min(j1+1UL,j) : j )
547 :( UPP ?
min(j1,j)+1UL : j+1UL ) )
548 :( UPP ? j1+1UL : A.rows() ) );
550 if( ( SYM || HERM || LOW || UPP ) && ( ibegin >= iend ) )
continue;
553 for(
size_t i=ibegin; i<iend; ++i ) {
555 C(i,j1) = A(i,j) * element->value();
557 C(i,j1) += A(i,j) * element->value();
564 for(
size_t j=1UL; j<B.columns(); ++j ) {
565 for(
size_t i=0UL; i<j; ++i ) {
566 C(i,j) = HERM ?
conj( C(j,i) ) : C(j,i);
588 template<
typename MT3
592 selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
594 selectDefaultAssignKernel( C, A, B );
614 template<
typename MT3
618 selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
624 for(
size_t j=0UL; j<B.rows(); ++j )
629 const size_t nonzeros( B.nonZeros(j) );
630 const size_t kpos( nonzeros &
size_t(-4) );
633 for(
size_t k=0UL; k<kpos; k+=4UL )
635 const size_t j1( element->index() );
636 const ET2 v1( element->value() );
638 const size_t j2( element->index() );
639 const ET2 v2( element->value() );
641 const size_t j3( element->index() );
642 const ET2 v3( element->value() );
644 const size_t j4( element->index() );
645 const ET2 v4( element->value() );
652 ?( SYM || HERM || LOW ?
max(j1,j+1UL) : j+1UL )
653 :( SYM || HERM || LOW ?
max(j1,j) : j ) )
654 :( SYM || HERM || LOW ? j1 : 0UL ) );
657 ?( UPP ?
min(j4+1UL,j) : j )
658 :( UPP ?
min(j4,j)+1UL : j+1UL ) )
659 :( UPP ? j4+1UL : A.rows() ) );
661 if( ( SYM || HERM || LOW || UPP ) && ( ibegin >= iend ) )
continue;
664 const size_t inum( iend - ibegin );
665 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
670 for( ; i<ipos; i+=4UL ) {
671 C(i ,j1) += A(i ,j) * v1;
672 C(i+1UL,j1) += A(i+1UL,j) * v1;
673 C(i+2UL,j1) += A(i+2UL,j) * v1;
674 C(i+3UL,j1) += A(i+3UL,j) * v1;
675 C(i ,j2) += A(i ,j) * v2;
676 C(i+1UL,j2) += A(i+1UL,j) * v2;
677 C(i+2UL,j2) += A(i+2UL,j) * v2;
678 C(i+3UL,j2) += A(i+3UL,j) * v2;
679 C(i ,j3) += A(i ,j) * v3;
680 C(i+1UL,j3) += A(i+1UL,j) * v3;
681 C(i+2UL,j3) += A(i+2UL,j) * v3;
682 C(i+3UL,j3) += A(i+3UL,j) * v3;
683 C(i ,j4) += A(i ,j) * v4;
684 C(i+1UL,j4) += A(i+1UL,j) * v4;
685 C(i+2UL,j4) += A(i+2UL,j) * v4;
686 C(i+3UL,j4) += A(i+3UL,j) * v4;
688 for( ; i<iend; ++i ) {
689 C(i,j1) += A(i,j) * v1;
690 C(i,j2) += A(i,j) * v2;
691 C(i,j3) += A(i,j) * v3;
692 C(i,j4) += A(i,j) * v4;
696 for( ; element!=
end; ++element )
698 const size_t j1( element->index() );
699 const ET2 v1( element->value() );
703 ?( SYM || HERM || LOW ?
max(j1,j+1UL) : j+1UL )
704 :( SYM || HERM || LOW ?
max(j1,j) : j ) )
705 :( SYM || HERM || LOW ? j1 : 0UL ) );
708 ?( UPP ?
min(j1+1UL,j) : j )
709 :( UPP ?
min(j1,j)+1UL : j+1UL ) )
710 :( UPP ? j1+1UL : A.rows() ) );
712 if( ( SYM || HERM || LOW || UPP ) && ( ibegin >= iend ) )
continue;
715 const size_t inum( iend - ibegin );
716 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
721 for( ; i<ipos; i+=4UL ) {
722 C(i ,j1) += A(i ,j) * v1;
723 C(i+1UL,j1) += A(i+1UL,j) * v1;
724 C(i+2UL,j1) += A(i+2UL,j) * v1;
725 C(i+3UL,j1) += A(i+3UL,j) * v1;
727 for( ; i<iend; ++i ) {
728 C(i,j1) += A(i,j) * v1;
734 for(
size_t j=1UL; j<B.columns(); ++j ) {
735 for(
size_t i=0UL; i<j; ++i ) {
736 C(i,j) = HERM ?
conj( C(j,i) ) : C(j,i);
758 template<
typename MT3
762 selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
764 selectDefaultAssignKernel( C, A, B );
784 template<
typename MT3
788 selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
792 const ForwardFunctor fwd;
795 assign( C, fwd( A * tmp ) );
813 template<
typename MT
832 const ForwardFunctor fwd;
834 const TmpType tmp(
serial( rhs ) );
835 assign( ~lhs, fwd( tmp ) );
855 template<
typename MT
867 const ForwardFunctor fwd;
869 assign( ~lhs, fwd( rhs.lhs_ *
trans( rhs.rhs_ ) ) );
887 template<
typename MT
907 TDMatSMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
923 template<
typename MT3
926 static inline void selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
928 if( C.rows() * C.columns() < TDMATSMATMULT_THRESHOLD )
929 selectSmallAddAssignKernel( C, A, B );
931 selectLargeAddAssignKernel( C, A, B );
951 template<
typename MT3
954 static inline void selectDefaultAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
960 for(
size_t j=0UL; j<B.rows(); ++j )
967 for( ; element!=
end; ++element ) {
968 C(j,element->index()) += A(j,j) * element->value();
973 for( ; element!=
end; ++element )
975 const size_t j1( element->index() );
979 ?( LOW ?
max(j1,j+1UL) : j+1UL )
980 :( LOW ?
max(j1,j) : j ) )
981 :( LOW ? j1 : 0UL ) );
984 ?( UPP ?
min(j1+1UL,j) : j )
985 :( UPP ?
min(j1,j)+1UL : j+1UL ) )
986 :( UPP ? j1+1UL : A.rows() ) );
988 if( ( LOW || UPP ) && ( ibegin >= iend ) )
continue;
991 const size_t inum( iend - ibegin );
992 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
995 for( i=ibegin; i<ipos; i+=4UL ) {
996 C(i ,j1) += A(i ,j) * element->value();
997 C(i+1UL,j1) += A(i+1UL,j) * element->value();
998 C(i+2UL,j1) += A(i+2UL,j) * element->value();
999 C(i+3UL,j1) += A(i+3UL,j) * element->value();
1001 for( ; i<iend; ++i ) {
1002 C(i,j1) += A(i,j) * element->value();
1025 template<
typename MT3
1029 selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1031 selectDefaultAddAssignKernel( C, A, B );
1051 template<
typename MT3
1055 selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1059 for(
size_t j=0UL; j<B.rows(); ++j )
1064 const size_t nonzeros( B.nonZeros(j) );
1065 const size_t kpos( nonzeros &
size_t(-4) );
1068 for(
size_t k=0UL; k<kpos; k+=4UL )
1070 const size_t j1( element->index() );
1071 const ET2 v1( element->value() );
1073 const size_t j2( element->index() );
1074 const ET2 v2( element->value() );
1076 const size_t j3( element->index() );
1077 const ET2 v3( element->value() );
1079 const size_t j4( element->index() );
1080 const ET2 v4( element->value() );
1087 ?( LOW ?
max(j1,j+1UL) : j+1UL )
1088 :( LOW ?
max(j1,j) : j ) )
1089 :( LOW ? j1 : 0UL ) );
1092 ?( UPP ?
min(j4+1UL,j) : j )
1093 :( UPP ?
min(j4,j)+1UL : j+1UL ) )
1094 :( UPP ? j4+1UL : A.rows() ) );
1096 if( ( LOW || UPP ) && ( ibegin >= iend ) )
continue;
1099 const size_t inum( iend - ibegin );
1100 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
1105 for( i=ibegin; i<ipos; i+=4UL ) {
1106 C(i ,j1) += A(i ,j) * v1;
1107 C(i+1UL,j1) += A(i+1UL,j) * v1;
1108 C(i+2UL,j1) += A(i+2UL,j) * v1;
1109 C(i+3UL,j1) += A(i+3UL,j) * v1;
1110 C(i ,j2) += A(i ,j) * v2;
1111 C(i+1UL,j2) += A(i+1UL,j) * v2;
1112 C(i+2UL,j2) += A(i+2UL,j) * v2;
1113 C(i+3UL,j2) += A(i+3UL,j) * v2;
1114 C(i ,j3) += A(i ,j) * v3;
1115 C(i+1UL,j3) += A(i+1UL,j) * v3;
1116 C(i+2UL,j3) += A(i+2UL,j) * v3;
1117 C(i+3UL,j3) += A(i+3UL,j) * v3;
1118 C(i ,j4) += A(i ,j) * v4;
1119 C(i+1UL,j4) += A(i+1UL,j) * v4;
1120 C(i+2UL,j4) += A(i+2UL,j) * v4;
1121 C(i+3UL,j4) += A(i+3UL,j) * v4;
1123 for( ; i<iend; ++i ) {
1124 C(i,j1) += A(i,j) * v1;
1125 C(i,j2) += A(i,j) * v2;
1126 C(i,j3) += A(i,j) * v3;
1127 C(i,j4) += A(i,j) * v4;
1131 for( ; element!=
end; ++element )
1133 const size_t j1( element->index() );
1134 const ET2 v1( element->value() );
1138 ?( LOW ?
max(j1,j+1UL) : j+1UL )
1139 :( LOW ?
max(j1,j) : j ) )
1140 :( LOW ? j1 : 0UL ) );
1143 ?( UPP ?
min(j1+1UL,j) : j )
1144 :( UPP ?
min(j1,j)+1UL : j+1UL ) )
1145 :( UPP ? j1+1UL : A.rows() ) );
1147 if( ( LOW || UPP ) && ( ibegin >= iend ) )
continue;
1150 const size_t inum( iend - ibegin );
1151 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
1156 for( ; i<ipos; i+=4UL ) {
1157 C(i ,j1) += A(i ,j) * v1;
1158 C(i+1UL,j1) += A(i+1UL,j) * v1;
1159 C(i+2UL,j1) += A(i+2UL,j) * v1;
1160 C(i+3UL,j1) += A(i+3UL,j) * v1;
1162 for( ; i<iend; ++i ) {
1163 C(i,j1) += A(i,j) * v1;
1185 template<
typename MT3
1189 selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1191 selectDefaultAddAssignKernel( C, A, B );
1211 template<
typename MT3
1215 selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1219 const ForwardFunctor fwd;
1222 addAssign( C, fwd( A * tmp ) );
1242 template<
typename MT
1252 const ForwardFunctor fwd;
1254 addAssign( ~lhs, fwd( rhs.lhs_ *
trans( rhs.rhs_ ) ) );
1276 template<
typename MT
1296 TDMatSMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1312 template<
typename MT3
1315 static inline void selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1317 if( C.rows() * C.columns() < TDMATSMATMULT_THRESHOLD )
1318 selectSmallSubAssignKernel( C, A, B );
1320 selectLargeSubAssignKernel( C, A, B );
1340 template<
typename MT3
1343 static inline void selectDefaultSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1349 for(
size_t j=0UL; j<B.rows(); ++j )
1356 for( ; element!=
end; ++element ) {
1357 C(j,element->index()) -= A(j,j) * element->value();
1362 for( ; element!=
end; ++element )
1364 const size_t j1( element->index() );
1368 ?( LOW ?
max(j1,j+1UL) : j+1UL )
1369 :( LOW ?
max(j1,j) : j ) )
1370 :( LOW ? j1 : 0UL ) );
1373 ?( UPP ?
min(j1+1UL,j) : j )
1374 :( UPP ?
min(j1,j)+1UL : j+1UL ) )
1375 :( UPP ? j1+1UL : A.rows() ) );
1377 if( ( LOW || UPP ) && ( ibegin >= iend ) )
continue;
1380 const size_t inum( iend - ibegin );
1381 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
1384 for( i=ibegin; i<ipos; i+=4UL ) {
1385 C(i ,j1) -= A(i ,j) * element->value();
1386 C(i+1UL,j1) -= A(i+1UL,j) * element->value();
1387 C(i+2UL,j1) -= A(i+2UL,j) * element->value();
1388 C(i+3UL,j1) -= A(i+3UL,j) * element->value();
1390 for( ; i<iend; ++i ) {
1391 C(i,j1) -= A(i,j) * element->value();
1414 template<
typename MT3
1418 selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1420 selectDefaultSubAssignKernel( C, A, B );
1440 template<
typename MT3
1444 selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1448 for(
size_t j=0UL; j<B.rows(); ++j )
1453 const size_t nonzeros( B.nonZeros(j) );
1454 const size_t kpos( nonzeros &
size_t(-4) );
1457 for(
size_t k=0UL; k<kpos; k+=4UL )
1459 const size_t j1( element->index() );
1460 const ET2 v1( element->value() );
1462 const size_t j2( element->index() );
1463 const ET2 v2( element->value() );
1465 const size_t j3( element->index() );
1466 const ET2 v3( element->value() );
1468 const size_t j4( element->index() );
1469 const ET2 v4( element->value() );
1476 ?( LOW ?
max(j1,j+1UL) : j+1UL )
1477 :( LOW ?
max(j1,j) : j ) )
1478 :( LOW ? j1 : 0UL ) );
1481 ?( UPP ?
min(j4+1UL,j) : j )
1482 :( UPP ?
min(j4,j)+1UL : j+1UL ) )
1483 :( UPP ? j4+1UL : A.rows() ) );
1485 if( ( LOW || UPP ) && ( ibegin >= iend ) )
continue;
1488 const size_t inum( iend - ibegin );
1489 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
1494 for( ; i<ipos; i+=4UL ) {
1495 C(i ,j1) -= A(i ,j) * v1;
1496 C(i+1UL,j1) -= A(i+1UL,j) * v1;
1497 C(i+2UL,j1) -= A(i+2UL,j) * v1;
1498 C(i+3UL,j1) -= A(i+3UL,j) * v1;
1499 C(i ,j2) -= A(i ,j) * v2;
1500 C(i+1UL,j2) -= A(i+1UL,j) * v2;
1501 C(i+2UL,j2) -= A(i+2UL,j) * v2;
1502 C(i+3UL,j2) -= A(i+3UL,j) * v2;
1503 C(i ,j3) -= A(i ,j) * v3;
1504 C(i+1UL,j3) -= A(i+1UL,j) * v3;
1505 C(i+2UL,j3) -= A(i+2UL,j) * v3;
1506 C(i+3UL,j3) -= A(i+3UL,j) * v3;
1507 C(i ,j4) -= A(i ,j) * v4;
1508 C(i+1UL,j4) -= A(i+1UL,j) * v4;
1509 C(i+2UL,j4) -= A(i+2UL,j) * v4;
1510 C(i+3UL,j4) -= A(i+3UL,j) * v4;
1512 for( ; i<iend; ++i ) {
1513 C(i,j1) -= A(i,j) * v1;
1514 C(i,j2) -= A(i,j) * v2;
1515 C(i,j3) -= A(i,j) * v3;
1516 C(i,j4) -= A(i,j) * v4;
1520 for( ; element!=
end; ++element )
1522 const size_t j1( element->index() );
1523 const ET2 v1( element->value() );
1527 ?( LOW ?
max(j1,j+1UL) : j+1UL )
1528 :( LOW ?
max(j1,j) : j ) )
1529 :( LOW ? j1 : 0UL ) );
1532 ?( UPP ?
min(j1+1UL,j) : j )
1533 :( UPP ?
min(j1,j)+1UL : j+1UL ) )
1534 :( UPP ? j1+1UL : A.rows() ) );
1536 if( ( LOW || UPP ) && ( ibegin >= iend ) )
continue;
1539 const size_t inum( iend - ibegin );
1540 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
1545 for( ; i<ipos; i+=4UL ) {
1546 C(i ,j1) -= A(i ,j) * v1;
1547 C(i+1UL,j1) -= A(i+1UL,j) * v1;
1548 C(i+2UL,j1) -= A(i+2UL,j) * v1;
1549 C(i+3UL,j1) -= A(i+3UL,j) * v1;
1551 for( ; i<iend; ++i ) {
1552 C(i,j1) -= A(i,j) * v1;
1574 template<
typename MT3
1578 selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1580 selectDefaultSubAssignKernel( C, A, B );
1600 template<
typename MT3
1604 selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1608 const ForwardFunctor fwd;
1611 subAssign( C, fwd( A * tmp ) );
1631 template<
typename MT
1643 const ForwardFunctor fwd;
1645 subAssign( ~lhs, fwd( rhs.lhs_ *
trans( rhs.rhs_ ) ) );
1667 template<
typename MT
1681 schurAssign( ~lhs, tmp );
1714 template<
typename MT
1755 template<
typename MT
1774 const ForwardFunctor fwd;
1776 const TmpType tmp( rhs );
1797 template<
typename MT
1807 const ForwardFunctor fwd;
1830 template<
typename MT
1870 template<
typename MT
1882 const ForwardFunctor fwd;
1909 template<
typename MT
1949 template<
typename MT
1961 const ForwardFunctor fwd;
1985 template<
typename MT
2067 template<
typename MT1
2069 inline decltype(
auto)
2118 template<
typename MT1
2133 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2164 template<
typename MT1
2179 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2210 template<
typename MT1
2225 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2256 template<
typename MT1
2271 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2302 template<
typename MT1
2317 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2333 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2334 struct Size< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>, 0UL >
2335 :
public Size<MT1,0UL>
2338 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2339 struct Size< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>, 1UL >
2340 :
public Size<MT2,1UL>
2356 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2357 struct IsAligned< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2374 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2375 struct IsSymmetric< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2376 :
public Or< Bool<SF>
2378 , IsBuiltin< ElementType_< TDMatSMatMultExpr<MT1,MT2,false,true,false,false> > > >
2379 , And< Bool<LF>, Bool<UF> > >
2395 template<
typename MT1,
typename MT2,
bool SF,
bool LF,
bool UF >
2396 struct IsHermitian< TDMatSMatMultExpr<MT1,MT2,SF,true,LF,UF> >
2413 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2414 struct IsLower< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2415 :
public Or< Bool<LF>
2416 , And< IsLower<MT1>, IsLower<MT2> >
2417 , And< Or< Bool<SF>, Bool<HF> >
2418 , IsUpper<MT1>, IsUpper<MT2> > >
2434 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2435 struct IsUniLower< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2436 :
public Or< And< IsUniLower<MT1>, IsUniLower<MT2> >
2437 , And< Or< Bool<SF>, Bool<HF> >
2438 , IsUniUpper<MT1>, IsUniUpper<MT2> > >
2454 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2456 :
public Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
2457 , And< IsStrictlyLower<MT2>, IsLower<MT1> >
2458 , And< Or< Bool<SF>, Bool<HF> >
2459 , Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
2460 , And< IsStrictlyUpper<MT2>, IsUpper<MT1> > > > >
2476 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2477 struct IsUpper< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2478 :
public Or< Bool<UF>
2479 , And< IsUpper<MT1>, IsUpper<MT2> >
2480 , And< Or< Bool<SF>, Bool<HF> >
2481 , IsLower<MT1>, IsLower<MT2> > >
2497 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2498 struct IsUniUpper< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2499 :
public Or< And< IsUniUpper<MT1>, IsUniUpper<MT2> >
2500 , And< Or< Bool<SF>, Bool<HF> >
2501 , IsUniLower<MT1>, IsUniLower<MT2> > >
2517 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2519 :
public Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
2520 , And< IsStrictlyUpper<MT2>, IsUpper<MT1> >
2521 , And< Or< Bool<SF>, Bool<HF> >
2522 , Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
2523 , And< IsStrictlyLower<MT2>, IsLower<MT1> > > > >
decltype(auto) subvector(Vector< VT, TF > &, RSAs...)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:329
Flag for lower matrices.
Definition: TDMatSMatMultExpr.h:151
#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
Flag for Hermitian matrices.
Definition: TDMatSMatMultExpr.h:150
If_< IsExpression< MT2 >, const MT2, const MT2 &> RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TDMatSMatMultExpr.h:247
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:131
Headerfile for the generic min algorithm.
Header file for the blaze::checked and blaze::unchecked instances.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:71
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:351
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:286
Compile time check for triangular matrix types.This type trait tests whether or not the given templat...
Definition: IsTriangular.h:86
Header file for basic type definitions.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: TDMatSMatMultExpr.h:335
LeftOperand leftOperand() const noexcept
Returns the left-hand side transpose dense matrix operand.
Definition: TDMatSMatMultExpr.h:371
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:364
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:588
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse matrix operand.
Definition: TDMatSMatMultExpr.h:381
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
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:1903
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:87
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:1026
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:291
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:87
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:133
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:1950
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:241
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
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:131
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:433
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:71
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: TDMatSMatMultExpr.h:393
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:58
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.
#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.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
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:1026
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:89
ResultType_< MT2 > RT2
Result type of the right-hand side sparse matrix expression.
Definition: TDMatSMatMultExpr.h:129
Generic wrapper for the null function.
Definition: Noop.h:59
Header file for the IsTriangular type trait.
ResultType_< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: TDMatSMatMultExpr.h:128
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:132
ElementType_< RT1 > ET1
Element type of the left-hand side dense matrix expression.
Definition: TDMatSMatMultExpr.h:130
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:430
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:415
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:237
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:107
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:250
#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:240
Header file for run time assertion macros.
TDMatSMatMultExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the TDMatSMatMultExpr class.
Definition: TDMatSMatMultExpr.h:271
Compile time check for column-major matrix types.This type trait tests whether or not the given templ...
Definition: IsColumnMajorMatrix.h:110
MultTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: TDMatSMatMultExpr.h:236
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
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:131
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:239
LeftOperand lhs_
Left-hand side dense matrix of the multiplication expression.
Definition: TDMatSMatMultExpr.h:432
decltype(auto) declsym(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as symmetric.
Definition: DMatDeclSymExpr.h:1028
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
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:816
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:361
Flag for symmetric matrices.
Definition: TDMatSMatMultExpr.h:149
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:3080
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:789
decltype(auto) declherm(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as Hermitian.
Definition: DMatDeclHermExpr.h:1028
If_< IsExpression< MT1 >, const MT1, const MT1 &> LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: TDMatSMatMultExpr.h:244
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: TDMatSMatMultExpr.h:405
Header file for the IsComputation type trait class.
Header file for the IsBuiltin type trait.
Compile time logical 'or' evaluation.The Or alias declaration performs at compile time a logical 'or'...
Definition: Or.h:76
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
Flag for upper matrices.
Definition: TDMatSMatMultExpr.h:152
IfTrue_< evaluateRight, const RT2, CT2 > RT
Type for the assignment of the right-hand side sparse matrix operand.
Definition: TDMatSMatMultExpr.h:253
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: TDMatSMatMultExpr.h:425
Generic wrapper for the decldiag() function.
Definition: DeclDiag.h:58
Header file for the DeclHerm functor.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
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.
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:908
Header file for the IsResizable type trait.
Header file for the Size 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:238
Header file for the function trace functionality.