35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATDMATMULTEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_SMATDMATMULTEXPR_H_ 123 template<
typename MT1
129 class SMatDMatMultExpr
130 :
public MatMatMultExpr< DenseMatrix< SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF>, false > >
131 ,
private Computation
145 static constexpr
bool evaluateLeft = ( IsComputation_v<MT1> || RequiresEvaluation_v<MT1> );
150 static constexpr
bool evaluateRight = ( IsComputation_v<MT2> || RequiresEvaluation_v<MT2> );
154 static constexpr
bool SYM = ( SF && !( HF || LF || UF ) );
155 static constexpr
bool HERM = ( HF && !( LF || UF ) );
156 static constexpr
bool LOW = ( LF || ( ( SF || HF ) && UF ) );
157 static constexpr
bool UPP = ( UF || ( ( SF || HF ) && LF ) );
166 template<
typename T1,
typename T2,
typename T3 >
176 template<
typename T1,
typename T2,
typename T3 >
177 static constexpr
bool UseVectorizedKernel_v =
178 ( useOptimizedKernels &&
180 T1::simdEnabled && T3::simdEnabled &&
181 IsRowMajorMatrix_v<T1> &&
182 IsSIMDCombinable_v< ElementType_t<T1>
196 template<
typename T1,
typename T2,
typename T3 >
197 static constexpr
bool UseOptimizedKernel_v =
198 ( useOptimizedKernels &&
199 !UseVectorizedKernel_v<T1,T2,T3> &&
201 !IsResizable_v< ElementType_t<T1> > &&
202 !IsResizable_v<ET1> );
211 template<
typename T1,
typename T2,
typename T3 >
212 static constexpr
bool UseDefaultKernel_v =
213 ( !UseVectorizedKernel_v<T1,T2,T3> &&
214 !UseOptimizedKernel_v<T1,T2,T3> );
281 ( !IsDiagonal_v<MT2> &&
283 HasSIMDAdd_v<ET1,ET2> &&
284 HasSIMDMult_v<ET1,ET2> );
321 if( IsDiagonal_v<MT1> ) {
324 else if( IsDiagonal_v<MT2> ) {
327 else if( IsTriangular_v<MT1> || IsTriangular_v<MT2> ) {
328 const size_t begin( ( IsUpper_v<MT1> )
329 ?( ( IsLower_v<MT2> )
330 ?(
max( ( IsStrictlyUpper_v<MT1> ? i+1UL : i )
331 , ( IsStrictlyLower_v<MT2> ? j+1UL : j ) ) )
332 :( IsStrictlyUpper_v<MT1> ? i+1UL : i ) )
333 :( ( IsLower_v<MT2> )
334 ?( IsStrictlyLower_v<MT2> ? j+1UL : j )
336 const size_t end( ( IsLower_v<MT1> )
337 ?( ( IsUpper_v<MT2> )
338 ?(
min( ( IsStrictlyLower_v<MT1> ? i : i+1UL )
339 , ( IsStrictlyUpper_v<MT2> ? j : j+1UL ) ) )
340 :( IsStrictlyLower_v<MT1> ? i : i+1UL ) )
341 :( ( IsUpper_v<MT2> )
342 ?( IsStrictlyUpper_v<MT2> ? j : j+1UL )
343 :(
lhs_.columns() ) ) );
367 if( i >=
lhs_.rows() ) {
370 if( j >=
rhs_.columns() ) {
382 inline size_t rows() const noexcept {
393 return rhs_.columns();
423 template<
typename T >
424 inline bool canAlias(
const T* alias )
const noexcept {
425 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
435 template<
typename T >
436 inline bool isAliased(
const T* alias )
const noexcept {
437 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
447 return rhs_.isAligned();
457 return (
rows() *
columns() >= SMP_SMATDMATMULT_THRESHOLD ) && !IsDiagonal_v<MT2>;
480 template<
typename MT
499 SMatDMatMultExpr::selectAssignKernel( ~lhs, A, B );
518 template<
typename MT3
521 static inline auto selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
524 const size_t block( IsRowMajorMatrix_v<MT3> || IsDiagonal_v<MT5> ? B.columns() : 64UL );
528 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
530 const size_t jtmp(
min( jj+block, B.columns() ) );
532 for(
size_t i=0UL; i<A.rows(); ++i )
534 auto element( A.begin(i) );
535 const auto end( A.end(i) );
537 for( ; element!=
end; ++element )
539 const size_t i1( element->index() );
541 if( IsDiagonal_v<MT5> )
543 C(i,i1) = element->value() * B(i1,i1);
547 const size_t jbegin( ( IsUpper_v<MT5> )
549 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
550 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
552 const size_t jend( ( IsLower_v<MT5> )
554 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) )
555 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) ) )
558 if( (
SYM ||
HERM ||
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
563 for(
size_t j=jbegin; j<jend; ++j ) {
565 C(i,j) = element->value() * B(i1,j);
567 C(i,j) += element->value() * B(i1,j);
575 for(
size_t i=0UL; i<A.rows(); ++i ) {
576 for(
size_t j=i+1UL; j<B.columns(); ++j ) {
577 C(i,j) =
HERM ?
conj( C(j,i) ) : C(j,i);
599 template<
typename MT3
602 static inline auto selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
603 -> EnableIf_t< UseOptimizedKernel_v<MT3,MT4,MT5> >
605 const size_t block( IsRowMajorMatrix_v<MT3> ? B.columns() : 64UL );
609 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
611 const size_t jtmp(
min( jj+block, B.columns() ) );
613 for(
size_t i=0UL; i<A.rows(); ++i )
615 const auto end( A.end(i) );
616 auto element( A.begin(i) );
618 const size_t nonzeros( A.nonZeros(i) );
619 const size_t kpos( nonzeros &
size_t(-4) );
622 for(
size_t k=0UL; k<kpos; k+=4UL )
624 const size_t i1( element->index() );
625 const ET1 v1( element->value() );
627 const size_t i2( element->index() );
628 const ET1 v2( element->value() );
630 const size_t i3( element->index() );
631 const ET1 v3( element->value() );
633 const size_t i4( element->index() );
634 const ET1 v4( element->value() );
639 const size_t jbegin( ( IsUpper_v<MT5> )
641 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
642 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
643 :(
UPP ?
max(i,jj) : jj ) );
644 const size_t jend( ( IsLower_v<MT5> )
646 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i4 : i4+1UL ) ) )
647 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i4 : i4+1UL ) ) ) )
650 if( (
SYM ||
HERM ||
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
655 const size_t jnum( jend - jbegin );
656 const size_t jpos( jbegin + ( jnum &
size_t(-4) ) );
659 for(
size_t j=jbegin; j<jpos; j+=4UL ) {
660 C(i,j ) += v1 * B(i1,j ) + v2 * B(i2,j ) + v3 * B(i3,j ) + v4 * B(i4,j );
661 C(i,j+1UL) += v1 * B(i1,j+1UL) + v2 * B(i2,j+1UL) + v3 * B(i3,j+1UL) + v4 * B(i4,j+1UL);
662 C(i,j+2UL) += v1 * B(i1,j+2UL) + v2 * B(i2,j+2UL) + v3 * B(i3,j+2UL) + v4 * B(i4,j+2UL);
663 C(i,j+3UL) += v1 * B(i1,j+3UL) + v2 * B(i2,j+3UL) + v3 * B(i3,j+3UL) + v4 * B(i4,j+3UL);
665 for(
size_t j=jpos; j<jend; ++j ) {
666 C(i,j) += v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
670 for( ; element!=
end; ++element )
672 const size_t i1( element->index() );
673 const ET1 v1( element->value() );
675 const size_t jbegin( ( IsUpper_v<MT5> )
677 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
678 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
679 :(
UPP ?
max(i,jj) : jj ) );
680 const size_t jend( ( IsLower_v<MT5> )
682 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) )
683 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) ) )
686 if( (
SYM ||
HERM ||
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
691 const size_t jnum( jend - jbegin );
692 const size_t jpos( jbegin + ( jnum &
size_t(-4) ) );
695 for(
size_t j=jbegin; j<jpos; j+=4UL ) {
696 C(i,j ) += v1 * B(i1,j );
697 C(i,j+1UL) += v1 * B(i1,j+1UL);
698 C(i,j+2UL) += v1 * B(i1,j+2UL);
699 C(i,j+3UL) += v1 * B(i1,j+3UL);
701 for(
size_t j=jpos; j<jend; ++j ) {
702 C(i,j) += v1 * B(i1,j);
709 for(
size_t i=0UL; i<A.rows(); ++i ) {
710 for(
size_t j=i+1UL; j<B.columns(); ++j ) {
711 C(i,j) =
HERM ?
conj( C(j,i) ) : C(j,i);
733 template<
typename MT3
736 static inline auto selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
737 -> EnableIf_t< UseVectorizedKernel_v<MT3,MT4,MT5> >
739 constexpr
bool remainder( !IsPadded_v<MT3> || !IsPadded_v<MT5> );
743 for(
size_t i=0UL; i<A.rows(); ++i )
745 const auto end( A.end(i) );
746 auto element( A.begin(i) );
748 const size_t nonzeros( A.nonZeros(i) );
749 const size_t kpos( nonzeros &
size_t(-4) );
752 for(
size_t k=0UL; k<kpos; k+=4UL )
754 const size_t i1( element->index() );
755 const ET1 v1( element->value() );
757 const size_t i2( element->index() );
758 const ET1 v2( element->value() );
760 const size_t i3( element->index() );
761 const ET1 v3( element->value() );
763 const size_t i4( element->index() );
764 const ET1 v4( element->value() );
774 const size_t jbegin( ( IsUpper_v<MT5> )
775 ?( ( IsStrictlyUpper_v<MT5> )
779 const size_t jend( ( IsLower_v<MT5> )
780 ?( ( IsStrictlyLower_v<MT5> )
783 :(
SYM ||
HERM ||
LOW ? i+1UL : B.columns() ) );
786 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
792 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) );
794 for( ; remainder && j<jend; ++j ) {
795 C(i,j) += v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
799 for( ; element!=
end; ++element )
801 const size_t i1( element->index() );
802 const ET1 v1( element->value() );
806 const size_t jbegin( ( IsUpper_v<MT5> )
807 ?( ( IsStrictlyUpper_v<MT5> )
811 const size_t jend( ( IsLower_v<MT5> )
812 ?( ( IsStrictlyLower_v<MT5> )
815 :(
SYM ||
HERM ||
LOW ? i+1UL : B.columns() ) );
818 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
824 C.store( i, j, C.load(i,j) + xmm1 * B.load(i1,j) );
826 for( ; remainder && j<jend; ++j ) {
827 C(i,j) += v1 * B(i1,j);
833 for(
size_t i=0UL; i<A.rows(); ++i ) {
834 for(
size_t j=i+1UL; j<B.columns(); ++j ) {
835 C(i,j) =
HERM ?
conj( C(j,i) ) : C(j,i);
856 template<
typename MT
858 friend inline void assign( SparseMatrix<MT,SO>& lhs,
const SMatDMatMultExpr& rhs )
862 using TmpType = If_t< SO, OppositeType, ResultType >;
874 const ForwardFunctor fwd;
876 const TmpType tmp(
serial( rhs ) );
877 assign( ~lhs, fwd( tmp ) );
895 template<
typename MT
897 friend inline void addAssign( DenseMatrix<MT,SO>& lhs,
const SMatDMatMultExpr& rhs )
914 SMatDMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
933 template<
typename MT3
936 static inline auto selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
937 -> EnableIf_t< UseDefaultKernel_v<MT3,MT4,MT5> >
939 const size_t block( IsRowMajorMatrix_v<MT3> || IsDiagonal_v<MT5> ? B.columns() : 64UL );
941 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
943 const size_t jtmp(
min( jj+block, B.columns() ) );
945 for(
size_t i=0UL; i<A.rows(); ++i )
947 const auto end( A.end(i) );
948 auto element( A.begin(i) );
950 for( ; element!=
end; ++element )
952 const size_t i1( element->index() );
954 if( IsDiagonal_v<MT5> )
956 C(i,i1) += element->value() * B(i1,i1);
960 const size_t jbegin( ( IsUpper_v<MT5> )
962 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
963 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
965 const size_t jend( ( IsLower_v<MT5> )
967 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) )
968 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) ) )
969 :(
LOW ?
min(i+1UL,jtmp) : jtmp ) );
971 if( (
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
976 const size_t jnum( jend - jbegin );
977 const size_t jpos( jbegin + ( jnum &
size_t(-4) ) );
980 for(
size_t j=jbegin; j<jpos; j+=4UL ) {
981 C(i,j ) += element->value() * B(i1,j );
982 C(i,j+1UL) += element->value() * B(i1,j+1UL);
983 C(i,j+2UL) += element->value() * B(i1,j+2UL);
984 C(i,j+3UL) += element->value() * B(i1,j+3UL);
986 for(
size_t j=jpos; j<jend; ++j ) {
987 C(i,j) += element->value() * B(i1,j);
1011 template<
typename MT3
1014 static inline auto selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1015 -> EnableIf_t< UseOptimizedKernel_v<MT3,MT4,MT5> >
1017 const size_t block( IsRowMajorMatrix_v<MT3> ? B.columns() : 64UL );
1019 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1021 const size_t jtmp(
min( jj+block, B.columns() ) );
1023 for(
size_t i=0UL; i<A.rows(); ++i )
1025 const auto end( A.end(i) );
1026 auto element( A.begin(i) );
1028 const size_t nonzeros( A.nonZeros(i) );
1029 const size_t kpos( nonzeros &
size_t(-4) );
1032 for(
size_t k=0UL; k<kpos; k+=4UL )
1034 const size_t i1( element->index() );
1035 const ET1 v1( element->value() );
1037 const size_t i2( element->index() );
1038 const ET1 v2( element->value() );
1040 const size_t i3( element->index() );
1041 const ET1 v3( element->value() );
1043 const size_t i4( element->index() );
1044 const ET1 v4( element->value() );
1049 const size_t jbegin( ( IsUpper_v<MT5> )
1051 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
1052 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
1053 :(
UPP ?
max(i,jj) : jj ) );
1054 const size_t jend( ( IsLower_v<MT5> )
1056 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i4 : i4+1UL ) ) )
1057 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i4 : i4+1UL ) ) ) )
1058 :(
LOW ?
min(i+1UL,jtmp) : jtmp ) );
1060 if( (
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
1065 const size_t jnum( jend - jbegin );
1066 const size_t jpos( jbegin + ( jnum &
size_t(-4) ) );
1069 for(
size_t j=jbegin; j<jpos; j+=4UL ) {
1070 C(i,j ) += v1 * B(i1,j ) + v2 * B(i2,j ) + v3 * B(i3,j ) + v4 * B(i4,j );
1071 C(i,j+1UL) += v1 * B(i1,j+1UL) + v2 * B(i2,j+1UL) + v3 * B(i3,j+1UL) + v4 * B(i4,j+1UL);
1072 C(i,j+2UL) += v1 * B(i1,j+2UL) + v2 * B(i2,j+2UL) + v3 * B(i3,j+2UL) + v4 * B(i4,j+2UL);
1073 C(i,j+3UL) += v1 * B(i1,j+3UL) + v2 * B(i2,j+3UL) + v3 * B(i3,j+3UL) + v4 * B(i4,j+3UL);
1075 for(
size_t j=jpos; j<jend; ++j ) {
1076 C(i,j) += v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
1080 for( ; element!=
end; ++element )
1082 const size_t i1( element->index() );
1083 const ET1 v1( element->value() );
1085 const size_t jbegin( ( IsUpper_v<MT5> )
1087 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
1088 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
1089 :(
UPP ?
max(i,jj) : jj ) );
1090 const size_t jend( ( IsLower_v<MT5> )
1092 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) )
1093 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) ) )
1094 :(
LOW ?
min(i+1UL,jtmp) : jtmp ) );
1096 if( (
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
1101 const size_t jnum( jend - jbegin );
1102 const size_t jpos( jbegin + ( jnum &
size_t(-4) ) );
1105 for(
size_t j=jbegin; j<jpos; j+=4UL ) {
1106 C(i,j ) += v1 * B(i1,j );
1107 C(i,j+1UL) += v1 * B(i1,j+1UL);
1108 C(i,j+2UL) += v1 * B(i1,j+2UL);
1109 C(i,j+3UL) += v1 * B(i1,j+3UL);
1111 for(
size_t j=jpos; j<jend; ++j ) {
1112 C(i,j) += v1 * B(i1,j);
1135 template<
typename MT3
1138 static inline auto selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1139 -> EnableIf_t< UseVectorizedKernel_v<MT3,MT4,MT5> >
1141 constexpr
bool remainder( !IsPadded_v<MT3> || !IsPadded_v<MT5> );
1143 for(
size_t i=0UL; i<A.rows(); ++i )
1145 const auto end( A.end(i) );
1146 auto element( A.begin(i) );
1148 const size_t nonzeros( A.nonZeros(i) );
1149 const size_t kpos( nonzeros &
size_t(-4) );
1152 for(
size_t k=0UL; k<kpos; k+=4UL )
1154 const size_t i1( element->index() );
1155 const ET1 v1( element->value() );
1157 const size_t i2( element->index() );
1158 const ET1 v2( element->value() );
1160 const size_t i3( element->index() );
1161 const ET1 v3( element->value() );
1163 const size_t i4( element->index() );
1164 const ET1 v4( element->value() );
1174 const size_t jbegin( ( IsUpper_v<MT5> )
1175 ?( ( IsStrictlyUpper_v<MT5> )
1179 const size_t jend( ( IsLower_v<MT5> )
1180 ?( ( IsStrictlyLower_v<MT5> )
1181 ?(
LOW ?
min(i+1UL,i4) : i4 )
1182 :(
LOW ?
min(i,i4)+1UL : i4+1UL ) )
1183 :(
LOW ? i+1UL : B.columns() ) );
1186 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
1192 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) );
1194 for( ; remainder && j<jend; ++j ) {
1195 C(i,j) += v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
1199 for( ; element!=
end; ++element )
1201 const size_t i1( element->index() );
1202 const ET1 v1( element->value() );
1206 const size_t jbegin( ( IsUpper_v<MT5> )
1207 ?( ( IsStrictlyUpper_v<MT5> )
1211 const size_t jend( ( IsLower_v<MT5> )
1212 ?( ( IsStrictlyLower_v<MT5> )
1213 ?(
LOW ?
min(i+1UL,i1) : i1 )
1214 :(
LOW ?
min(i,i1)+1UL : i1+1UL ) )
1215 :(
LOW ? i+1UL : B.columns() ) );
1218 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
1224 C.store( i, j, C.load(i,j) + xmm1 * B.load(i1,j) );
1226 for( ; remainder && j<jend; ++j ) {
1227 C(i,j) += v1 * B(i1,j);
1252 template<
typename MT
1254 friend inline void subAssign( DenseMatrix<MT,SO>& lhs,
const SMatDMatMultExpr& rhs )
1271 SMatDMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1290 template<
typename MT3
1293 static inline auto selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1294 -> EnableIf_t< UseDefaultKernel_v<MT3,MT4,MT5> >
1296 const size_t block( IsRowMajorMatrix_v<MT3> || IsDiagonal_v<MT5> ? B.columns() : 64UL );
1298 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1300 const size_t jtmp(
min( jj+block, B.columns() ) );
1302 for(
size_t i=0UL; i<A.rows(); ++i )
1304 const auto end( A.end(i) );
1305 auto element( A.begin(i) );
1307 for( ; element!=
end; ++element )
1309 const size_t i1( element->index() );
1311 if( IsDiagonal_v<MT5> )
1313 C(i,i1) -= element->value() * B(i1,i1);
1317 const size_t jbegin( ( IsUpper_v<MT5> )
1319 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
1320 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
1322 const size_t jend( ( IsLower_v<MT5> )
1324 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) )
1325 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) ) )
1326 :(
LOW ?
min(i+1UL,jtmp) : jtmp ) );
1328 if( (
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
1333 const size_t jnum( jend - jbegin );
1334 const size_t jpos( jbegin + ( jnum &
size_t(-4) ) );
1337 for(
size_t j=jbegin; j<jpos; j+=4UL ) {
1338 C(i,j ) -= element->value() * B(i1,j );
1339 C(i,j+1UL) -= element->value() * B(i1,j+1UL);
1340 C(i,j+2UL) -= element->value() * B(i1,j+2UL);
1341 C(i,j+3UL) -= element->value() * B(i1,j+3UL);
1343 for(
size_t j=jpos; j<jend; ++j ) {
1344 C(i,j) -= element->value() * B(i1,j);
1368 template<
typename MT3
1371 static inline auto selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1372 -> EnableIf_t< UseOptimizedKernel_v<MT3,MT4,MT5> >
1374 const size_t block( IsRowMajorMatrix_v<MT3> ? B.columns() : 64UL );
1376 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1378 const size_t jtmp(
min( jj+block, B.columns() ) );
1380 for(
size_t i=0UL; i<A.rows(); ++i )
1382 const auto end( A.end(i) );
1383 auto element( A.begin(i) );
1385 const size_t nonzeros( A.nonZeros(i) );
1386 const size_t kpos( nonzeros &
size_t(-4) );
1389 for(
size_t k=0UL; k<kpos; k+=4UL )
1391 const size_t i1( element->index() );
1392 const ET1 v1( element->value() );
1394 const size_t i2( element->index() );
1395 const ET1 v2( element->value() );
1397 const size_t i3( element->index() );
1398 const ET1 v3( element->value() );
1400 const size_t i4( element->index() );
1401 const ET1 v4( element->value() );
1406 const size_t jbegin( ( IsUpper_v<MT5> )
1408 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
1409 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
1410 :(
UPP ?
max(i,jj) : jj ) );
1411 const size_t jend( ( IsLower_v<MT5> )
1413 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i4 : i4+1UL ) ) )
1414 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i4 : i4+1UL ) ) ) )
1415 :(
LOW ?
min(i+1UL,jtmp) : jtmp ) );
1417 if( (
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
1422 const size_t jnum( jend - jbegin );
1423 const size_t jpos( jbegin + ( jnum &
size_t(-4) ) );
1426 for(
size_t j=jbegin; j<jpos; j+=4UL ) {
1427 C(i,j ) -= v1 * B(i1,j ) + v2 * B(i2,j ) + v3 * B(i3,j ) + v4 * B(i4,j );
1428 C(i,j+1UL) -= v1 * B(i1,j+1UL) + v2 * B(i2,j+1UL) + v3 * B(i3,j+1UL) + v4 * B(i4,j+1UL);
1429 C(i,j+2UL) -= v1 * B(i1,j+2UL) + v2 * B(i2,j+2UL) + v3 * B(i3,j+2UL) + v4 * B(i4,j+2UL);
1430 C(i,j+3UL) -= v1 * B(i1,j+3UL) + v2 * B(i2,j+3UL) + v3 * B(i3,j+3UL) + v4 * B(i4,j+3UL);
1432 for(
size_t j=jpos; j<jend; ++j ) {
1433 C(i,j) -= v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
1437 for( ; element!=
end; ++element )
1439 const size_t i1( element->index() );
1440 const ET1 v1( element->value() );
1442 const size_t jbegin( ( IsUpper_v<MT5> )
1444 ?(
max( i, jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) )
1445 :(
max( jj, ( IsStrictlyUpper_v<MT5> ? i1+1UL : i1 ) ) ) )
1446 :(
UPP ?
max(i,jj) : jj ) );
1447 const size_t jend( ( IsLower_v<MT5> )
1449 ?(
min( i+1UL, jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) )
1450 :(
min( jtmp, ( IsStrictlyLower_v<MT5> ? i1 : i1+1UL ) ) ) )
1451 :(
LOW ?
min(i+1UL,jtmp) : jtmp ) );
1453 if( (
LOW ||
UPP || IsTriangular_v<MT5> ) && ( jbegin >= jend ) )
1458 const size_t jnum( jend - jbegin );
1459 const size_t jpos( jbegin + ( jnum &
size_t(-4) ) );
1462 for(
size_t j=jbegin; j<jpos; j+=4UL ) {
1463 C(i,j ) -= v1 * B(i1,j );
1464 C(i,j+1UL) -= v1 * B(i1,j+1UL);
1465 C(i,j+2UL) -= v1 * B(i1,j+2UL);
1466 C(i,j+3UL) -= v1 * B(i1,j+3UL);
1468 for(
size_t j=jpos; j<jend; ++j ) {
1469 C(i,j) -= v1 * B(i1,j);
1492 template<
typename MT3
1495 static inline auto selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1496 -> EnableIf_t< UseVectorizedKernel_v<MT3,MT4,MT5> >
1498 constexpr
bool remainder( !IsPadded_v<MT3> || !IsPadded_v<MT5> );
1500 for(
size_t i=0UL; i<A.rows(); ++i )
1502 const auto end( A.end(i) );
1503 auto element( A.begin(i) );
1505 const size_t nonzeros( A.nonZeros(i) );
1506 const size_t kpos( nonzeros &
size_t(-4) );
1509 for(
size_t k=0UL; k<kpos; k+=4UL )
1511 const size_t i1( element->index() );
1512 const ET1 v1( element->value() );
1514 const size_t i2( element->index() );
1515 const ET1 v2( element->value() );
1517 const size_t i3( element->index() );
1518 const ET1 v3( element->value() );
1520 const size_t i4( element->index() );
1521 const ET1 v4( element->value() );
1531 const size_t jbegin( ( IsUpper_v<MT5> )
1532 ?( ( IsStrictlyUpper_v<MT5> )
1536 const size_t jend( ( IsLower_v<MT5> )
1537 ?( ( IsStrictlyLower_v<MT5> )
1538 ?(
LOW ?
min(i+1UL,i4) : i4 )
1539 :(
LOW ?
min(i,i4)+1UL : i4+1UL ) )
1540 :(
LOW ? i+1UL : B.columns() ) );
1543 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
1549 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) );
1551 for( ; remainder && j<jend; ++j ) {
1552 C(i,j) -= v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
1556 for( ; element!=
end; ++element )
1558 const size_t i1( element->index() );
1559 const ET1 v1( element->value() );
1563 const size_t jbegin( ( IsUpper_v<MT5> )
1564 ?( ( IsStrictlyUpper_v<MT5> )
1568 const size_t jend( ( IsLower_v<MT5> )
1569 ?( ( IsStrictlyLower_v<MT5> )
1570 ?(
LOW ?
min(i+1UL,i1) : i1 )
1571 :(
LOW ?
min(i,i1)+1UL : i1+1UL ) )
1572 :(
LOW ? i+1UL : B.columns() ) );
1575 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
1581 C.store( i, j, C.load(i,j) - xmm1 * B.load(i1,j) );
1583 for( ; remainder && j<jend; ++j ) {
1584 C(i,j) -= v1 * B(i1,j);
1609 template<
typename MT
1611 friend inline void schurAssign( DenseMatrix<MT,SO>& lhs,
const SMatDMatMultExpr& rhs )
1623 schurAssign( ~lhs, tmp );
1655 template<
typename MT
1658 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
1695 template<
typename MT
1698 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
1702 using TmpType = If_t< SO, OppositeType, ResultType >;
1714 const ForwardFunctor fwd;
1716 const TmpType tmp( rhs );
1738 template<
typename MT
1741 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
1783 template<
typename MT
1786 -> EnableIf_t< IsEvaluationRequired_v<MT,MT1,MT2> >
1825 template<
typename MT
1891 template<
typename MT1
1894 IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > ) ||
1895 IsZero_v<MT1> >* =
nullptr >
1896 inline const SMatDMatMultExpr<MT1,MT2,false,false,false,false>
1897 smatdmatmult(
const SparseMatrix<MT1,false>& lhs,
const DenseMatrix<MT2,false>& rhs )
1903 return SMatDMatMultExpr<MT1,MT2,false,false,false,false>( ~lhs, ~rhs );
1923 template<
typename MT1
1925 , EnableIf_t< IsIdentity_v<MT1> &&
1926 IsSame_v< ElementType_t<MT1>, ElementType_t<MT2> > >* =
nullptr >
1928 smatdmatmult(
const SparseMatrix<MT1,false>& lhs,
const DenseMatrix<MT2,false>& rhs )
1955 template<
typename MT1
1957 , EnableIf_t< IsZero_v<MT1> >* =
nullptr >
1958 inline decltype(
auto)
1959 smatdmatmult( const SparseMatrix<MT1,false>& lhs, const DenseMatrix<MT2,false>& rhs )
1965 using ReturnType =
const MultTrait_t< ResultType_t<MT1>, ResultType_t<MT2> >;
1970 return ReturnType( (~lhs).
rows(), (~rhs).
columns() );
2005 template<
typename MT1
2007 inline decltype(
auto)
2016 return smatdmatmult( ~lhs, ~rhs );
2053 template<
typename MT1
2059 inline decltype(
auto)
declsym( const SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
2067 using ReturnType =
const SMatDMatMultExpr<MT1,MT2,true,HF,LF,UF>;
2068 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2098 template<
typename MT1
2104 inline decltype(
auto)
declherm( const SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
2112 using ReturnType =
const SMatDMatMultExpr<MT1,MT2,SF,true,LF,UF>;
2113 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2143 template<
typename MT1
2149 inline decltype(
auto)
decllow( const SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
2157 using ReturnType =
const SMatDMatMultExpr<MT1,MT2,SF,HF,true,UF>;
2158 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2188 template<
typename MT1
2194 inline decltype(
auto)
declupp( const SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
2202 using ReturnType =
const SMatDMatMultExpr<MT1,MT2,SF,HF,LF,true>;
2203 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2233 template<
typename MT1
2239 inline decltype(
auto)
decldiag( const SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF>& dm )
2247 using ReturnType =
const SMatDMatMultExpr<MT1,MT2,SF,HF,true,true>;
2248 return ReturnType( dm.leftOperand(), dm.rightOperand() );
2264 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2265 struct Size< SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF>, 0UL >
2266 :
public Size<MT1,0UL>
2269 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2270 struct Size< SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF>, 1UL >
2271 :
public Size<MT2,1UL>
2287 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2288 struct IsAligned< SMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2289 :
public IsAligned<MT2>
#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:456
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 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.
static constexpr bool HERM
Flag for Hermitian matrices.
Definition: SMatDMatMultExpr.h:155
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:302
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.
SIMDTrait_t< ElementType > SIMDType
Resulting SIMD element type.
Definition: SMatDMatMultExpr.h:261
typename SIMDTrait< T >::Type SIMDTrait_t
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_t alias declaration provid...
Definition: SIMDTrait.h:315
decltype(auto) subvector(Vector< VT, TF > &, RSAs...)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:154
RightOperand rightOperand() const noexcept
Returns the right-hand side dense matrix operand.
Definition: SMatDMatMultExpr.h:412
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.
Expression object for sparse matrix-dense matrix multiplications.The SMatDMatMultExpr class represent...
Definition: Forward.h:121
Header file for the reset shim.
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: SMatDMatMultExpr.h:293
If_t< IsExpression_v< MT2 >, const MT2, const MT2 & > RightOperand
Composite type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:269
Constraints on the storage order of matrix types.
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SMatDMatMultExpr.h:259
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:258
static constexpr bool UPP
Flag for upper matrices.
Definition: SMatDMatMultExpr.h:157
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
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: SMatDMatMultExpr.h:260
ElementType_t< RT1 > ET1
Element type of the left-hand side sparse matrix expression.
Definition: SMatDMatMultExpr.h:137
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:402
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatDMatMultExpr.h:424
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:256
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: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
CompositeType_t< MT2 > CT2
Composite type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:140
Header file for the decllow trait.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatDMatMultExpr.h:366
#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:1001
Header file for the IsLower type trait.
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
ResultType_t< MT2 > RT2
Result type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:136
Header file for the IsAligned type trait.
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
Header file for the DeclDiag functor.
Constraint on the data type.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatDMatMultExpr.h:317
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:150
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:135
Header file for the IsSIMDCombinable type trait.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatDMatMultExpr.h:392
#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:382
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:463
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:263
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
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
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:75
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:436
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
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:154
Generic wrapper for the declupp() function.
Definition: DeclUpp.h:59
If_t< IsExpression_v< MT1 >, const MT1, const MT1 & > LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: SMatDMatMultExpr.h:266
If_t< evaluateRight, const RT2, CT2 > RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: SMatDMatMultExpr.h:275
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: SMatDMatMultExpr.h:446
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: SMatDMatMultExpr.h:287
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:145
static constexpr bool LOW
Flag for lower matrices.
Definition: SMatDMatMultExpr.h:156
CompositeType_t< MT1 > CT1
Composite type of the left-hand side sparse matrix expression.
Definition: SMatDMatMultExpr.h:139
Header file for the IntegralConstant class template.
Generic wrapper for the decldiag() function.
Definition: DeclDiag.h:59
If_t< evaluateLeft, const RT1, CT1 > LT
Type for the assignment of the left-hand side sparse matrix operand.
Definition: SMatDMatMultExpr.h:272
Header file for the DeclHerm functor.
const ElementType ReturnType
Return type for expression template evaluations.
Definition: SMatDMatMultExpr.h:262
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
ElementType_t< RT2 > ET2
Element type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:138
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
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.
#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:280
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:464