35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATDMATMULTEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_SMATDMATMULTEXPR_H_ 122 template<
typename MT1
128 class SMatDMatMultExpr
129 :
public MatMatMultExpr< DenseMatrix< SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF>, false > >
130 ,
private Computation
144 static constexpr
bool evaluateLeft = ( IsComputation_v<MT1> || RequiresEvaluation_v<MT1> );
149 static constexpr
bool evaluateRight = ( IsComputation_v<MT2> || RequiresEvaluation_v<MT2> );
153 static constexpr
bool SYM = ( SF && !( HF || LF || UF ) );
154 static constexpr
bool HERM = ( HF && !( LF || UF ) );
155 static constexpr
bool LOW = ( LF || ( ( SF || HF ) && UF ) );
156 static constexpr
bool UPP = ( UF || ( ( SF || HF ) && LF ) );
165 template<
typename T1,
typename T2,
typename T3 >
175 template<
typename T1,
typename T2,
typename T3 >
176 static constexpr
bool UseVectorizedKernel_v =
177 ( useOptimizedKernels &&
179 T1::simdEnabled && T3::simdEnabled &&
180 IsRowMajorMatrix_v<T1> &&
181 IsSIMDCombinable_v< ElementType_t<T1>
195 template<
typename T1,
typename T2,
typename T3 >
196 static constexpr
bool UseOptimizedKernel_v =
197 ( useOptimizedKernels &&
198 !UseVectorizedKernel_v<T1,T2,T3> &&
200 !IsResizable_v< ElementType_t<T1> > &&
201 !IsResizable_v<ET1> );
210 template<
typename T1,
typename T2,
typename T3 >
211 static constexpr
bool UseDefaultKernel_v =
212 ( !UseVectorizedKernel_v<T1,T2,T3> &&
213 !UseOptimizedKernel_v<T1,T2,T3> );
280 ( !IsDiagonal_v<MT2> &&
282 HasSIMDAdd_v<ET1,ET2> &&
283 HasSIMDMult_v<ET1,ET2> );
320 if( IsDiagonal_v<MT1> ) {
323 else if( IsDiagonal_v<MT2> ) {
326 else if( IsTriangular_v<MT1> || IsTriangular_v<MT2> ) {
327 const size_t begin( ( IsUpper_v<MT1> )
328 ?( ( IsLower_v<MT2> )
329 ?(
max( ( IsStrictlyUpper_v<MT1> ? i+1UL : i )
330 , ( IsStrictlyLower_v<MT2> ? j+1UL : j ) ) )
331 :( IsStrictlyUpper_v<MT1> ? i+1UL : i ) )
332 :( ( IsLower_v<MT2> )
333 ?( IsStrictlyLower_v<MT2> ? j+1UL : j )
335 const size_t end( ( IsLower_v<MT1> )
336 ?( ( IsUpper_v<MT2> )
337 ?(
min( ( IsStrictlyLower_v<MT1> ? i : i+1UL )
338 , ( IsStrictlyUpper_v<MT2> ? j : j+1UL ) ) )
339 :( IsStrictlyLower_v<MT1> ? i : i+1UL ) )
340 :( ( IsUpper_v<MT2> )
341 ?( IsStrictlyUpper_v<MT2> ? j : j+1UL )
342 :(
lhs_.columns() ) ) );
366 if( i >=
lhs_.rows() ) {
369 if( j >=
rhs_.columns() ) {
381 inline size_t rows() const noexcept {
392 return rhs_.columns();
422 template<
typename T >
423 inline bool canAlias(
const T* alias )
const noexcept {
424 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
434 template<
typename T >
435 inline bool isAliased(
const T* alias )
const noexcept {
436 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
446 return rhs_.isAligned();
456 return (
rows() *
columns() >= SMP_SMATDMATMULT_THRESHOLD ) && !IsDiagonal_v<MT2>;
479 template<
typename MT
498 SMatDMatMultExpr::selectAssignKernel( ~lhs, A, B );
517 template<
typename MT3
520 static inline auto selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
523 const size_t block( IsRowMajorMatrix_v<MT3> || IsDiagonal_v<MT5> ? B.columns() : 64UL );
527 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
529 const size_t jtmp(
min( jj+block, B.columns() ) );
531 for(
size_t i=0UL; i<A.rows(); ++i )
533 auto element( A.begin(i) );
534 const auto end( A.end(i) );
536 for( ; element!=
end; ++element )
538 const size_t i1( element->index() );
540 if( IsDiagonal_v<MT5> )
542 C(i,i1) = element->value() * B(i1,i1);
546 const size_t jbegin( ( IsUpper_v<MT5> )
548 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
549 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
551 const size_t jend( ( IsLower_v<MT5> )
553 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) )
554 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) ) )
557 if( (
SYM ||
HERM ||
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
562 for(
size_t j=jbegin; j<jend; ++j ) {
564 C(i,j) = element->value() * B(i1,j);
566 C(i,j) += element->value() * B(i1,j);
574 for(
size_t i=0UL; i<A.rows(); ++i ) {
575 for(
size_t j=i+1UL; j<B.columns(); ++j ) {
576 C(i,j) =
HERM ?
conj( C(j,i) ) : C(j,i);
598 template<
typename MT3
601 static inline auto selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
602 -> EnableIf_t< UseOptimizedKernel_v<MT3,MT4,MT5> >
604 const size_t block( IsRowMajorMatrix_v<MT3> ? B.columns() : 64UL );
608 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
610 const size_t jtmp(
min( jj+block, B.columns() ) );
612 for(
size_t i=0UL; i<A.rows(); ++i )
614 const auto end( A.end(i) );
615 auto element( A.begin(i) );
617 const size_t nonzeros( A.nonZeros(i) );
618 const size_t kpos( nonzeros &
size_t(-4) );
621 for(
size_t k=0UL; k<kpos; k+=4UL )
623 const size_t i1( element->index() );
624 const ET1 v1( element->value() );
626 const size_t i2( element->index() );
627 const ET1 v2( element->value() );
629 const size_t i3( element->index() );
630 const ET1 v3( element->value() );
632 const size_t i4( element->index() );
633 const ET1 v4( element->value() );
638 const size_t jbegin( ( IsUpper_v<MT5> )
640 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
641 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
642 :(
UPP ?
max(i,jj) : jj ) );
643 const size_t jend( ( IsLower_v<MT5> )
645 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i4 : i4+1UL ) ) )
646 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i4 : i4+1UL ) ) ) )
649 if( (
SYM ||
HERM ||
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
654 const size_t jnum( jend - jbegin );
655 const size_t jpos( jbegin + ( jnum &
size_t(-4) ) );
658 for(
size_t j=jbegin; j<jpos; j+=4UL ) {
659 C(i,j ) += v1 * B(i1,j ) + v2 * B(i2,j ) + v3 * B(i3,j ) + v4 * B(i4,j );
660 C(i,j+1UL) += v1 * B(i1,j+1UL) + v2 * B(i2,j+1UL) + v3 * B(i3,j+1UL) + v4 * B(i4,j+1UL);
661 C(i,j+2UL) += v1 * B(i1,j+2UL) + v2 * B(i2,j+2UL) + v3 * B(i3,j+2UL) + v4 * B(i4,j+2UL);
662 C(i,j+3UL) += v1 * B(i1,j+3UL) + v2 * B(i2,j+3UL) + v3 * B(i3,j+3UL) + v4 * B(i4,j+3UL);
664 for(
size_t j=jpos; j<jend; ++j ) {
665 C(i,j) += v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
669 for( ; element!=
end; ++element )
671 const size_t i1( element->index() );
672 const ET1 v1( element->value() );
674 const size_t jbegin( ( IsUpper_v<MT5> )
676 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
677 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
678 :(
UPP ?
max(i,jj) : jj ) );
679 const size_t jend( ( IsLower_v<MT5> )
681 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) )
682 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) ) )
685 if( (
SYM ||
HERM ||
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
690 const size_t jnum( jend - jbegin );
691 const size_t jpos( jbegin + ( jnum &
size_t(-4) ) );
694 for(
size_t j=jbegin; j<jpos; j+=4UL ) {
695 C(i,j ) += v1 * B(i1,j );
696 C(i,j+1UL) += v1 * B(i1,j+1UL);
697 C(i,j+2UL) += v1 * B(i1,j+2UL);
698 C(i,j+3UL) += v1 * B(i1,j+3UL);
700 for(
size_t j=jpos; j<jend; ++j ) {
701 C(i,j) += v1 * B(i1,j);
708 for(
size_t i=0UL; i<A.rows(); ++i ) {
709 for(
size_t j=i+1UL; j<B.columns(); ++j ) {
710 C(i,j) =
HERM ?
conj( C(j,i) ) : C(j,i);
732 template<
typename MT3
735 static inline auto selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
736 -> EnableIf_t< UseVectorizedKernel_v<MT3,MT4,MT5> >
738 constexpr
bool remainder( !IsPadded_v<MT3> || !IsPadded_v<MT5> );
742 for(
size_t i=0UL; i<A.rows(); ++i )
744 const auto end( A.end(i) );
745 auto element( A.begin(i) );
747 const size_t nonzeros( A.nonZeros(i) );
748 const size_t kpos( nonzeros &
size_t(-4) );
751 for(
size_t k=0UL; k<kpos; k+=4UL )
753 const size_t i1( element->index() );
754 const ET1 v1( element->value() );
756 const size_t i2( element->index() );
757 const ET1 v2( element->value() );
759 const size_t i3( element->index() );
760 const ET1 v3( element->value() );
762 const size_t i4( element->index() );
763 const ET1 v4( element->value() );
773 const size_t jbegin( ( IsUpper_v<MT5> )
774 ?( ( IsStrictlyUpper_v<MT5> )
778 const size_t jend( ( IsLower_v<MT5> )
779 ?( ( IsStrictlyLower_v<MT5> )
782 :(
SYM ||
HERM ||
LOW ? i+1UL : B.columns() ) );
785 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
791 C.store( i, j, C.load(i,j) + xmm1 * B.load(i1,j) + xmm2 * B.load(i2,j) + xmm3 * B.load(i3,j) + xmm4 * B.load(i4,j) );
793 for( ; remainder && j<jend; ++j ) {
794 C(i,j) += v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
798 for( ; element!=
end; ++element )
800 const size_t i1( element->index() );
801 const ET1 v1( element->value() );
805 const size_t jbegin( ( IsUpper_v<MT5> )
806 ?( ( IsStrictlyUpper_v<MT5> )
810 const size_t jend( ( IsLower_v<MT5> )
811 ?( ( IsStrictlyLower_v<MT5> )
814 :(
SYM ||
HERM ||
LOW ? i+1UL : B.columns() ) );
817 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
823 C.store( i, j, C.load(i,j) + xmm1 * B.load(i1,j) );
825 for( ; remainder && j<jend; ++j ) {
826 C(i,j) += v1 * B(i1,j);
832 for(
size_t i=0UL; i<A.rows(); ++i ) {
833 for(
size_t j=i+1UL; j<B.columns(); ++j ) {
834 C(i,j) =
HERM ?
conj( C(j,i) ) : C(j,i);
855 template<
typename MT
857 friend inline void assign( SparseMatrix<MT,SO>& lhs,
const SMatDMatMultExpr& rhs )
861 using TmpType = If_t< SO, OppositeType, ResultType >;
873 const ForwardFunctor fwd;
875 const TmpType tmp(
serial( rhs ) );
876 assign( ~lhs, fwd( tmp ) );
894 template<
typename MT
896 friend inline void addAssign( DenseMatrix<MT,SO>& lhs,
const SMatDMatMultExpr& rhs )
913 SMatDMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
932 template<
typename MT3
935 static inline auto selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
936 -> EnableIf_t< UseDefaultKernel_v<MT3,MT4,MT5> >
938 const size_t block( IsRowMajorMatrix_v<MT3> || IsDiagonal_v<MT5> ? B.columns() : 64UL );
940 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
942 const size_t jtmp(
min( jj+block, B.columns() ) );
944 for(
size_t i=0UL; i<A.rows(); ++i )
946 const auto end( A.end(i) );
947 auto element( A.begin(i) );
949 for( ; element!=
end; ++element )
951 const size_t i1( element->index() );
953 if( IsDiagonal_v<MT5> )
955 C(i,i1) += element->value() * B(i1,i1);
959 const size_t jbegin( ( IsUpper_v<MT5> )
961 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
962 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
964 const size_t jend( ( IsLower_v<MT5> )
966 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) )
967 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) ) )
968 :(
LOW ?
min(i+1UL,jtmp) : jtmp ) );
970 if( (
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
975 const size_t jnum( jend - jbegin );
976 const size_t jpos( jbegin + ( jnum &
size_t(-4) ) );
979 for(
size_t j=jbegin; j<jpos; j+=4UL ) {
980 C(i,j ) += element->value() * B(i1,j );
981 C(i,j+1UL) += element->value() * B(i1,j+1UL);
982 C(i,j+2UL) += element->value() * B(i1,j+2UL);
983 C(i,j+3UL) += element->value() * B(i1,j+3UL);
985 for(
size_t j=jpos; j<jend; ++j ) {
986 C(i,j) += element->value() * B(i1,j);
1010 template<
typename MT3
1013 static inline auto selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1014 -> EnableIf_t< UseOptimizedKernel_v<MT3,MT4,MT5> >
1016 const size_t block( IsRowMajorMatrix_v<MT3> ? B.columns() : 64UL );
1018 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1020 const size_t jtmp(
min( jj+block, B.columns() ) );
1022 for(
size_t i=0UL; i<A.rows(); ++i )
1024 const auto end( A.end(i) );
1025 auto element( A.begin(i) );
1027 const size_t nonzeros( A.nonZeros(i) );
1028 const size_t kpos( nonzeros &
size_t(-4) );
1031 for(
size_t k=0UL; k<kpos; k+=4UL )
1033 const size_t i1( element->index() );
1034 const ET1 v1( element->value() );
1036 const size_t i2( element->index() );
1037 const ET1 v2( element->value() );
1039 const size_t i3( element->index() );
1040 const ET1 v3( element->value() );
1042 const size_t i4( element->index() );
1043 const ET1 v4( element->value() );
1048 const size_t jbegin( ( IsUpper_v<MT5> )
1050 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
1051 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
1052 :(
UPP ?
max(i,jj) : jj ) );
1053 const size_t jend( ( IsLower_v<MT5> )
1055 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i4 : i4+1UL ) ) )
1056 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i4 : i4+1UL ) ) ) )
1057 :(
LOW ?
min(i+1UL,jtmp) : jtmp ) );
1059 if( (
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
1064 const size_t jnum( jend - jbegin );
1065 const size_t jpos( jbegin + ( jnum &
size_t(-4) ) );
1068 for(
size_t j=jbegin; j<jpos; j+=4UL ) {
1069 C(i,j ) += v1 * B(i1,j ) + v2 * B(i2,j ) + v3 * B(i3,j ) + v4 * B(i4,j );
1070 C(i,j+1UL) += v1 * B(i1,j+1UL) + v2 * B(i2,j+1UL) + v3 * B(i3,j+1UL) + v4 * B(i4,j+1UL);
1071 C(i,j+2UL) += v1 * B(i1,j+2UL) + v2 * B(i2,j+2UL) + v3 * B(i3,j+2UL) + v4 * B(i4,j+2UL);
1072 C(i,j+3UL) += v1 * B(i1,j+3UL) + v2 * B(i2,j+3UL) + v3 * B(i3,j+3UL) + v4 * B(i4,j+3UL);
1074 for(
size_t j=jpos; j<jend; ++j ) {
1075 C(i,j) += v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
1079 for( ; element!=
end; ++element )
1081 const size_t i1( element->index() );
1082 const ET1 v1( element->value() );
1084 const size_t jbegin( ( IsUpper_v<MT5> )
1086 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
1087 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
1088 :(
UPP ?
max(i,jj) : jj ) );
1089 const size_t jend( ( IsLower_v<MT5> )
1091 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) )
1092 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) ) )
1093 :(
LOW ?
min(i+1UL,jtmp) : jtmp ) );
1095 if( (
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
1100 const size_t jnum( jend - jbegin );
1101 const size_t jpos( jbegin + ( jnum &
size_t(-4) ) );
1104 for(
size_t j=jbegin; j<jpos; j+=4UL ) {
1105 C(i,j ) += v1 * B(i1,j );
1106 C(i,j+1UL) += v1 * B(i1,j+1UL);
1107 C(i,j+2UL) += v1 * B(i1,j+2UL);
1108 C(i,j+3UL) += v1 * B(i1,j+3UL);
1110 for(
size_t j=jpos; j<jend; ++j ) {
1111 C(i,j) += v1 * B(i1,j);
1134 template<
typename MT3
1137 static inline auto selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1138 -> EnableIf_t< UseVectorizedKernel_v<MT3,MT4,MT5> >
1140 constexpr
bool remainder( !IsPadded_v<MT3> || !IsPadded_v<MT5> );
1142 for(
size_t i=0UL; i<A.rows(); ++i )
1144 const auto end( A.end(i) );
1145 auto element( A.begin(i) );
1147 const size_t nonzeros( A.nonZeros(i) );
1148 const size_t kpos( nonzeros &
size_t(-4) );
1151 for(
size_t k=0UL; k<kpos; k+=4UL )
1153 const size_t i1( element->index() );
1154 const ET1 v1( element->value() );
1156 const size_t i2( element->index() );
1157 const ET1 v2( element->value() );
1159 const size_t i3( element->index() );
1160 const ET1 v3( element->value() );
1162 const size_t i4( element->index() );
1163 const ET1 v4( element->value() );
1173 const size_t jbegin( ( IsUpper_v<MT5> )
1174 ?( ( IsStrictlyUpper_v<MT5> )
1178 const size_t jend( ( IsLower_v<MT5> )
1179 ?( ( IsStrictlyLower_v<MT5> )
1180 ?(
LOW ?
min(i+1UL,i4) : i4 )
1181 :(
LOW ?
min(i,i4)+1UL : i4+1UL ) )
1182 :(
LOW ? i+1UL : B.columns() ) );
1185 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
1191 C.store( i, j, C.load(i,j) + xmm1 * B.load(i1,j) + xmm2 * B.load(i2,j) + xmm3 * B.load(i3,j) + xmm4 * B.load(i4,j) );
1193 for( ; remainder && j<jend; ++j ) {
1194 C(i,j) += v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
1198 for( ; element!=
end; ++element )
1200 const size_t i1( element->index() );
1201 const ET1 v1( element->value() );
1205 const size_t jbegin( ( IsUpper_v<MT5> )
1206 ?( ( IsStrictlyUpper_v<MT5> )
1210 const size_t jend( ( IsLower_v<MT5> )
1211 ?( ( IsStrictlyLower_v<MT5> )
1212 ?(
LOW ?
min(i+1UL,i1) : i1 )
1213 :(
LOW ?
min(i,i1)+1UL : i1+1UL ) )
1214 :(
LOW ? i+1UL : B.columns() ) );
1217 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
1223 C.store( i, j, C.load(i,j) + xmm1 * B.load(i1,j) );
1225 for( ; remainder && j<jend; ++j ) {
1226 C(i,j) += v1 * B(i1,j);
1251 template<
typename MT
1253 friend inline void subAssign( DenseMatrix<MT,SO>& lhs,
const SMatDMatMultExpr& rhs )
1270 SMatDMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1289 template<
typename MT3
1292 static inline auto selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1293 -> EnableIf_t< UseDefaultKernel_v<MT3,MT4,MT5> >
1295 const size_t block( IsRowMajorMatrix_v<MT3> || IsDiagonal_v<MT5> ? B.columns() : 64UL );
1297 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1299 const size_t jtmp(
min( jj+block, B.columns() ) );
1301 for(
size_t i=0UL; i<A.rows(); ++i )
1303 const auto end( A.end(i) );
1304 auto element( A.begin(i) );
1306 for( ; element!=
end; ++element )
1308 const size_t i1( element->index() );
1310 if( IsDiagonal_v<MT5> )
1312 C(i,i1) -= element->value() * B(i1,i1);
1316 const size_t jbegin( ( IsUpper_v<MT5> )
1318 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
1319 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
1321 const size_t jend( ( IsLower_v<MT5> )
1323 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) )
1324 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) ) )
1325 :(
LOW ?
min(i+1UL,jtmp) : jtmp ) );
1327 if( (
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
1332 const size_t jnum( jend - jbegin );
1333 const size_t jpos( jbegin + ( jnum &
size_t(-4) ) );
1336 for(
size_t j=jbegin; j<jpos; j+=4UL ) {
1337 C(i,j ) -= element->value() * B(i1,j );
1338 C(i,j+1UL) -= element->value() * B(i1,j+1UL);
1339 C(i,j+2UL) -= element->value() * B(i1,j+2UL);
1340 C(i,j+3UL) -= element->value() * B(i1,j+3UL);
1342 for(
size_t j=jpos; j<jend; ++j ) {
1343 C(i,j) -= element->value() * B(i1,j);
1367 template<
typename MT3
1370 static inline auto selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1371 -> EnableIf_t< UseOptimizedKernel_v<MT3,MT4,MT5> >
1373 const size_t block( IsRowMajorMatrix_v<MT3> ? B.columns() : 64UL );
1375 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1377 const size_t jtmp(
min( jj+block, B.columns() ) );
1379 for(
size_t i=0UL; i<A.rows(); ++i )
1381 const auto end( A.end(i) );
1382 auto element( A.begin(i) );
1384 const size_t nonzeros( A.nonZeros(i) );
1385 const size_t kpos( nonzeros &
size_t(-4) );
1388 for(
size_t k=0UL; k<kpos; k+=4UL )
1390 const size_t i1( element->index() );
1391 const ET1 v1( element->value() );
1393 const size_t i2( element->index() );
1394 const ET1 v2( element->value() );
1396 const size_t i3( element->index() );
1397 const ET1 v3( element->value() );
1399 const size_t i4( element->index() );
1400 const ET1 v4( element->value() );
1405 const size_t jbegin( ( IsUpper_v<MT5> )
1407 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
1408 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
1409 :(
UPP ?
max(i,jj) : jj ) );
1410 const size_t jend( ( IsLower_v<MT5> )
1412 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i4 : i4+1UL ) ) )
1413 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i4 : i4+1UL ) ) ) )
1414 :(
LOW ?
min(i+1UL,jtmp) : jtmp ) );
1416 if( (
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
1421 const size_t jnum( jend - jbegin );
1422 const size_t jpos( jbegin + ( jnum &
size_t(-4) ) );
1425 for(
size_t j=jbegin; j<jpos; j+=4UL ) {
1426 C(i,j ) -= v1 * B(i1,j ) + v2 * B(i2,j ) + v3 * B(i3,j ) + v4 * B(i4,j );
1427 C(i,j+1UL) -= v1 * B(i1,j+1UL) + v2 * B(i2,j+1UL) + v3 * B(i3,j+1UL) + v4 * B(i4,j+1UL);
1428 C(i,j+2UL) -= v1 * B(i1,j+2UL) + v2 * B(i2,j+2UL) + v3 * B(i3,j+2UL) + v4 * B(i4,j+2UL);
1429 C(i,j+3UL) -= v1 * B(i1,j+3UL) + v2 * B(i2,j+3UL) + v3 * B(i3,j+3UL) + v4 * B(i4,j+3UL);
1431 for(
size_t j=jpos; j<jend; ++j ) {
1432 C(i,j) -= v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
1436 for( ; element!=
end; ++element )
1438 const size_t i1( element->index() );
1439 const ET1 v1( element->value() );
1441 const size_t jbegin( ( IsUpper_v<MT5> )
1443 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
1444 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
1445 :(
UPP ?
max(i,jj) : jj ) );
1446 const size_t jend( ( IsLower_v<MT5> )
1448 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) )
1449 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) ) )
1450 :(
LOW ?
min(i+1UL,jtmp) : jtmp ) );
1452 if( (
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
1457 const size_t jnum( jend - jbegin );
1458 const size_t jpos( jbegin + ( jnum &
size_t(-4) ) );
1461 for(
size_t j=jbegin; j<jpos; j+=4UL ) {
1462 C(i,j ) -= v1 * B(i1,j );
1463 C(i,j+1UL) -= v1 * B(i1,j+1UL);
1464 C(i,j+2UL) -= v1 * B(i1,j+2UL);
1465 C(i,j+3UL) -= v1 * B(i1,j+3UL);
1467 for(
size_t j=jpos; j<jend; ++j ) {
1468 C(i,j) -= v1 * B(i1,j);
1491 template<
typename MT3
1494 static inline auto selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1495 -> EnableIf_t< UseVectorizedKernel_v<MT3,MT4,MT5> >
1497 constexpr
bool remainder( !IsPadded_v<MT3> || !IsPadded_v<MT5> );
1499 for(
size_t i=0UL; i<A.rows(); ++i )
1501 const auto end( A.end(i) );
1502 auto element( A.begin(i) );
1504 const size_t nonzeros( A.nonZeros(i) );
1505 const size_t kpos( nonzeros &
size_t(-4) );
1508 for(
size_t k=0UL; k<kpos; k+=4UL )
1510 const size_t i1( element->index() );
1511 const ET1 v1( element->value() );
1513 const size_t i2( element->index() );
1514 const ET1 v2( element->value() );
1516 const size_t i3( element->index() );
1517 const ET1 v3( element->value() );
1519 const size_t i4( element->index() );
1520 const ET1 v4( element->value() );
1530 const size_t jbegin( ( IsUpper_v<MT5> )
1531 ?( ( IsStrictlyUpper_v<MT5> )
1535 const size_t jend( ( IsLower_v<MT5> )
1536 ?( ( IsStrictlyLower_v<MT5> )
1537 ?(
LOW ?
min(i+1UL,i4) : i4 )
1538 :(
LOW ?
min(i,i4)+1UL : i4+1UL ) )
1539 :(
LOW ? i+1UL : B.columns() ) );
1542 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
1548 C.store( i, j, C.load(i,j) - xmm1 * B.load(i1,j) - xmm2 * B.load(i2,j) - xmm3 * B.load(i3,j) - xmm4 * B.load(i4,j) );
1550 for( ; remainder && j<jend; ++j ) {
1551 C(i,j) -= v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
1555 for( ; element!=
end; ++element )
1557 const size_t i1( element->index() );
1558 const ET1 v1( element->value() );
1562 const size_t jbegin( ( IsUpper_v<MT5> )
1563 ?( ( IsStrictlyUpper_v<MT5> )
1567 const size_t jend( ( IsLower_v<MT5> )
1568 ?( ( IsStrictlyLower_v<MT5> )
1569 ?(
LOW ?
min(i+1UL,i1) : i1 )
1570 :(
LOW ?
min(i,i1)+1UL : i1+1UL ) )
1571 :(
LOW ? i+1UL : B.columns() ) );
1574 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
1580 C.store( i, j, C.load(i,j) - xmm1 * B.load(i1,j) );
1582 for( ; remainder && j<jend; ++j ) {
1583 C(i,j) -= v1 * B(i1,j);
1608 template<
typename MT
1610 friend inline void schurAssign( DenseMatrix<MT,SO>& lhs,
const SMatDMatMultExpr& rhs )
1622 schurAssign( ~lhs, tmp );
1654 template<
typename MT
1657 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
1694 template<
typename MT
1697 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
1701 using TmpType = If_t< SO, OppositeType, ResultType >;
1713 const ForwardFunctor fwd;
1715 const TmpType tmp( rhs );
1737 template<
typename MT
1740 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
1782 template<
typename MT
1785 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
1824 template<
typename MT
1890 template<
typename MT1
1892 , DisableIf_t< ( IsIdentity_v<MT1> &&
1893 IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > ) ||
1894 IsZero_v<MT1> >* =
nullptr >
1895 inline const SMatDMatMultExpr<MT1,MT2,false,false,false,false>
1896 smatdmatmult(
const SparseMatrix<MT1,false>& lhs,
const DenseMatrix<MT2,false>& rhs )
1902 return SMatDMatMultExpr<MT1,MT2,false,false,false,false>( ~lhs, ~rhs );
1922 template<
typename MT1
1924 , EnableIf_t< IsIdentity_v<MT1> &&
1925 IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > >* =
nullptr >
1927 smatdmatmult(
const SparseMatrix<MT1,false>& lhs,
const DenseMatrix<MT2,false>& rhs )
1954 template<
typename MT1
1956 , EnableIf_t< IsZero_v<MT1> >* =
nullptr >
1957 inline decltype(
auto)
1958 smatdmatmult( const SparseMatrix<MT1,false>& lhs, const DenseMatrix<MT2,false>& rhs )
1964 using ReturnType =
const MultTrait_t< ResultType_t<MT1>, ResultType_t<MT2> >;
2004 template<
typename MT1
2006 inline decltype(
auto)
2015 return smatdmatmult( ~lhs, ~rhs );
2052 template<
typename MT1
2058 inline decltype(
auto)
declsym( const SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
2066 using ReturnType =
const SMatDMatMultExpr<MT1,MT2,true,HF,LF,UF>;
2067 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2097 template<
typename MT1
2103 inline decltype(
auto)
declherm( const SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
2111 using ReturnType =
const SMatDMatMultExpr<MT1,MT2,SF,true,LF,UF>;
2112 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2142 template<
typename MT1
2148 inline decltype(
auto)
decllow( const SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
2156 using ReturnType =
const SMatDMatMultExpr<MT1,MT2,SF,HF,true,UF>;
2157 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2187 template<
typename MT1
2193 inline decltype(
auto)
declupp( const SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
2201 using ReturnType =
const SMatDMatMultExpr<MT1,MT2,SF,HF,LF,true>;
2202 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2232 template<
typename MT1
2238 inline decltype(
auto)
decldiag( const SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
2246 using ReturnType =
const SMatDMatMultExpr<MT1,MT2,SF,HF,true,true>;
2247 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2263 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2264 struct Size< SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF>, 0UL >
2265 :
public Size<MT1,0UL>
2268 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2269 struct Size< SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF>, 1UL >
2270 :
public Size<MT2,1UL>
2286 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2287 struct IsAligned< SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2288 :
public IsAligned<MT2>
decltype(auto) subvector(Vector< VT, TF > &, RSAs...)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:329
#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
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatDMatMultExpr.h:455
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.
decltype(auto) decldiag(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as diagonal.
Definition: DMatDeclDiagExpr.h:975
Header file for basic type definitions.
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias declaration for the If class template.The If_t alias declaration provides a convenien...
Definition: If.h:109
Header file for the declherm trait.
static constexpr bool HERM
Flag for Hermitian matrices.
Definition: SMatDMatMultExpr.h:154
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.
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
SMatDMatMultExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the SMatDMatMultExpr class.
Definition: SMatDMatMultExpr.h:301
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
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.
SIMDTrait_t< ElementType > SIMDType
Resulting SIMD element type.
Definition: SMatDMatMultExpr.h:260
typename SIMDTrait< T >::Type SIMDTrait_t
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_t alias declaration provid...
Definition: SIMDTrait.h:315
RightOperand rightOperand() const noexcept
Returns the right-hand side dense matrix operand.
Definition: SMatDMatMultExpr.h:411
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:1002
Header file for the Computation base class.
Header file for the MatMatMultExpr base class.
Expression object for sparse matrix-dense matrix multiplications.The SMatDMatMultExpr class represent...
Definition: Forward.h:115
Header file for the reset shim.
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: SMatDMatMultExpr.h:292
If_t< IsExpression_v< MT2 >, const MT2, const MT2 &> RightOperand
Composite type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:268
Constraints on the storage order of matrix types.
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SMatDMatMultExpr.h:258
Header file for the RequiresEvaluation type trait.
System settings for performance optimizations.
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatDMatMultExpr.h:257
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
static constexpr bool UPP
Flag for upper matrices.
Definition: SMatDMatMultExpr.h:156
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:80
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:137
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: SMatDMatMultExpr.h:259
ElementType_t< RT1 > ET1
Element type of the left-hand side sparse matrix expression.
Definition: SMatDMatMultExpr.h:136
Constraint on the data type.
Constraint on the data type.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse matrix operand.
Definition: SMatDMatMultExpr.h:401
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatDMatMultExpr.h:423
Headerfile for the generic max algorithm.
Header file for the DisableIf class template.
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: SMatDMatMultExpr.h:255
Header file for the multiplication trait.
Header file for the IsStrictlyUpper 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:58
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:1147
CompositeType_t< MT2 > CT2
Composite type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:139
Header file for the decllow trait.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatDMatMultExpr.h:365
#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 HasSIMDAdd type trait.
Header file for the DenseMatrix base class.
Header file for all SIMD functionality.
decltype(auto) decllow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as lower.
Definition: DMatDeclLowExpr.h:1002
Header file for the IsLower type trait.
ResultType_t< MT2 > RT2
Result type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:135
Header file for the IsAligned type trait.
Generic wrapper for the null function.
Definition: Noop.h:59
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:1179
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
Header file for the DeclDiag functor.
Constraint on the data type.
Header file for all forward declarations for expression class templates.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatDMatMultExpr.h:316
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Header file for the IsPadded 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
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.The OppositeType_t alias declaration provi...
Definition: Aliases.h:270
static constexpr bool evaluateRight
Compilation switch for the composite type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:149
Header file for the conjugate shim.
Header file for the declupp trait.
ResultType_t< MT1 > RT1
Result type of the left-hand side sparse matrix expression.
Definition: SMatDMatMultExpr.h:134
Header file for the IsSIMDCombinable type trait.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatDMatMultExpr.h:391
#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
Header file for the HasSIMDMult type trait.
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.
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatDMatMultExpr.h:381
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
LeftOperand lhs_
Left-hand side sparse matrix of the multiplication expression.
Definition: SMatDMatMultExpr.h:462
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
const ResultType CompositeType
Data type for composite expression templates.
Definition: SMatDMatMultExpr.h:262
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.
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:295
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
decltype(auto) declsym(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as symmetric.
Definition: DMatDeclSymExpr.h:1002
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
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatDMatMultExpr.h:435
Constraints on the storage order of matrix types.
Generic wrapper for the declherm() function.
Definition: DeclHerm.h:58
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
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
static constexpr bool SYM
Flag for symmetric matrices.
Definition: SMatDMatMultExpr.h:153
Generic wrapper for the declupp() function.
Definition: DeclUpp.h:58
If_t< IsExpression_v< MT1 >, const MT1, const MT1 &> LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: SMatDMatMultExpr.h:265
If_t< evaluateRight, const RT2, CT2 > RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: SMatDMatMultExpr.h:274
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: SMatDMatMultExpr.h:445
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: SMatDMatMultExpr.h:286
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
Header file for the IsRowMajorMatrix type trait.
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
static constexpr bool evaluateLeft
Compilation switch for the composite type of the left-hand side sparse matrix expression.
Definition: SMatDMatMultExpr.h:144
static constexpr bool LOW
Flag for lower matrices.
Definition: SMatDMatMultExpr.h:155
CompositeType_t< MT1 > CT1
Composite type of the left-hand side sparse matrix expression.
Definition: SMatDMatMultExpr.h:138
Header file for the IntegralConstant class template.
Generic wrapper for the decldiag() function.
Definition: DeclDiag.h:58
If_t< evaluateLeft, const RT1, CT1 > LT
Type for the assignment of the left-hand side sparse matrix operand.
Definition: SMatDMatMultExpr.h:271
Header file for the DeclHerm functor.
const ElementType ReturnType
Return type for expression template evaluations.
Definition: SMatDMatMultExpr.h:261
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:631
Header file for the IsUpper type trait.
ElementType_t< RT2 > ET2
Element type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:137
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1326
Constraint on the data type.
Generic wrapper for the declsym() function.
Definition: DeclSym.h:58
Base template for the DeclDiagTrait class.
Definition: DeclDiagTrait.h:134
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, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the DeclSym functor.
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:61
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: SMatDMatMultExpr.h:279
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
RightOperand rhs_
Right-hand side dense matrix of the multiplication expression.
Definition: SMatDMatMultExpr.h:463