35#ifndef _BLAZE_MATH_EXPRESSIONS_TDMATSMATMULTEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_TDMATSMATMULTEXPR_H_
121template<
typename MT1
128 :
public MatMatMultExpr< DenseMatrix< TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>, true > >
152 static constexpr bool SYM = ( SF && !( HF || LF || UF ) );
153 static constexpr bool HERM = ( HF && !( LF || UF ) );
154 static constexpr bool LOW = ( LF || ( ( SF || HF ) && UF ) );
155 static constexpr bool UPP = ( UF || ( ( SF || HF ) && LF ) );
165 template<
typename T1,
typename T2,
typename T3 >
176 template<
typename T1,
typename T2,
typename T3 >
177 static constexpr bool IsEvaluationRequired_v =
187 template<
typename T1,
typename T2,
typename T3 >
188 static constexpr bool UseOptimizedKernel_v =
189 ( useOptimizedKernels &&
201 template<
typename T1,
typename T2,
typename T3 >
202 static constexpr bool UseDefaultKernel_v = !UseOptimizedKernel_v<T1,T2,T3>;
321 :(
lhs_.columns() ) ) );
345 if( i >=
lhs_.rows() ) {
348 if( j >=
rhs_.columns() ) {
360 inline size_t rows() const noexcept {
371 return rhs_.columns();
401 template<
typename T >
402 inline bool canAlias(
const T* alias )
const noexcept {
403 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
413 template<
typename T >
415 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
425 return lhs_.isAligned();
458 template<
typename MT
478 TDMatSMatMultExpr::selectAssignKernel( *lhs, A, B );
494 template<
typename MT3
497 static inline void selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
499 if( C.rows() * C.columns() < TDMATSMATMULT_THRESHOLD )
500 selectSmallAssignKernel( C, A, B );
502 selectLargeAssignKernel( C, A, B );
522 template<
typename MT3
525 static inline void selectDefaultAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
529 for(
size_t j=0UL; j<B.rows(); ++j )
531 auto element( B.begin(j) );
532 const auto end( B.end(j) );
536 for( ; element!=
end; ++element ) {
537 C(j,element->index()) = A(j,j) * element->value();
542 for( ; element!=
end; ++element )
544 const size_t j1( element->index() );
553 ?(
UPP ?
min(j1+1UL,j) : j )
554 :(
UPP ?
min(j1,j)+1UL : j+1UL ) )
555 :(
UPP ? j1+1UL : A.rows() ) );
557 if( (
SYM ||
HERM ||
LOW ||
UPP ) && ( ibegin >= iend ) )
continue;
560 for(
size_t i=ibegin; i<iend; ++i ) {
562 C(i,j1) = A(i,j) * element->value();
564 C(i,j1) += A(i,j) * element->value();
571 for(
size_t j=1UL; j<B.columns(); ++j ) {
572 for(
size_t i=0UL; i<j; ++i ) {
573 C(i,j) =
HERM ?
conj( C(j,i) ) : C(j,i);
595 template<
typename MT3
598 static inline auto selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
601 selectDefaultAssignKernel( C, A, B );
621 template<
typename MT3
624 static inline auto selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
629 for(
size_t j=0UL; j<B.rows(); ++j )
631 auto element( B.begin(j) );
632 const auto end( B.end(j) );
634 const size_t nonzeros( B.nonZeros(j) );
638 for(
size_t k=0UL; k<kpos; k+=4UL )
640 const size_t j1( element->index() );
641 const ET2 v1( element->value() );
643 const size_t j2( element->index() );
644 const ET2 v2( element->value() );
646 const size_t j3( element->index() );
647 const ET2 v3( element->value() );
649 const size_t j4( element->index() );
650 const ET2 v4( element->value() );
662 ?(
UPP ?
min(j4+1UL,j) : j )
663 :(
UPP ?
min(j4,j)+1UL : j+1UL ) )
664 :(
UPP ? j4+1UL : A.rows() ) );
666 if( (
SYM ||
HERM ||
LOW ||
UPP ) && ( ibegin >= iend ) )
continue;
669 const size_t inum( iend - ibegin );
670 const size_t ipos( ibegin +
prevMultiple( inum, 4UL ) );
675 for( ; i<ipos; i+=4UL ) {
676 C(i ,j1) += A(i ,j) * v1;
677 C(i+1UL,j1) += A(i+1UL,j) * v1;
678 C(i+2UL,j1) += A(i+2UL,j) * v1;
679 C(i+3UL,j1) += A(i+3UL,j) * v1;
680 C(i ,j2) += A(i ,j) * v2;
681 C(i+1UL,j2) += A(i+1UL,j) * v2;
682 C(i+2UL,j2) += A(i+2UL,j) * v2;
683 C(i+3UL,j2) += A(i+3UL,j) * v2;
684 C(i ,j3) += A(i ,j) * v3;
685 C(i+1UL,j3) += A(i+1UL,j) * v3;
686 C(i+2UL,j3) += A(i+2UL,j) * v3;
687 C(i+3UL,j3) += A(i+3UL,j) * v3;
688 C(i ,j4) += A(i ,j) * v4;
689 C(i+1UL,j4) += A(i+1UL,j) * v4;
690 C(i+2UL,j4) += A(i+2UL,j) * v4;
691 C(i+3UL,j4) += A(i+3UL,j) * v4;
693 for( ; i<iend; ++i ) {
694 C(i,j1) += A(i,j) * v1;
695 C(i,j2) += A(i,j) * v2;
696 C(i,j3) += A(i,j) * v3;
697 C(i,j4) += A(i,j) * v4;
701 for( ; element!=
end; ++element )
703 const size_t j1( element->index() );
704 const ET2 v1( element->value() );
713 ?(
UPP ?
min(j1+1UL,j) : j )
714 :(
UPP ?
min(j1,j)+1UL : j+1UL ) )
715 :(
UPP ? j1+1UL : A.rows() ) );
717 if( (
SYM ||
HERM ||
LOW ||
UPP ) && ( ibegin >= iend ) )
continue;
720 const size_t inum( iend - ibegin );
721 const size_t ipos( ibegin +
prevMultiple( inum, 4UL ) );
726 for( ; i<ipos; i+=4UL ) {
727 C(i ,j1) += A(i ,j) * v1;
728 C(i+1UL,j1) += A(i+1UL,j) * v1;
729 C(i+2UL,j1) += A(i+2UL,j) * v1;
730 C(i+3UL,j1) += A(i+3UL,j) * v1;
732 for( ; i<iend; ++i ) {
733 C(i,j1) += A(i,j) * v1;
739 for(
size_t j=1UL; j<B.columns(); ++j ) {
740 for(
size_t i=0UL; i<j; ++i ) {
741 C(i,j) =
HERM ?
conj( C(j,i) ) : C(j,i);
763 template<
typename MT3
766 static inline auto selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
769 selectDefaultAssignKernel( C, A, B );
789 template<
typename MT3
792 static inline auto selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
797 const ForwardFunctor fwd;
799 const OppositeType_t<MT5> tmp(
serial( B ) );
800 assign( C, fwd( A * tmp ) );
818 template<
typename MT
820 friend inline auto assign( SparseMatrix<MT,SO>& lhs,
const TDMatSMatMultExpr& rhs )
837 const ForwardFunctor fwd;
839 const TmpType tmp(
serial( rhs ) );
840 assign( *lhs, fwd( tmp ) );
860 template<
typename MT
872 const ForwardFunctor fwd;
874 assign( *lhs, fwd( rhs.lhs_ *
trans( rhs.rhs_ ) ) );
892 template<
typename MT
894 friend inline auto addAssign( DenseMatrix<MT,SO>& lhs,
const TDMatSMatMultExpr& rhs )
912 TDMatSMatMultExpr::selectAddAssignKernel( *lhs, A, B );
928 template<
typename MT3
931 static inline void selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
933 if( C.rows() * C.columns() < TDMATSMATMULT_THRESHOLD )
934 selectSmallAddAssignKernel( C, A, B );
936 selectLargeAddAssignKernel( C, A, B );
956 template<
typename MT3
959 static inline void selectDefaultAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
963 for(
size_t j=0UL; j<B.rows(); ++j )
965 auto element( B.begin(j) );
966 const auto end( B.end(j) );
970 for( ; element!=
end; ++element ) {
971 C(j,element->index()) += A(j,j) * element->value();
976 for( ; element!=
end; ++element )
978 const size_t j1( element->index() );
982 ?(
LOW ?
max(j1,j+1UL) : j+1UL )
983 :(
LOW ?
max(j1,j) : j ) )
984 :(
LOW ? j1 : 0UL ) );
987 ?(
UPP ?
min(j1+1UL,j) : j )
988 :(
UPP ?
min(j1,j)+1UL : j+1UL ) )
989 :(
UPP ? j1+1UL : A.rows() ) );
991 if( (
LOW ||
UPP ) && ( ibegin >= iend ) )
continue;
994 const size_t inum( iend - ibegin );
995 const size_t ipos( ibegin +
prevMultiple( inum, 4UL ) );
998 for( i=ibegin; i<ipos; i+=4UL ) {
999 C(i ,j1) += A(i ,j) * element->value();
1000 C(i+1UL,j1) += A(i+1UL,j) * element->value();
1001 C(i+2UL,j1) += A(i+2UL,j) * element->value();
1002 C(i+3UL,j1) += A(i+3UL,j) * element->value();
1004 for( ; i<iend; ++i ) {
1005 C(i,j1) += A(i,j) * element->value();
1028 template<
typename MT3
1031 static inline auto selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1034 selectDefaultAddAssignKernel( C, A, B );
1054 template<
typename MT3
1057 static inline auto selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1060 for(
size_t j=0UL; j<B.rows(); ++j )
1062 auto element( B.begin(j) );
1063 const auto end( B.end(j) );
1065 const size_t nonzeros( B.nonZeros(j) );
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 +
prevMultiple( inum, 4UL ) );
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 +
prevMultiple( inum, 4UL ) );
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
1189 static inline auto selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1192 selectDefaultAddAssignKernel( C, A, B );
1212 template<
typename MT3
1215 static inline auto selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1220 const ForwardFunctor fwd;
1222 const OppositeType_t<MT5> tmp(
serial( B ) );
1223 addAssign( C, fwd( A * tmp ) );
1243 template<
typename MT
1245 friend inline auto addAssign( Matrix<MT,SO>& lhs,
const TDMatSMatMultExpr& rhs )
1253 const ForwardFunctor fwd;
1255 addAssign( *lhs, fwd( rhs.lhs_ *
trans( rhs.rhs_ ) ) );
1277 template<
typename MT
1279 friend inline auto subAssign( DenseMatrix<MT,SO>& lhs,
const TDMatSMatMultExpr& rhs )
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 )
1348 for(
size_t j=0UL; j<B.rows(); ++j )
1350 auto element( B.begin(j) );
1351 const auto end( B.end(j) );
1355 for( ; element!=
end; ++element ) {
1356 C(j,element->index()) -= A(j,j) * element->value();
1361 for( ; element!=
end; ++element )
1363 const size_t j1( element->index() );
1367 ?(
LOW ?
max(j1,j+1UL) : j+1UL )
1368 :(
LOW ?
max(j1,j) : j ) )
1369 :(
LOW ? j1 : 0UL ) );
1372 ?(
UPP ?
min(j1+1UL,j) : j )
1373 :(
UPP ?
min(j1,j)+1UL : j+1UL ) )
1374 :(
UPP ? j1+1UL : A.rows() ) );
1376 if( (
LOW ||
UPP ) && ( ibegin >= iend ) )
continue;
1379 const size_t inum( iend - ibegin );
1380 const size_t ipos( ibegin +
prevMultiple( inum, 4UL ) );
1383 for( i=ibegin; i<ipos; i+=4UL ) {
1384 C(i ,j1) -= A(i ,j) * element->value();
1385 C(i+1UL,j1) -= A(i+1UL,j) * element->value();
1386 C(i+2UL,j1) -= A(i+2UL,j) * element->value();
1387 C(i+3UL,j1) -= A(i+3UL,j) * element->value();
1389 for( ; i<iend; ++i ) {
1390 C(i,j1) -= A(i,j) * element->value();
1413 template<
typename MT3
1416 static inline auto selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1419 selectDefaultSubAssignKernel( C, A, B );
1439 template<
typename MT3
1442 static inline auto selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1445 for(
size_t j=0UL; j<B.rows(); ++j )
1447 auto element( B.begin(j) );
1448 const auto end( B.end(j) );
1450 const size_t nonzeros( B.nonZeros(j) );
1454 for(
size_t k=0UL; k<kpos; k+=4UL )
1456 const size_t j1( element->index() );
1457 const ET2 v1( element->value() );
1459 const size_t j2( element->index() );
1460 const ET2 v2( element->value() );
1462 const size_t j3( element->index() );
1463 const ET2 v3( element->value() );
1465 const size_t j4( element->index() );
1466 const ET2 v4( element->value() );
1473 ?(
LOW ?
max(j1,j+1UL) : j+1UL )
1474 :(
LOW ?
max(j1,j) : j ) )
1475 :(
LOW ? j1 : 0UL ) );
1478 ?(
UPP ?
min(j4+1UL,j) : j )
1479 :(
UPP ?
min(j4,j)+1UL : j+1UL ) )
1480 :(
UPP ? j4+1UL : A.rows() ) );
1482 if( (
LOW ||
UPP ) && ( ibegin >= iend ) )
continue;
1485 const size_t inum( iend - ibegin );
1486 const size_t ipos( ibegin +
prevMultiple( inum, 4UL ) );
1491 for( ; i<ipos; i+=4UL ) {
1492 C(i ,j1) -= A(i ,j) * v1;
1493 C(i+1UL,j1) -= A(i+1UL,j) * v1;
1494 C(i+2UL,j1) -= A(i+2UL,j) * v1;
1495 C(i+3UL,j1) -= A(i+3UL,j) * v1;
1496 C(i ,j2) -= A(i ,j) * v2;
1497 C(i+1UL,j2) -= A(i+1UL,j) * v2;
1498 C(i+2UL,j2) -= A(i+2UL,j) * v2;
1499 C(i+3UL,j2) -= A(i+3UL,j) * v2;
1500 C(i ,j3) -= A(i ,j) * v3;
1501 C(i+1UL,j3) -= A(i+1UL,j) * v3;
1502 C(i+2UL,j3) -= A(i+2UL,j) * v3;
1503 C(i+3UL,j3) -= A(i+3UL,j) * v3;
1504 C(i ,j4) -= A(i ,j) * v4;
1505 C(i+1UL,j4) -= A(i+1UL,j) * v4;
1506 C(i+2UL,j4) -= A(i+2UL,j) * v4;
1507 C(i+3UL,j4) -= A(i+3UL,j) * v4;
1509 for( ; i<iend; ++i ) {
1510 C(i,j1) -= A(i,j) * v1;
1511 C(i,j2) -= A(i,j) * v2;
1512 C(i,j3) -= A(i,j) * v3;
1513 C(i,j4) -= A(i,j) * v4;
1517 for( ; element!=
end; ++element )
1519 const size_t j1( element->index() );
1520 const ET2 v1( element->value() );
1524 ?(
LOW ?
max(j1,j+1UL) : j+1UL )
1525 :(
LOW ?
max(j1,j) : j ) )
1526 :(
LOW ? j1 : 0UL ) );
1529 ?(
UPP ?
min(j1+1UL,j) : j )
1530 :(
UPP ?
min(j1,j)+1UL : j+1UL ) )
1531 :(
UPP ? j1+1UL : A.rows() ) );
1533 if( (
LOW ||
UPP ) && ( ibegin >= iend ) )
continue;
1536 const size_t inum( iend - ibegin );
1537 const size_t ipos( ibegin +
prevMultiple( inum, 4UL ) );
1542 for( ; i<ipos; i+=4UL ) {
1543 C(i ,j1) -= A(i ,j) * v1;
1544 C(i+1UL,j1) -= A(i+1UL,j) * v1;
1545 C(i+2UL,j1) -= A(i+2UL,j) * v1;
1546 C(i+3UL,j1) -= A(i+3UL,j) * v1;
1548 for( ; i<iend; ++i ) {
1549 C(i,j1) -= A(i,j) * v1;
1571 template<
typename MT3
1574 static inline auto selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1577 selectDefaultSubAssignKernel( C, A, B );
1597 template<
typename MT3
1600 static inline auto selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1605 const ForwardFunctor fwd;
1607 const OppositeType_t<MT5> tmp(
serial( B ) );
1608 subAssign( C, fwd( A * tmp ) );
1628 template<
typename MT
1630 friend inline auto subAssign( Matrix<MT,SO>& lhs,
const TDMatSMatMultExpr& rhs )
1640 const ForwardFunctor fwd;
1642 subAssign( *lhs, fwd( rhs.lhs_ *
trans( rhs.rhs_ ) ) );
1664 template<
typename MT
1666 friend inline void schurAssign( DenseMatrix<MT,SO>& lhs,
const TDMatSMatMultExpr& rhs )
1678 schurAssign( *lhs, tmp );
1711 template<
typename MT
1752 template<
typename MT
1771 const ForwardFunctor fwd;
1773 const TmpType tmp( rhs );
1794 template<
typename MT
1804 const ForwardFunctor fwd;
1827 template<
typename MT
1867 template<
typename MT
1879 const ForwardFunctor fwd;
1906 template<
typename MT
1946 template<
typename MT
1958 const ForwardFunctor fwd;
1982 template<
typename MT
2048template<
typename MT1
2080template<
typename MT1
2112template<
typename MT1
2115inline decltype(
auto)
2127 return ReturnType( (*lhs).rows(), (*rhs).columns() );
2163template<
typename MT1
2165inline decltype(
auto)
2170 if( (*lhs).columns() != (*rhs).rows() ) {
2174 return tdmatsmatmult( *lhs, *rhs );
2212template<
typename MT1
2218inline decltype(
auto)
declsym(
const TDMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
2227 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2258template<
typename MT1
2273 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2304template<
typename MT1
2319 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2350template<
typename MT1
2394template<
typename MT1
2438template<
typename MT1
2453 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2484template<
typename MT1
2528template<
typename MT1
2572template<
typename MT1
2587 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2603template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2605 :
public Size<MT1,0UL>
2608template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2610 :
public Size<MT2,1UL>
2626template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
Header file for auxiliary alias declarations.
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.
Definition Aliases.h:310
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.
Definition Aliases.h:110
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.
Definition Aliases.h:550
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition Aliases.h:190
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition Aliases.h:450
Header file for run time assertion macros.
Header file for the blaze::checked and blaze::unchecked instances.
Constraints on the storage order of matrix types.
Header file for the conjugate shim.
Header file for the decldiag trait.
Header file for the DeclDiag functor.
Header file for the declherm trait.
Header file for the DeclHerm functor.
Header file for the decllow trait.
Header file for the DeclLow functor.
Header file for the declsym trait.
Header file for the DeclSym functor.
Header file for the declupp trait.
Header file for the DeclUpp functor.
Header file for the EnableIf class template.
Header file for the function trace functionality.
Header file for the If class template.
Header file for the IntegralConstant class template.
Header file for the IsAligned type trait.
Header file for the IsBuiltin type trait.
Header file for the IsColumnMajorMatrix type trait.
Header file for the IsComputation type trait class.
Header file for the isDefault shim.
Header file for the IsDiagonal type trait.
Header file for the IsExpression type trait class.
Header file for the IsIdentity type trait.
Header file for the IsLower type trait.
Header file for the IsResizable type trait.
Header file for the IsStrictlyLower type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Header file for the IsTriangular type trait.
Header file for the IsUpper type trait.
Header file for the MAYBE_UNUSED function template.
Header file for the multiplication trait.
Header file for the Noop functor.
Header file for the prevMultiple shim.
Constraints on the storage order of matrix types.
Constraint on the data type.
Constraint on the data type.
Base class for dense matrices.
Definition DenseMatrix.h:82
Base class for sparse matrices.
Definition SparseMatrix.h:77
Expression object for transpose dense matrix-sparse matrix multiplications.
Definition TDMatSMatMultExpr.h:130
const ElementType ReturnType
Return type for expression template evaluations.
Definition TDMatSMatMultExpr.h:249
ElementType_t< ResultType > ElementType
Resulting element type.
Definition TDMatSMatMultExpr.h:248
static constexpr bool SYM
Flag for symmetric matrices.
Definition TDMatSMatMultExpr.h:152
static constexpr bool HERM
Flag for Hermitian matrices.
Definition TDMatSMatMultExpr.h:153
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition TDMatSMatMultExpr.h:247
static constexpr bool LOW
Flag for lower matrices.
Definition TDMatSMatMultExpr.h:154
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition TDMatSMatMultExpr.h:344
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse matrix operand.
Definition TDMatSMatMultExpr.h:390
MatMatMultExpr< DenseMatrix< This, true > > BaseType
Base type of this TDMatSMatMultExpr instance.
Definition TDMatSMatMultExpr.h:231
LeftOperand leftOperand() const noexcept
Returns the left-hand side transpose dense matrix operand.
Definition TDMatSMatMultExpr.h:380
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition TDMatSMatMultExpr.h:434
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition TDMatSMatMultExpr.h:246
LeftOperand lhs_
Left-hand side dense matrix of the multiplication expression.
Definition TDMatSMatMultExpr.h:441
ElementType_t< RT1 > ET1
Element type of the left-hand side dense matrix expression.
Definition TDMatSMatMultExpr.h:135
ElementType_t< RT2 > ET2
Element type of the right-hand side sparse matrix expression.
Definition TDMatSMatMultExpr.h:136
TDMatSMatMultExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the TDMatSMatMultExpr class.
Definition TDMatSMatMultExpr.h:280
If_t< evaluateRight, const RT2, CT2 > RT
Type for the assignment of the right-hand side sparse matrix operand.
Definition TDMatSMatMultExpr.h:262
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition TDMatSMatMultExpr.h:402
typename If_t< HERM, DeclHermTrait< MultTrait_t< RT1, RT2 > >, If_t< SYM, DeclSymTrait< MultTrait_t< RT1, RT2 > >, If_t< LOW, If_t< UPP, DeclDiagTrait< MultTrait_t< RT1, RT2 > >, DeclLowTrait< MultTrait_t< RT1, RT2 > > >, If_t< UPP, DeclUppTrait< MultTrait_t< RT1, RT2 > >, MultTrait< RT1, RT2 > > > > >::Type ResultType
Result type for expression template evaluations.
Definition TDMatSMatMultExpr.h:234
CompositeType_t< MT1 > CT1
Composite type of the left-hand side dense matrix expression.
Definition TDMatSMatMultExpr.h:137
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition TDMatSMatMultExpr.h:295
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition TDMatSMatMultExpr.h:414
If_t< IsExpression_v< MT2 >, const MT2, const MT2 & > RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition TDMatSMatMultExpr.h:256
ResultType_t< MT2 > RT2
Result type of the right-hand side sparse matrix expression.
Definition TDMatSMatMultExpr.h:134
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition TDMatSMatMultExpr.h:370
CompositeType_t< MT2 > CT2
Composite type of the right-hand side sparse matrix expression.
Definition TDMatSMatMultExpr.h:138
If_t< IsExpression_v< MT1 >, const MT1, const MT1 & > LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition TDMatSMatMultExpr.h:253
static constexpr bool evaluateRight
Compilation switch for the composite type of the right-hand side sparse matrix expression.
Definition TDMatSMatMultExpr.h:148
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition TDMatSMatMultExpr.h:424
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition TDMatSMatMultExpr.h:267
const ResultType CompositeType
Data type for composite expression templates.
Definition TDMatSMatMultExpr.h:250
ResultType_t< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition TDMatSMatMultExpr.h:133
RightOperand rhs_
Right-hand side sparse matrix of the multiplication expression.
Definition TDMatSMatMultExpr.h:442
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition TDMatSMatMultExpr.h:360
TDMatSMatMultExpr< MT1, MT2, SF, HF, LF, UF > This
Type of this TDMatSMatMultExpr instance.
Definition TDMatSMatMultExpr.h:228
If_t< evaluateLeft, const RT1, CT1 > LT
Type for the assignment of the left-hand side dense matrix operand.
Definition TDMatSMatMultExpr.h:259
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition TDMatSMatMultExpr.h:270
static constexpr bool evaluateLeft
Compilation switch for the composite type of the left-hand side dense matrix expression.
Definition TDMatSMatMultExpr.h:143
static constexpr bool UPP
Flag for upper matrices.
Definition TDMatSMatMultExpr.h:155
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the Computation base class.
Header file for the DenseMatrix base class.
Header file for the MatMatMultExpr base class.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition Column.h:137
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition DMatDMatMapExpr.h:1339
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition DMatDMatMapExpr.h:1375
decltype(auto) declstrupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as strictly upper.
Definition DMatDeclStrUppExpr.h:1003
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition DMatMapExpr.h:1464
decltype(auto) decldiag(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as diagonal.
Definition DMatDeclDiagExpr.h:978
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition DMatTransExpr.h:766
decltype(auto) declstrlow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as strictly lower.
Definition DMatDeclStrLowExpr.h:1003
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition DMatSerialExpr.h:812
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition DMatDeclUppExpr.h:1004
decltype(auto) decllow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as lower.
Definition DMatDeclLowExpr.h:1004
decltype(auto) decluniupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as uniupper.
Definition DMatDeclUniUppExpr.h:1005
decltype(auto) declherm(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as Hermitian.
Definition DMatDeclHermExpr.h:1005
decltype(auto) declsym(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as symmetric.
Definition DMatDeclSymExpr.h:1005
decltype(auto) declunilow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as unilower.
Definition DMatDeclUniLowExpr.h:1004
bool isDefault(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the given diagonal matrix is in default state.
Definition DiagonalMatrix.h:169
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.
Definition RowMajorMatrix.h:61
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.
Definition StorageOrder.h:84
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition RequiresEvaluation.h:81
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATMATMULTEXPR(T1, T2)
Constraint on the data type.
Definition MatMatMultExpr.h:103
#define BLAZE_CONSTRAINT_MUST_NOT_BE_ZERO_TYPE(T)
Constraint on the data type.
Definition Zero.h:81
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition DenseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition SparseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.
Definition ColumnMajorMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_BE_ZERO_TYPE(T)
Constraint on the data type.
Definition Zero.h:61
typename MultTrait< T1, T2 >::Type MultTrait_t
Auxiliary alias declaration for the MultTrait class template.
Definition MultTrait.h:165
constexpr bool RequiresEvaluation_v
Auxiliary variable template for the RequiresEvaluation type trait.
Definition RequiresEvaluation.h:91
constexpr bool IsStrictlyUpper_v
Auxiliary variable template for the IsStrictlyUpper type trait.
Definition IsStrictlyUpper.h:173
constexpr bool IsSymmetric_v
Auxiliary variable template for the IsSymmetric type trait.
Definition IsSymmetric.h:172
constexpr bool IsTriangular_v
Auxiliary variable template for the IsTriangular type trait.
Definition IsTriangular.h:106
constexpr bool IsStrictlyLower_v
Auxiliary variable template for the IsStrictlyLower type trait.
Definition IsStrictlyLower.h:173
constexpr bool IsUpper_v
Auxiliary variable template for the IsUpper type trait.
Definition IsUpper.h:175
constexpr bool IsDiagonal_v
Auxiliary variable template for the IsDiagonal type trait.
Definition IsDiagonal.h:148
constexpr bool IsComputation_v
Auxiliary variable template for the IsComputation type trait.
Definition IsComputation.h:90
constexpr bool IsZero_v
Auxiliary variable template for the IsZero type trait.
Definition IsZero.h:166
constexpr bool IsColumnMajorMatrix_v
Auxiliary variable template for the IsColumnMajorMatrix type trait.
Definition IsColumnMajorMatrix.h:129
constexpr bool IsIdentity_v
Auxiliary variable template for the IsIdentity type trait.
Definition IsIdentity.h:137
constexpr bool IsLower_v
Auxiliary variable template for the IsLower type trait.
Definition IsLower.h:175
constexpr bool IsResizable_v
Auxiliary variable template for the IsResizable type trait.
Definition IsResizable.h:136
BLAZE_ALWAYS_INLINE constexpr auto prevMultiple(T1 value, T2 factor) noexcept
Rounds down an integral value to the previous multiple of a given factor.
Definition PrevMultiple.h:68
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition Matrix.h:806
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:584
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition Matrix.h:518
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition Matrix.h:1383
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition Row.h:137
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition Assert.h:101
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition DenseMatrix.h:162
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition DenseMatrix.h:100
auto smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition DenseMatrix.h:194
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition DenseMatrix.h:131
decltype(auto) subvector(Vector< VT, TF > &, RSAs...)
Creating a view on a specific subvector of the given vector.
Definition Subvector.h:158
constexpr bool IsSame_v
Auxiliary variable template for the IsSame type trait.
Definition IsSame.h:159
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition MaybeUnused.h:81
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:138
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition Exception.h:235
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition FunctionTrace.h:94
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition If.h:108
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:175
constexpr Unchecked unchecked
Global Unchecked instance.
Definition Check.h:146
Header file for the exception macros of the math module.
Constraints on the storage order of matrix types.
Header file for all forward declarations for expression class templates.
Header file for the Size type trait.
Header file for the reset shim.
Header file for the serial shim.
Base class for all compute expression templates.
Definition Computation.h:68
Base template for the DeclDiagTrait class.
Definition DeclDiagTrait.h:127
Generic wrapper for the decldiag() function.
Definition DeclDiag.h:61
Base template for the DeclHermTrait class.
Definition DeclHermTrait.h:126
Generic wrapper for the declherm() function.
Definition DeclHerm.h:61
Base template for the DeclLowTrait class.
Definition DeclLowTrait.h:126
Generic wrapper for the decllow() function.
Definition DeclLow.h:61
Base template for the DeclSymTrait class.
Definition DeclSymTrait.h:126
Generic wrapper for the declsym() function.
Definition DeclSym.h:61
Base template for the DeclUppTrait class.
Definition DeclUppTrait.h:126
Generic wrapper for the declupp() function.
Definition DeclUpp.h:61
Compile time check for the alignment of data types.
Definition IsAligned.h:88
Base class for all matrix/matrix multiplication expression templates.
Definition MatMatMultExpr.h:71
Base template for the MultTrait class.
Definition MultTrait.h:130
Generic wrapper for the null function.
Definition Noop.h:62
Compile time evaluation of the size of vectors and matrices.
Definition Size.h:119
System settings for performance optimizations.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
Header file for the IsZero type trait.
Header file for the RequiresEvaluation type trait.
Header file for basic type definitions.
Header file for the generic max algorithm.
Header file for the generic min algorithm.