35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATSMATMULTEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_DMATSMATMULTEXPR_H_ 121 template<
typename MT1
128 :
public MatMatMultExpr< DenseMatrix< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>, false > >
143 static constexpr
bool evaluateLeft = ( IsComputation_v<MT1> || RequiresEvaluation_v<MT1> );
148 static constexpr
bool evaluateRight = ( IsComputation_v<MT2> || RequiresEvaluation_v<MT2> );
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 >
166 static constexpr
bool CanExploitSymmetry_v = ( IsSymmetric_v<T2> || IsSymmetric_v<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 && !IsDiagonal_v<T2> && !IsResizable_v< ElementType_t<T1> >;
198 template<
typename T1,
typename T2,
typename T3 >
199 static constexpr
bool UseDefaultKernel_v = !UseOptimizedKernel_v<T1,T2,T3>;
296 if( IsDiagonal_v<MT1> ) {
299 else if( IsDiagonal_v<MT2> ) {
302 else if( IsTriangular_v<MT1> || IsTriangular_v<MT2> ) {
303 const size_t begin( ( IsUpper_v<MT1> )
304 ?( ( IsLower_v<MT2> )
305 ?(
max( ( IsStrictlyUpper_v<MT1> ? i+1UL : i )
306 , ( IsStrictlyLower_v<MT2> ? j+1UL : j ) ) )
307 :( IsStrictlyUpper_v<MT1> ? i+1UL : i ) )
308 :( ( IsLower_v<MT2> )
309 ?( IsStrictlyLower_v<MT2> ? j+1UL : j )
311 const size_t end( ( IsLower_v<MT1> )
312 ?( ( IsUpper_v<MT2> )
313 ?(
min( ( IsStrictlyLower_v<MT1> ? i : i+1UL )
314 , ( IsStrictlyUpper_v<MT2> ? j : j+1UL ) ) )
315 :( IsStrictlyLower_v<MT1> ? i : i+1UL ) )
316 :( ( IsUpper_v<MT2> )
317 ?( IsStrictlyUpper_v<MT2> ? j : j+1UL )
318 :(
lhs_.columns() ) ) );
342 if( i >=
lhs_.rows() ) {
345 if( j >=
rhs_.columns() ) {
357 inline size_t rows() const noexcept {
368 return rhs_.columns();
398 template<
typename T >
399 inline bool canAlias(
const T* alias )
const noexcept {
400 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
410 template<
typename T >
411 inline bool isAliased(
const T* alias )
const noexcept {
412 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
422 return lhs_.isAligned();
432 return (
rows() *
columns() >= SMP_DMATSMATMULT_THRESHOLD ) && !IsDiagonal_v<MT1>;
455 template<
typename MT
475 DMatSMatMultExpr::selectAssignKernel( ~lhs, A, B );
491 template<
typename MT3
494 static inline void selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
496 if( C.rows() * C.columns() < DMATSMATMULT_THRESHOLD )
497 selectSmallAssignKernel( C, A, B );
499 selectLargeAssignKernel( C, A, B );
518 template<
typename MT3
521 static inline void selectDefaultAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
525 for(
size_t k=0UL; k<B.rows(); ++k )
527 if( IsDiagonal_v<MT4> )
529 auto element( B.begin(k) );
530 const auto end( B.end(k) );
532 for( ; element!=
end; ++element ) {
533 C(k,element->index()) = A(k,k) * element->value();
538 const size_t iibegin( ( IsLower_v<MT4> )
539 ?( IsStrictlyLower_v<MT4> ? k+1UL : k )
541 const size_t iiend( ( IsUpper_v<MT4> )
542 ?( IsStrictlyUpper_v<MT4> ? k : k+1UL )
546 for(
size_t ii=iibegin; ii<iiend; ii+=8UL )
548 auto element( B.begin(k) );
549 const auto end( B.end(k) );
550 const size_t itmp( ( ii+8UL > iiend )?( iiend ):( ii+8UL ) );
552 for( ; element!=
end; ++element )
554 const size_t j1( element->index() );
556 const size_t iend(
UPP ?
min(j1+1UL,itmp) : itmp );
558 for(
size_t i=ibegin; i<iend; ++i ) {
560 C(i,j1) = A(i,k) * element->value();
562 C(i,j1) += A(i,k) * element->value();
570 for(
size_t i=0UL; i<A.rows(); ++i ) {
571 for(
size_t j=i+1UL; j<B.columns(); ++j ) {
572 C(i,j) =
HERM ?
conj( C(j,i) ) : C(j,i);
593 template<
typename MT3
596 static inline auto selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
597 -> EnableIf_t< UseDefaultKernel_v<MT3,MT4,MT5> >
599 selectDefaultAssignKernel( C, A, B );
619 template<
typename MT3
622 static inline auto selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
623 -> EnableIf_t< UseOptimizedKernel_v<MT3,MT4,MT5> >
627 for(
size_t j=0UL; j<B.rows(); ++j )
629 const size_t iibegin( ( IsLower_v<MT4> )
630 ?( IsStrictlyLower_v<MT4> ? j+1UL : j )
632 const size_t iiend( ( IsUpper_v<MT4> )
633 ?( IsStrictlyUpper_v<MT4> ? j : j+1UL )
637 for(
size_t ii=iibegin; ii<iiend; ii+=8UL )
639 auto element( B.begin(j) );
640 const auto end( B.end(j) );
641 const size_t itmp( ( ii+8UL > iiend )?( iiend ):( ii+8UL ) );
643 for( ; element!=
end; ++element )
645 const size_t j1( element->index() );
647 const size_t iend(
UPP ?
min(j1+1UL,itmp) : itmp );
649 for(
size_t i=ibegin; i<iend; ++i ) {
650 C(i,j1) += A(i,j) * element->value();
657 for(
size_t i=0UL; i<A.rows(); ++i ) {
658 for(
size_t j=i+1UL; j<B.columns(); ++j ) {
659 C(i,j) =
HERM ?
conj( C(j,i) ) : C(j,i);
680 template<
typename MT3
683 static inline auto selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
684 -> EnableIf_t< UseDefaultKernel_v<MT3,MT4,MT5> >
686 selectDefaultAssignKernel( C, A, B );
706 template<
typename MT3
709 static inline auto selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
710 -> EnableIf_t< UseOptimizedKernel_v<MT3,MT4,MT5> >
714 const ForwardFunctor fwd;
716 const OppositeType_t<MT5> tmp(
serial( B ) );
717 assign( C, fwd( A * tmp ) );
735 template<
typename MT
737 friend inline auto assign( SparseMatrix<MT,SO>& lhs,
const DMatSMatMultExpr& rhs )
738 -> DisableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
742 using TmpType = If_t< SO, OppositeType, ResultType >;
754 const ForwardFunctor fwd;
756 const TmpType tmp(
serial( rhs ) );
757 assign( ~lhs, fwd( tmp ) );
777 template<
typename MT
779 friend inline auto assign( Matrix<MT,SO>& lhs,
const DMatSMatMultExpr& rhs )
780 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
789 const ForwardFunctor fwd;
791 if( IsSymmetric_v<MT1> && IsSymmetric_v<MT2> )
792 assign( ~lhs, fwd(
trans( rhs.lhs_ ) *
trans( rhs.rhs_ ) ) );
793 else if( IsSymmetric_v<MT1> )
794 assign( ~lhs, fwd(
trans( rhs.lhs_ ) * rhs.rhs_ ) );
796 assign( ~lhs, fwd( rhs.lhs_ *
trans( rhs.rhs_ ) ) );
814 template<
typename MT
816 friend inline auto addAssign( DenseMatrix<MT,SO>& lhs,
const DMatSMatMultExpr& rhs )
817 -> DisableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
834 DMatSMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
850 template<
typename MT3
853 static inline void selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
855 if( C.rows() * C.columns() < DMATSMATMULT_THRESHOLD )
856 selectSmallAddAssignKernel( C, A, B );
858 selectLargeAddAssignKernel( C, A, B );
877 template<
typename MT3
880 static inline void selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
882 for(
size_t j=0UL; j<B.rows(); ++j )
884 if( IsDiagonal_v<MT4> )
886 auto element( B.begin(j) );
887 const auto end( B.end(j) );
889 for( ; element!=
end; ++element ) {
890 C(j,element->index()) += A(j,j) * element->value();
895 const size_t iibegin( ( IsLower_v<MT4> )
896 ?( IsStrictlyLower_v<MT4> ? j+1UL : j )
898 const size_t iiend( ( IsUpper_v<MT4> )
899 ?( IsStrictlyUpper_v<MT4> ? j : j+1UL )
903 for(
size_t ii=iibegin; ii<iiend; ii+=8UL )
905 auto element( B.begin(j) );
906 const auto end( B.end(j) );
907 const size_t itmp( ( ii+8UL > iiend )?( iiend ):( ii+8UL ) );
909 for( ; element!=
end; ++element )
911 const size_t j1( element->index() );
912 const size_t ibegin(
LOW ?
max(j1,ii) : ii );
913 const size_t iend(
UPP ?
min(j1+1UL,itmp) : itmp );
915 for(
size_t i=ibegin; i<iend; ++i ) {
916 C(i,j1) += A(i,j) * element->value();
940 template<
typename MT3
943 static inline void selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
947 const ForwardFunctor fwd;
949 const OppositeType_t<MT5> tmp(
serial( B ) );
950 addAssign( C, fwd( A * tmp ) );
970 template<
typename MT
972 friend inline auto addAssign( Matrix<MT,SO>& lhs,
const DMatSMatMultExpr& rhs )
973 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
982 const ForwardFunctor fwd;
984 if( IsSymmetric_v<MT1> && IsSymmetric_v<MT2> )
985 addAssign( ~lhs, fwd(
trans( rhs.lhs_ ) *
trans( rhs.rhs_ ) ) );
986 else if( IsSymmetric_v<MT1> )
987 addAssign( ~lhs, fwd(
trans( rhs.lhs_ ) * rhs.rhs_ ) );
989 addAssign( ~lhs, fwd( rhs.lhs_ *
trans( rhs.rhs_ ) ) );
1011 template<
typename MT
1013 friend inline auto subAssign( DenseMatrix<MT,SO>& lhs,
const DMatSMatMultExpr& rhs )
1014 -> DisableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
1031 DMatSMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1047 template<
typename MT3
1050 static inline void selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1052 if( C.rows() * C.columns() < DMATSMATMULT_THRESHOLD )
1053 selectSmallSubAssignKernel( C, A, B );
1055 selectLargeSubAssignKernel( C, A, B );
1074 template<
typename MT3
1077 static inline void selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1079 for(
size_t j=0UL; j<B.rows(); ++j )
1081 if( IsDiagonal_v<MT4> )
1083 auto element( B.begin(j) );
1084 const auto end( B.end(j) );
1086 for( ; element!=
end; ++element ) {
1087 C(j,element->index()) -= A(j,j) * element->value();
1092 const size_t iibegin( ( IsLower_v<MT4> )
1093 ?( IsStrictlyLower_v<MT4> ? j+1UL : j )
1095 const size_t iiend( ( IsUpper_v<MT4> )
1096 ?( IsStrictlyUpper_v<MT4> ? j : j+1UL )
1100 for(
size_t ii=iibegin; ii<iiend; ii+=8UL )
1102 auto element( B.begin(j) );
1103 const auto end( B.end(j) );
1104 const size_t itmp( ( ii+8UL > iiend )?( iiend ):( ii+8UL ) );
1106 for( ; element!=
end; ++element )
1108 const size_t j1( element->index() );
1109 const size_t ibegin(
LOW ?
max(j1,ii) : ii );
1110 const size_t iend(
UPP ?
min(j1+1UL,itmp) : itmp );
1112 for(
size_t i=ibegin; i<iend; ++i ) {
1113 C(i,j1) -= A(i,j) * element->value();
1137 template<
typename MT3
1140 static inline void selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1144 const ForwardFunctor fwd;
1146 const OppositeType_t<MT5> tmp(
serial( B ) );
1147 subAssign( C, fwd( A * tmp ) );
1167 template<
typename MT
1169 friend inline auto subAssign( Matrix<MT,SO>& lhs,
const DMatSMatMultExpr& rhs )
1170 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
1179 const ForwardFunctor fwd;
1181 if( IsSymmetric_v<MT1> && IsSymmetric_v<MT2> )
1182 subAssign( ~lhs, fwd(
trans( rhs.lhs_ ) *
trans( rhs.rhs_ ) ) );
1183 else if( IsSymmetric_v<MT1> )
1184 subAssign( ~lhs, fwd(
trans( rhs.lhs_ ) * rhs.rhs_ ) );
1186 subAssign( ~lhs, fwd( rhs.lhs_ *
trans( rhs.rhs_ ) ) );
1208 template<
typename MT
1210 friend inline void schurAssign( DenseMatrix<MT,SO>& lhs,
const DMatSMatMultExpr& rhs )
1222 schurAssign( ~lhs, tmp );
1254 template<
typename MT
1257 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
1294 template<
typename MT
1297 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
1301 using TmpType = If_t< SO, OppositeType, ResultType >;
1313 const ForwardFunctor fwd;
1315 const TmpType tmp( rhs );
1336 template<
typename MT
1339 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
1348 const ForwardFunctor fwd;
1350 if( IsSymmetric_v<MT1> && IsSymmetric_v<MT2> )
1352 else if( IsSymmetric_v<MT1> )
1375 template<
typename MT
1378 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
1415 template<
typename MT
1418 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
1427 const ForwardFunctor fwd;
1429 if( IsSymmetric_v<MT1> && IsSymmetric_v<MT2> )
1431 else if( IsSymmetric_v<MT1> )
1459 template<
typename MT
1462 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
1499 template<
typename MT
1502 -> EnableIf_t< CanExploitSymmetry_v<MT,MT1,MT2> >
1511 const ForwardFunctor fwd;
1513 if( IsSymmetric_v<MT1> && IsSymmetric_v<MT2> )
1515 else if( IsSymmetric_v<MT1> )
1540 template<
typename MT
1606 template<
typename MT1
1609 IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > ) ||
1610 IsZero_v<MT2> >* =
nullptr >
1611 inline const DMatSMatMultExpr<MT1,MT2,false,false,false,false>
1612 dmatsmatmult(
const DenseMatrix<MT1,false>& lhs,
const SparseMatrix<MT2,false>& rhs )
1618 return DMatSMatMultExpr<MT1,MT2,false,false,false,false>( ~lhs, ~rhs );
1638 template<
typename MT1
1640 , EnableIf_t< IsIdentity_v<MT2> &&
1641 IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > >* =
nullptr >
1643 dmatsmatmult(
const DenseMatrix<MT1,false>& lhs,
const SparseMatrix<MT2,false>& rhs )
1670 template<
typename MT1
1672 , EnableIf_t< IsZero_v<MT2> >* =
nullptr >
1673 inline decltype(
auto)
1674 dmatsmatmult( const DenseMatrix<MT1,false>& lhs, const SparseMatrix<MT2,false>& rhs )
1680 using ReturnType =
const MultTrait_t< ResultType_t<MT1>, ResultType_t<MT2> >;
1685 return ReturnType( (~lhs).
rows(), (~rhs).
columns() );
1720 template<
typename MT1
1722 inline decltype(
auto)
1731 return dmatsmatmult( ~lhs, ~rhs );
1768 template<
typename MT1
1774 inline decltype(
auto)
declsym( const DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
1782 using ReturnType =
const DMatSMatMultExpr<MT1,MT2,true,HF,LF,UF>;
1783 return ReturnType( dm.leftOperand(), dm.rightOperand() );
1813 template<
typename MT1
1819 inline decltype(
auto)
declherm( const DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
1827 using ReturnType =
const DMatSMatMultExpr<MT1,MT2,SF,true,LF,UF>;
1828 return ReturnType( dm.leftOperand(), dm.rightOperand() );
1858 template<
typename MT1
1864 inline decltype(
auto)
decllow( const DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
1872 using ReturnType =
const DMatSMatMultExpr<MT1,MT2,SF,HF,true,UF>;
1873 return ReturnType( dm.leftOperand(), dm.rightOperand() );
1903 template<
typename MT1
1909 inline decltype(
auto)
declupp( const DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
1917 using ReturnType =
const DMatSMatMultExpr<MT1,MT2,SF,HF,LF,true>;
1918 return ReturnType( dm.leftOperand(), dm.rightOperand() );
1948 template<
typename MT1
1954 inline decltype(
auto)
decldiag( const DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
1962 using ReturnType =
const DMatSMatMultExpr<MT1,MT2,SF,HF,true,true>;
1963 return ReturnType( dm.leftOperand(), dm.rightOperand() );
1979 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
1980 struct Size< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>, 0UL >
1981 :
public Size<MT1,0UL>
1984 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
1985 struct Size< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF>, 1UL >
1986 :
public Size<MT2,1UL>
2002 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2003 struct IsAligned< DMatSMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2004 :
public IsAligned<MT1>
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: DMatSMatMultExpr.h:245
#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
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:133
Headerfile for the generic min algorithm.
Header file for the blaze::checked and blaze::unchecked instances.
Header file for the decldiag trait.
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DMatSMatMultExpr.h:267
decltype(auto) decldiag(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as diagonal.
Definition: DMatDeclDiagExpr.h:975
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatSMatMultExpr.h:399
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatSMatMultExpr.h:357
Header file for basic type definitions.
If_t< evaluateRight, const RT2, CT2 > RT
Type for the assignment of the right-hand side sparse matrix operand.
Definition: DMatSMatMultExpr.h:259
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatSMatMultExpr.h:421
const ResultType CompositeType
Data type for composite expression templates.
Definition: DMatSMatMultExpr.h:247
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias template for the If class template.The If_t alias template provides a convenient shor...
Definition: If.h:109
Header file for the declherm trait.
ResultType_t< MT2 > RT2
Result type of the right-hand side sparse matrix expression.
Definition: DMatSMatMultExpr.h:134
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
Header file for the serial shim.
Header file for the IsDiagonal type trait.
Base template for the DeclUppTrait class.
Definition: DeclUppTrait.h:134
#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.
Header file for the IsSame and IsStrictlySame type traits.
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
Constraint on the data type.
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatSMatMultExpr.h:243
decltype(auto) subvector(Vector< VT, TF > &, RSAs...)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:154
Header file for the MAYBE_UNUSED function template.
Header file for the IsIdentity type trait.
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:1001
Header file for the Computation base class.
Header file for the MatMatMultExpr base class.
Header file for the reset shim.
Constraints on the storage order of matrix types.
DMatSMatMultExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the DMatSMatMultExpr class.
Definition: DMatSMatMultExpr.h:277
Header file for the RequiresEvaluation type trait.
System settings for performance optimizations.
If_t< evaluateLeft, const RT1, CT1 > LT
Type for the assignment of the left-hand side dense matrix operand.
Definition: DMatSMatMultExpr.h:256
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse matrix operand.
Definition: DMatSMatMultExpr.h:387
ElementType_t< RT2 > ET2
Element type of the right-hand side sparse matrix expression.
Definition: DMatSMatMultExpr.h:136
CompositeType_t< MT1 > CT1
Composite type of the left-hand side dense matrix expression.
Definition: DMatSMatMultExpr.h:137
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes....
Definition: DenseMatrix.h:81
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes....
Definition: Forward.h:145
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatSMatMultExpr.h:292
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatSMatMultExpr.h:431
Constraint on the data type.
Constraint on the data type.
const ElementType ReturnType
Return type for expression template evaluations.
Definition: DMatSMatMultExpr.h:246
Headerfile for the generic max algorithm.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatSMatMultExpr.h:367
ElementType_t< RT1 > ET1
Element type of the left-hand side dense matrix expression.
Definition: DMatSMatMultExpr.h:135
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
#define BLAZE_CONSTRAINT_MUST_BE_ZERO_TYPE(T)
Constraint on the data type.In case the given data type T is not a zero vector or matrix type,...
Definition: Zero.h:61
Generic wrapper for the decllow() function.
Definition: DeclLow.h:59
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:1162
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatSMatMultExpr.h:377
Header file for the decllow trait.
#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.
decltype(auto) decllow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as lower.
Definition: DMatDeclLowExpr.h:1001
Header file for the IsLower type trait.
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Header file for the IsAligned type trait.
static constexpr bool HERM
Flag for Hermitian matrices.
Definition: DMatSMatMultExpr.h:153
Generic wrapper for the null function.
Definition: Noop.h:60
Header file for the IsTriangular type trait.
Base template for the DeclSymTrait class.
Definition: DeclSymTrait.h:134
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
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:1198
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:438
static constexpr bool evaluateRight
Compilation switch for the composite type of the right-hand side sparse matrix expression.
Definition: DMatSMatMultExpr.h:148
Header file for the DeclDiag functor.
Constraint on the data type.
ResultType_t< MT1 > RT1
Result type of the left-hand side dense matrix expression.
Definition: DMatSMatMultExpr.h:133
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:103
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatSMatMultExpr.h:341
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.The OppositeType_t alias declaration provi...
Definition: Aliases.h:270
Header file for the conjugate shim.
Header file for the declupp trait.
Base class for all matrix/matrix multiplication expression templates.The MatMatMultExpr class serves ...
Definition: MatMatMultExpr.h:67
#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,...
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
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.The TransposeType_t alias declaration pro...
Definition: Aliases.h:470
Header file for run time assertion macros.
Base template for the DeclHermTrait class.
Definition: DeclHermTrait.h:134
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.The CompositeType_t alias declaration pro...
Definition: Aliases.h:90
Base template for the MultTrait class.
Definition: MultTrait.h:146
Expression object for dense matrix-sparse matrix multiplications.The DMatSMatMultExpr class represent...
Definition: DMatSMatMultExpr.h:127
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) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
Header file for the IsZero type trait.
Header file for the declsym trait.
#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
If_t< IsExpression_v< MT1 >, const MT1, const MT1 & > LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatSMatMultExpr.h:250
Header file for all forward declarations for expression class templates.
decltype(auto) declsym(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as symmetric.
Definition: DMatDeclSymExpr.h:1002
Header file for the isDefault shim.
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
Constraint on the data type.
CompositeType_t< MT2 > CT2
Composite type of the right-hand side sparse matrix expression.
Definition: DMatSMatMultExpr.h:138
static constexpr bool evaluateLeft
Compilation switch for the composite type of the left-hand side dense matrix expression.
Definition: DMatSMatMultExpr.h:143
Constraints on the storage order of matrix types.
Generic wrapper for the declherm() function.
Definition: DeclHerm.h:59
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
If_t< IsExpression_v< MT2 >, const MT2, const MT2 & > RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: DMatSMatMultExpr.h:253
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
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
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
#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:59
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:765
static constexpr bool SYM
Flag for symmetric matrices.
Definition: DMatSMatMultExpr.h:152
Base template for the DeclLowTrait class.
Definition: DeclLowTrait.h:134
decltype(auto) declherm(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as Hermitian.
Definition: DMatDeclHermExpr.h:1002
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:241
Header file for the IsComputation type trait class.
Header file for the IsBuiltin type trait.
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
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
Header file for the IntegralConstant class template.
Generic wrapper for the decldiag() function.
Definition: DeclDiag.h:59
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatSMatMultExpr.h:244
RightOperand rhs_
Right-hand side sparse matrix of the multiplication expression.
Definition: DMatSMatMultExpr.h:439
Header file for the DeclHerm functor.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:635
Header file for the IsUpper type trait.
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DMatSMatMultExpr.h:264
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1324
Constraint on the data type.
Generic wrapper for the declsym() function.
Definition: DeclSym.h:59
Base template for the DeclDiagTrait class.
Definition: DeclDiagTrait.h:134
static constexpr bool UPP
Flag for upper matrices.
Definition: DMatSMatMultExpr.h:155
static constexpr bool LOW
Flag for lower matrices.
Definition: DMatSMatMultExpr.h:154
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:951
Header file for the IsResizable type trait.
Header file for the Size type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_ZERO_TYPE(T)
Constraint on the data type.In case the given data type T is a zero vector or matrix type,...
Definition: Zero.h:81
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,...
Definition: Assert.h:101
Header file for the DeclSym functor.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatSMatMultExpr.h:411
#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.
Header file for the function trace functionality.
LeftOperand lhs_
Left-hand side dense matrix of the multiplication expression.
Definition: DMatSMatMultExpr.h:438