35#ifndef _BLAZE_MATH_EXPRESSIONS_DMATSMATMULTEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_DMATSMATMULTEXPR_H_
120template<
typename MT1
127 :
public MatMatMultExpr< DenseMatrix< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>, false > >
142 static constexpr bool evaluateLeft = ( IsComputation_v<MT1> || RequiresEvaluation_v<MT1> );
147 static constexpr bool evaluateRight = ( IsComputation_v<MT2> || RequiresEvaluation_v<MT2> );
151 static constexpr bool SYM = ( SF && !( HF || LF || UF ) );
152 static constexpr bool HERM = ( HF && !( LF || UF ) );
153 static constexpr bool LOW = ( LF || ( ( SF || HF ) && UF ) );
154 static constexpr bool UPP = ( UF || ( ( SF || HF ) && LF ) );
164 template<
typename T1,
typename T2,
typename T3 >
165 static constexpr bool CanExploitSymmetry_v = ( IsSymmetric_v<T2> || IsSymmetric_v<T3> );
175 template<
typename T1,
typename T2,
typename T3 >
176 static constexpr bool IsEvaluationRequired_v =
186 template<
typename T1,
typename T2,
typename T3 >
187 static constexpr bool UseOptimizedKernel_v =
188 useOptimizedKernels && !IsDiagonal_v<T2> && !IsResizable_v< ElementType_t<T1> >;
197 template<
typename T1,
typename T2,
typename T3 >
198 static constexpr bool UseDefaultKernel_v = !UseOptimizedKernel_v<T1,T2,T3>;
295 if( IsDiagonal_v<MT1> ) {
298 else if( IsDiagonal_v<MT2> ) {
301 else if( IsTriangular_v<MT1> || IsTriangular_v<MT2> ) {
302 const size_t begin( ( IsUpper_v<MT1> )
303 ?( ( IsLower_v<MT2> )
304 ?(
max( ( IsStrictlyUpper_v<MT1> ? i+1UL : i )
305 , ( IsStrictlyLower_v<MT2> ? j+1UL : j ) ) )
306 :( IsStrictlyUpper_v<MT1> ? i+1UL : i ) )
307 :( ( IsLower_v<MT2> )
308 ?( IsStrictlyLower_v<MT2> ? j+1UL : j )
310 const size_t end( ( IsLower_v<MT1> )
311 ?( ( IsUpper_v<MT2> )
312 ?(
min( ( IsStrictlyLower_v<MT1> ? i : i+1UL )
313 , ( IsStrictlyUpper_v<MT2> ? j : j+1UL ) ) )
314 :( IsStrictlyLower_v<MT1> ? i : i+1UL ) )
315 :( ( IsUpper_v<MT2> )
316 ?( IsStrictlyUpper_v<MT2> ? j : j+1UL )
317 :(
lhs_.columns() ) ) );
341 if( i >=
lhs_.rows() ) {
344 if( j >=
rhs_.columns() ) {
356 inline size_t rows() const noexcept {
367 return rhs_.columns();
397 template<
typename T >
398 inline bool canAlias(
const T* alias )
const noexcept {
399 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
409 template<
typename T >
410 inline bool isAliased(
const T* alias )
const noexcept {
411 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
421 return lhs_.isAligned();
431 return (
rows() *
columns() >= SMP_DMATSMATMULT_THRESHOLD ) && !IsDiagonal_v<MT1>;
454 template<
typename MT
474 DMatSMatMultExpr::selectAssignKernel( *lhs, A, B );
490 template<
typename MT3
493 static inline void selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
495 if( C.rows() * C.columns() < DMATSMATMULT_THRESHOLD )
496 selectSmallAssignKernel( C, A, B );
498 selectLargeAssignKernel( C, A, B );
517 template<
typename MT3
520 static inline void selectDefaultAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
524 for(
size_t k=0UL; k<B.rows(); ++k )
526 if( IsDiagonal_v<MT4> )
528 auto element( B.begin(k) );
529 const auto end( B.end(k) );
531 for( ; element!=
end; ++element ) {
532 C(k,element->index()) = A(k,k) * element->value();
537 const size_t iibegin( ( IsLower_v<MT4> )
538 ?( IsStrictlyLower_v<MT4> ? k+1UL : k )
540 const size_t iiend( ( IsUpper_v<MT4> )
541 ?( IsStrictlyUpper_v<MT4> ? k : k+1UL )
545 for(
size_t ii=iibegin; ii<iiend; ii+=8UL )
547 auto element( B.begin(k) );
548 const auto end( B.end(k) );
549 const size_t itmp( ( ii+8UL > iiend )?( iiend ):( ii+8UL ) );
551 for( ; element!=
end; ++element )
553 const size_t j1( element->index() );
555 const size_t iend(
UPP ?
min(j1+1UL,itmp) : itmp );
557 for(
size_t i=ibegin; i<iend; ++i ) {
559 C(i,j1) = A(i,k) * element->value();
561 C(i,j1) += A(i,k) * element->value();
569 for(
size_t i=0UL; i<A.rows(); ++i ) {
570 for(
size_t j=i+1UL; j<B.columns(); ++j ) {
571 C(i,j) =
HERM ?
conj( C(j,i) ) : C(j,i);
592 template<
typename MT3
595 static inline auto selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
596 -> EnableIf_t< UseDefaultKernel_v<MT3,MT4,MT5> >
598 selectDefaultAssignKernel( C, A, B );
618 template<
typename MT3
621 static inline auto selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
622 -> EnableIf_t< UseOptimizedKernel_v<MT3,MT4,MT5> >
626 for(
size_t j=0UL; j<B.rows(); ++j )
628 const size_t iibegin( ( IsLower_v<MT4> )
629 ?( IsStrictlyLower_v<MT4> ? j+1UL : j )
631 const size_t iiend( ( IsUpper_v<MT4> )
632 ?( IsStrictlyUpper_v<MT4> ? j : j+1UL )
636 for(
size_t ii=iibegin; ii<iiend; ii+=8UL )
638 auto element( B.begin(j) );
639 const auto end( B.end(j) );
640 const size_t itmp( ( ii+8UL > iiend )?( iiend ):( ii+8UL ) );
642 for( ; element!=
end; ++element )
644 const size_t j1( element->index() );
646 const size_t iend(
UPP ?
min(j1+1UL,itmp) : itmp );
648 for(
size_t i=ibegin; i<iend; ++i ) {
649 C(i,j1) += A(i,j) * element->value();
656 for(
size_t i=0UL; i<A.rows(); ++i ) {
657 for(
size_t j=i+1UL; j<B.columns(); ++j ) {
658 C(i,j) =
HERM ?
conj( C(j,i) ) : C(j,i);
679 template<
typename MT3
682 static inline auto selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
683 -> EnableIf_t< UseDefaultKernel_v<MT3,MT4,MT5> >
685 selectDefaultAssignKernel( C, A, B );
705 template<
typename MT3
708 static inline auto selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
709 -> EnableIf_t< UseOptimizedKernel_v<MT3,MT4,MT5> >
713 const ForwardFunctor fwd;
715 const OppositeType_t<MT5> tmp(
serial( B ) );
716 assign( C, fwd( A * tmp ) );
734 template<
typename MT
736 friend inline auto assign( SparseMatrix<MT,SO>& lhs,
const DMatSMatMultExpr& rhs )
737 -> DisableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
741 using TmpType = If_t< SO, OppositeType, ResultType >;
753 const ForwardFunctor fwd;
755 const TmpType tmp(
serial( rhs ) );
756 assign( *lhs, fwd( tmp ) );
776 template<
typename MT
778 friend inline auto assign( Matrix<MT,SO>& lhs,
const DMatSMatMultExpr& rhs )
779 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
788 const ForwardFunctor fwd;
790 decltype(
auto) A(
transIf< IsSymmetric_v<MT1> >( rhs.lhs_ ) );
791 decltype(
auto) B(
transIf< IsSymmetric_v<MT2> >( rhs.rhs_ ) );
793 assign( *lhs, fwd( A * B ) );
811 template<
typename MT
813 friend inline auto addAssign( DenseMatrix<MT,SO>& lhs,
const DMatSMatMultExpr& rhs )
814 -> DisableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
831 DMatSMatMultExpr::selectAddAssignKernel( *lhs, A, B );
847 template<
typename MT3
850 static inline void selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
852 if( C.rows() * C.columns() < DMATSMATMULT_THRESHOLD )
853 selectSmallAddAssignKernel( C, A, B );
855 selectLargeAddAssignKernel( C, A, B );
874 template<
typename MT3
877 static inline void selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
879 for(
size_t j=0UL; j<B.rows(); ++j )
881 if( IsDiagonal_v<MT4> )
883 auto element( B.begin(j) );
884 const auto end( B.end(j) );
886 for( ; element!=
end; ++element ) {
887 C(j,element->index()) += A(j,j) * element->value();
892 const size_t iibegin( ( IsLower_v<MT4> )
893 ?( IsStrictlyLower_v<MT4> ? j+1UL : j )
895 const size_t iiend( ( IsUpper_v<MT4> )
896 ?( IsStrictlyUpper_v<MT4> ? j : j+1UL )
900 for(
size_t ii=iibegin; ii<iiend; ii+=8UL )
902 auto element( B.begin(j) );
903 const auto end( B.end(j) );
904 const size_t itmp( ( ii+8UL > iiend )?( iiend ):( ii+8UL ) );
906 for( ; element!=
end; ++element )
908 const size_t j1( element->index() );
909 const size_t ibegin(
LOW ?
max(j1,ii) : ii );
910 const size_t iend(
UPP ?
min(j1+1UL,itmp) : itmp );
912 for(
size_t i=ibegin; i<iend; ++i ) {
913 C(i,j1) += A(i,j) * element->value();
937 template<
typename MT3
940 static inline void selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
944 const ForwardFunctor fwd;
946 const OppositeType_t<MT5> tmp(
serial( B ) );
947 addAssign( C, fwd( A * tmp ) );
967 template<
typename MT
969 friend inline auto addAssign( Matrix<MT,SO>& lhs,
const DMatSMatMultExpr& rhs )
970 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
979 const ForwardFunctor fwd;
981 decltype(
auto) A(
transIf< IsSymmetric_v<MT1> >( rhs.lhs_ ) );
982 decltype(
auto) B(
transIf< IsSymmetric_v<MT2> >( rhs.rhs_ ) );
984 addAssign( *lhs, fwd( A * B ) );
1006 template<
typename MT
1008 friend inline auto subAssign( DenseMatrix<MT,SO>& lhs,
const DMatSMatMultExpr& rhs )
1009 -> DisableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
1026 DMatSMatMultExpr::selectSubAssignKernel( *lhs, A, B );
1042 template<
typename MT3
1045 static inline void selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1047 if( C.rows() * C.columns() < DMATSMATMULT_THRESHOLD )
1048 selectSmallSubAssignKernel( C, A, B );
1050 selectLargeSubAssignKernel( C, A, B );
1069 template<
typename MT3
1072 static inline void selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1074 for(
size_t j=0UL; j<B.rows(); ++j )
1076 if( IsDiagonal_v<MT4> )
1078 auto element( B.begin(j) );
1079 const auto end( B.end(j) );
1081 for( ; element!=
end; ++element ) {
1082 C(j,element->index()) -= A(j,j) * element->value();
1087 const size_t iibegin( ( IsLower_v<MT4> )
1088 ?( IsStrictlyLower_v<MT4> ? j+1UL : j )
1090 const size_t iiend( ( IsUpper_v<MT4> )
1091 ?( IsStrictlyUpper_v<MT4> ? j : j+1UL )
1095 for(
size_t ii=iibegin; ii<iiend; ii+=8UL )
1097 auto element( B.begin(j) );
1098 const auto end( B.end(j) );
1099 const size_t itmp( ( ii+8UL > iiend )?( iiend ):( ii+8UL ) );
1101 for( ; element!=
end; ++element )
1103 const size_t j1( element->index() );
1104 const size_t ibegin(
LOW ?
max(j1,ii) : ii );
1105 const size_t iend(
UPP ?
min(j1+1UL,itmp) : itmp );
1107 for(
size_t i=ibegin; i<iend; ++i ) {
1108 C(i,j1) -= A(i,j) * element->value();
1132 template<
typename MT3
1135 static inline void selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1139 const ForwardFunctor fwd;
1141 const OppositeType_t<MT5> tmp(
serial( B ) );
1142 subAssign( C, fwd( A * tmp ) );
1162 template<
typename MT
1164 friend inline auto subAssign( Matrix<MT,SO>& lhs,
const DMatSMatMultExpr& rhs )
1165 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
1174 const ForwardFunctor fwd;
1176 decltype(
auto) A(
transIf< IsSymmetric_v<MT1> >( rhs.lhs_ ) );
1177 decltype(
auto) B(
transIf< IsSymmetric_v<MT2> >( rhs.rhs_ ) );
1179 subAssign( *lhs, fwd( A * B ) );
1201 template<
typename MT
1203 friend inline void schurAssign( DenseMatrix<MT,SO>& lhs,
const DMatSMatMultExpr& rhs )
1215 schurAssign( *lhs, tmp );
1247 template<
typename MT
1250 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
1287 template<
typename MT
1290 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
1294 using TmpType = If_t< SO, OppositeType, ResultType >;
1306 const ForwardFunctor fwd;
1308 const TmpType tmp( rhs );
1329 template<
typename MT
1332 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
1341 const ForwardFunctor fwd;
1343 decltype(
auto) A(
transIf< IsSymmetric_v<MT1> >( rhs.lhs_ ) );
1344 decltype(
auto) B(
transIf< IsSymmetric_v<MT2> >( rhs.rhs_ ) );
1366 template<
typename MT
1369 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
1406 template<
typename MT
1409 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
1418 const ForwardFunctor fwd;
1420 decltype(
auto) A(
transIf< IsSymmetric_v<MT1> >( rhs.lhs_ ) );
1421 decltype(
auto) B(
transIf< IsSymmetric_v<MT2> >( rhs.rhs_ ) );
1448 template<
typename MT
1451 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
1488 template<
typename MT
1491 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
1500 const ForwardFunctor fwd;
1502 decltype(
auto) A(
transIf< IsSymmetric_v<MT1> >( rhs.lhs_ ) );
1503 decltype(
auto) B(
transIf< IsSymmetric_v<MT2> >( rhs.rhs_ ) );
1527 template<
typename MT
1593template<
typename MT1
1596 IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > ) ||
1597 IsZero_v<MT2> >* =
nullptr >
1598inline const DMatSMatMultExpr<MT1,MT2,false,false,false,false>
1599 dmatsmatmult(
const DenseMatrix<MT1,false>& lhs,
const SparseMatrix<MT2,false>& rhs )
1605 return DMatSMatMultExpr<MT1,MT2,false,false,false,false>( *lhs, *rhs );
1625template<
typename MT1
1627 , EnableIf_t< IsIdentity_v<MT2> &&
1628 IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > >* =
nullptr >
1630 dmatsmatmult(
const DenseMatrix<MT1,false>& lhs,
const SparseMatrix<MT2,false>& rhs )
1657template<
typename MT1
1659 , EnableIf_t< IsZero_v<MT2> >* =
nullptr >
1660inline decltype(
auto)
1661 dmatsmatmult(
const DenseMatrix<MT1,false>& lhs,
const SparseMatrix<MT2,false>& rhs )
1667 using ReturnType =
const MultTrait_t< ResultType_t<MT1>, ResultType_t<MT2> >;
1672 return ReturnType( (*lhs).rows(), (*rhs).columns() );
1707template<
typename MT1
1709inline decltype(
auto)
1714 if( (*lhs).columns() != (*rhs).rows() ) {
1718 return dmatsmatmult( *lhs, *rhs );
1755template<
typename MT1
1761inline decltype(
auto)
declsym(
const DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
1769 using ReturnType =
const DMatSMatMultExpr<MT1,MT2,true,HF,LF,UF>;
1770 return ReturnType( dm.leftOperand(), dm.rightOperand() );
1800template<
typename MT1
1806inline decltype(
auto)
declherm(
const DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
1814 using ReturnType =
const DMatSMatMultExpr<MT1,MT2,SF,true,LF,UF>;
1815 return ReturnType( dm.leftOperand(), dm.rightOperand() );
1845template<
typename MT1
1851inline decltype(
auto)
decllow(
const DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
1859 using ReturnType =
const DMatSMatMultExpr<MT1,MT2,SF,HF,true,UF>;
1860 return ReturnType( dm.leftOperand(), dm.rightOperand() );
1890template<
typename MT1
1895inline decltype(
auto)
declunilow(
const DMatSMatMultExpr<MT1,MT2,SF,HF,false,UF>& dm )
1933template<
typename MT1
1938inline decltype(
auto)
declstrlow(
const DMatSMatMultExpr<MT1,MT2,SF,HF,false,UF>& dm )
1976template<
typename MT1
1982inline decltype(
auto)
declupp(
const DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
1990 using ReturnType =
const DMatSMatMultExpr<MT1,MT2,SF,HF,LF,true>;
1991 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2021template<
typename MT1
2026inline decltype(
auto)
decluniupp(
const DMatSMatMultExpr<MT1,MT2,SF,HF,LF,false>& dm )
2064template<
typename MT1
2069inline decltype(
auto)
declstrupp(
const DMatSMatMultExpr<MT1,MT2,SF,HF,LF,false>& dm )
2107template<
typename MT1
2113inline decltype(
auto)
decldiag(
const DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
2121 using ReturnType =
const DMatSMatMultExpr<MT1,MT2,SF,HF,true,true>;
2122 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2138template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2139struct Size< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>, 0UL >
2140 :
public Size<MT1,0UL>
2143template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2144struct Size< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>, 1UL >
2145 :
public Size<MT2,1UL>
2161template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2162struct IsAligned< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2163 :
public IsAligned<MT1>
Header file for auxiliary alias declarations.
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.
Definition: Aliases.h:110
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition: Aliases.h:450
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition: Aliases.h:190
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.
Definition: Aliases.h:310
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.
Definition: Aliases.h:550
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 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 IsSame and IsStrictlySame type traits.
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.
Constraints on the storage order of matrix types.
Constraint on the data type.
Constraint on the data type.
Expression object for dense matrix-sparse matrix multiplications.
Definition: DMatSMatMultExpr.h:129
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatSMatMultExpr.h:242
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: DMatSMatMultExpr.h:240
static constexpr bool SYM
Flag for symmetric matrices.
Definition: DMatSMatMultExpr.h:151
If_t< IsExpression_v< MT2 >, const MT2, const MT2 & > RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: DMatSMatMultExpr.h:252
RightOperand rhs_
Right-hand side sparse matrix of the multiplication expression.
Definition: DMatSMatMultExpr.h:438
ResultType_t< MT2 > RT2
Result type of the right-hand side sparse matrix expression.
Definition: DMatSMatMultExpr.h:133
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatSMatMultExpr.h:243
If_t< evaluateLeft, const RT1, CT1 > LT
Type for the assignment of the left-hand side dense matrix operand.
Definition: DMatSMatMultExpr.h:255
If_t< evaluateRight, const RT2, CT2 > RT
Type for the assignment of the right-hand side sparse matrix operand.
Definition: DMatSMatMultExpr.h:258
static constexpr bool HERM
Flag for Hermitian matrices.
Definition: DMatSMatMultExpr.h:152
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatSMatMultExpr.h:376
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatSMatMultExpr.h:291
CompositeType_t< MT2 > CT2
Composite type of the right-hand side sparse matrix expression.
Definition: DMatSMatMultExpr.h:137
static constexpr bool LOW
Flag for lower matrices.
Definition: DMatSMatMultExpr.h:153
CompositeType_t< MT1 > CT1
Composite type of the left-hand side dense matrix expression.
Definition: DMatSMatMultExpr.h:136
ResultType_t< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: DMatSMatMultExpr.h:132
const ElementType ReturnType
Return type for expression template evaluations.
Definition: DMatSMatMultExpr.h:245
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: DMatSMatMultExpr.h:244
ElementType_t< RT2 > ET2
Element type of the right-hand side sparse matrix expression.
Definition: DMatSMatMultExpr.h:135
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatSMatMultExpr.h:420
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatSMatMultExpr.h:356
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DMatSMatMultExpr.h:266
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse matrix operand.
Definition: DMatSMatMultExpr.h:386
ElementType_t< RT1 > ET1
Element type of the left-hand side dense matrix expression.
Definition: DMatSMatMultExpr.h:134
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatSMatMultExpr.h:410
const ResultType CompositeType
Data type for composite expression templates.
Definition: DMatSMatMultExpr.h:246
static constexpr bool evaluateRight
Compilation switch for the composite type of the right-hand side sparse matrix expression.
Definition: DMatSMatMultExpr.h:147
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatSMatMultExpr.h:398
LeftOperand lhs_
Left-hand side dense matrix of the multiplication expression.
Definition: DMatSMatMultExpr.h:437
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatSMatMultExpr.h:430
static constexpr bool evaluateLeft
Compilation switch for the composite type of the left-hand side dense matrix expression.
Definition: DMatSMatMultExpr.h:142
static constexpr bool UPP
Flag for upper matrices.
Definition: DMatSMatMultExpr.h:154
If_t< IsExpression_v< MT1 >, const MT1, const MT1 & > LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatSMatMultExpr.h:249
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DMatSMatMultExpr.h:263
DMatSMatMultExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the DMatSMatMultExpr class.
Definition: DMatSMatMultExpr.h:276
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatSMatMultExpr.h:366
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatSMatMultExpr.h:340
Base class for dense matrices.
Definition: DenseMatrix.h:82
Base class for sparse matrices.
Definition: SparseMatrix.h:77
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) transIf(const DenseMatrix< MT, SO > &dm)
Conditional calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:832
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) 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
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 void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition: If.h:108
#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
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:175
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition: FunctionTrace.h:94
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
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
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.