35 #ifndef _BLAZE_MATH_EXPRESSIONS_TDMATSVECMULTEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_TDMATSVECMULTEXPR_H_ 105 template<
typename MT
107 class TDMatSVecMultExpr
108 :
public MatVecMultExpr< DenseVector< TDMatSVecMultExpr<MT,VT>, false > >
109 ,
private Computation
128 static constexpr
bool evaluateVector = ( IsComputation_v<VT> || RequiresEvaluation_v<VT> );
137 template<
typename T1 >
148 template<
typename T1,
typename T2,
typename T3 >
149 static constexpr
bool UseVectorizedKernel_v =
150 ( useOptimizedKernels &&
152 T1::simdEnabled && T2::simdEnabled &&
153 IsSIMDCombinable_v< ElementType_t<T1>
167 template<
typename T1,
typename T2,
typename T3 >
168 static constexpr
bool UseOptimizedKernel_v =
169 ( !UseVectorizedKernel_v<T1,T2,T3> &&
171 !IsResizable_v< ElementType_t<T1> > &&
172 !IsResizable_v<VET> );
181 template<
typename T1,
typename T2,
typename T3 >
182 static constexpr
bool UseDefaultKernel_v =
183 ( !UseVectorizedKernel_v<T1,T2,T3> && !UseOptimizedKernel_v<T1,T2,T3> );
214 ( !IsDiagonal_v<MT> &&
216 HasSIMDAdd_v<MET,VET> &&
217 HasSIMDMult_v<MET,VET> );
252 if( IsDiagonal_v<MT> )
254 return mat_(index,index) *
vec_[index];
256 else if( IsLower_v<MT> )
258 const size_t n( IsStrictlyLower_v<MT> ? index : index+1UL );
262 else if( IsUpper_v<MT> )
264 const size_t begin( IsStrictlyUpper_v<MT> ? index+1UL : index );
265 const size_t n (
mat_.columns() -
begin );
284 if( index >=
mat_.rows() ) {
287 return (*
this)[index];
296 inline size_t size() const noexcept {
327 template<
typename T >
328 inline bool canAlias(
const T* alias )
const noexcept {
329 return mat_.isAliased( alias ) ||
vec_.isAliased( alias );
339 template<
typename T >
340 inline bool isAliased(
const T* alias )
const noexcept {
341 return mat_.isAliased( alias ) ||
vec_.isAliased( alias );
351 return mat_.isAligned();
361 return (
size() > SMP_TDMATSVECMULT_THRESHOLD );
384 template<
typename VT1 >
393 if( x.nonZeros() == 0UL ) {
408 TDMatSVecMultExpr::selectAssignKernel( ~lhs, A, x );
427 template<
typename VT1
430 static inline auto selectAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
435 const size_t M( A.rows() );
437 auto element( x.begin() );
438 const auto end( x.end() );
442 if( IsLower_v<MT1> ) {
443 const size_t iend( IsStrictlyLower_v<MT1> ? element->index()+1UL : element->index() );
444 for(
size_t i=0UL; i<iend; ++i )
448 for( ; element!=
end; ++element )
450 const size_t index( element->index() );
452 if( IsDiagonal_v<MT1> )
454 for(
size_t i=last; i<index; ++i )
457 y[index] = A(index,index) * element->value();
462 const size_t ibegin( ( IsLower_v<MT1> )
463 ?( IsStrictlyLower_v<MT1> ? index+1UL : index )
465 const size_t iend( ( IsUpper_v<MT1> )
466 ?( IsStrictlyUpper_v<MT1> ? index : index+1UL )
470 for(
size_t i=ibegin; i<last; ++i ) {
471 y[i] += A(i,index) * element->value();
473 for(
size_t i=last; i<iend; ++i ) {
474 y[i] = A(i,index) * element->value();
481 if( IsUpper_v<MT1> ) {
482 for(
size_t i=last; i<M; ++i )
503 template<
typename VT1
506 static inline auto selectAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
507 -> EnableIf_t< UseOptimizedKernel_v<VT1,MT1,VT2> >
511 const size_t M( A.rows() );
513 auto element( x.begin() );
514 const auto end( x.end() );
516 const size_t jpos( x.nonZeros() & size_t(-4) );
517 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == jpos,
"Invalid end calculation" );
521 const size_t j1( element->index() );
522 const VET v1( element->value() );
524 const size_t j2( element->index() );
525 const VET v2( element->value() );
527 const size_t j3( element->index() );
528 const VET v3( element->value() );
530 const size_t j4( element->index() );
531 const VET v4( element->value() );
536 for(
size_t i=0UL; i<M; ++i ) {
537 y[i] = A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
542 const size_t j1( element->index() );
543 const VET v1( element->value() );
546 for(
size_t i=0UL; i<M; ++i ) {
551 for(
size_t j=(jpos>3UL)?(4UL):(1UL); (j+4UL)<=jpos; j+=4UL )
553 const size_t j1( element->index() );
554 const VET v1( element->value() );
556 const size_t j2( element->index() );
557 const VET v2( element->value() );
559 const size_t j3( element->index() );
560 const VET v3( element->value() );
562 const size_t j4( element->index() );
563 const VET v4( element->value() );
568 const size_t ibegin( ( IsLower_v<MT1> )
569 ?( IsStrictlyLower_v<MT1> ? j1+1UL : j1 )
571 const size_t iend( ( IsUpper_v<MT1> )
572 ?( IsStrictlyUpper_v<MT1> ? j4 : j4+1UL )
576 for(
size_t i=ibegin; i<iend; ++i ) {
577 y[i] += A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
580 for( ; element!=
end; ++element )
582 const size_t j1( element->index() );
583 const VET v1( element->value() );
585 const size_t ibegin( ( IsLower_v<MT1> )
586 ?( IsStrictlyLower_v<MT1> ? j1+1UL : j1 )
588 const size_t iend( ( IsUpper_v<MT1> )
589 ?( IsStrictlyUpper_v<MT1> ? j1 : j1+1UL )
593 for(
size_t i=ibegin; i<iend; ++i ) {
594 y[i] += A(i,j1) * v1;
615 template<
typename VT1
618 static inline auto selectAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
619 -> EnableIf_t< UseVectorizedKernel_v<VT1,MT1,VT2> >
623 constexpr
bool remainder( !IsPadded_v<MT1> || !IsPadded_v<VT1> );
625 const size_t M( A.rows() );
627 auto element( x.begin() );
628 const auto end( x.end() );
630 const size_t jpos( x.nonZeros() & size_t(-4) );
631 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == jpos,
"Invalid end calculation" );
635 const size_t j1( element->index() );
636 const VET v1( element->value() );
638 const size_t j2( element->index() );
639 const VET v2( element->value() );
641 const size_t j3( element->index() );
642 const VET v3( element->value() );
644 const size_t j4( element->index() );
645 const VET v4( element->value() );
655 const size_t ipos( remainder ? ( M &
size_t(-
SIMDSIZE) ) : M );
661 y.store( i, A.load(i,j1) * xmm1 + A.load(i,j2) * xmm2 + A.load(i,j3) * xmm3 + A.load(i,j4) * xmm4 );
663 for( ; remainder && i<M; ++i ) {
664 y[i] = A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
669 const size_t j1( element->index() );
670 const VET v1( element->value() );
675 const size_t ipos( remainder ? ( M &
size_t(-
SIMDSIZE) ) : M );
681 y.store( i, A.load(i,j1) * xmm1 );
683 for( ; remainder && i<M; ++i ) {
688 for(
size_t j=(jpos>3UL)?(4UL):(1UL); (j+4UL)<=jpos; j+=4UL )
690 const size_t j1( element->index() );
691 const VET v1( element->value() );
693 const size_t j2( element->index() );
694 const VET v2( element->value() );
696 const size_t j3( element->index() );
697 const VET v3( element->value() );
699 const size_t j4( element->index() );
700 const VET v4( element->value() );
710 const size_t ibegin( ( IsLower_v<MT1> )
711 ?( ( IsStrictlyLower_v<MT1> ? j1+1UL : j1 ) &
size_t(-
SIMDSIZE) )
713 const size_t iend( ( IsUpper_v<MT1> )
714 ?( IsStrictlyUpper_v<MT1> ? j4 : j4+1UL )
718 const size_t ipos( remainder ? ( iend &
size_t(-
SIMDSIZE) ) : iend );
724 y.store( i, y.load(i) + A.load(i,j1) * xmm1 + A.load(i,j2) * xmm2 + A.load(i,j3) * xmm3 + A.load(i,j4) * xmm4 );
726 for( ; remainder && i<iend; ++i ) {
727 y[i] += A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
731 for( ; element!=
end; ++element )
733 const size_t j1( element->index() );
734 const VET v1( element->value() );
738 const size_t ibegin( ( IsLower_v<MT1> )
739 ?( ( IsStrictlyLower_v<MT1> ? j1+1UL : j1 ) &
size_t(-
SIMDSIZE) )
741 const size_t iend( ( IsUpper_v<MT1> )
742 ?( IsStrictlyUpper_v<MT1> ? j1 : j1+1UL )
746 const size_t ipos( remainder ? ( iend &
size_t(-
SIMDSIZE) ) : iend );
752 y.store( i, y.load(i) + A.load(i,j1) * xmm1 );
754 for( ; remainder && i<iend; ++i ) {
755 y[i] += A(i,j1) * v1;
775 template<
typename VT1 >
776 friend inline void assign( SparseVector<VT1,false>& lhs,
const TDMatSVecMultExpr& rhs )
805 template<
typename VT1 >
806 friend inline void addAssign( DenseVector<VT1,false>& lhs,
const TDMatSVecMultExpr& rhs )
814 if( x.nonZeros() == 0UL )
return;
826 TDMatSVecMultExpr::selectAddAssignKernel( ~lhs, A, x );
845 template<
typename VT1
848 static inline auto selectAddAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
849 -> EnableIf_t< UseDefaultKernel_v<VT1,MT1,VT2> >
853 const size_t M( A.rows() );
855 auto element( x.begin() );
856 const auto end( x.end() );
858 for( ; element!=
end; ++element )
860 const size_t index( element->index() );
862 if( IsDiagonal_v<MT1> )
864 y[index] += A(index,index) * element->value();
868 const size_t ibegin( ( IsLower_v<MT1> )
869 ?( IsStrictlyLower_v<MT1> ? index+1UL : index )
871 const size_t iend( ( IsUpper_v<MT1> )
872 ?( IsStrictlyUpper_v<MT1> ? index : index+1UL )
876 for(
size_t i=ibegin; i<iend; ++i ) {
877 y[i] += A(i,index) * element->value();
899 template<
typename VT1
902 static inline auto selectAddAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
903 -> EnableIf_t< UseOptimizedKernel_v<VT1,MT1,VT2> >
907 const size_t M( A.rows() );
909 auto element( x.begin() );
910 const auto end( x.end() );
912 const size_t jpos( x.nonZeros() & size_t(-4) );
913 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == jpos,
"Invalid end calculation" );
915 for(
size_t j=0UL; (j+4UL)<=jpos; j+=4UL )
917 const size_t j1( element->index() );
918 const VET v1( element->value() );
920 const size_t j2( element->index() );
921 const VET v2( element->value() );
923 const size_t j3( element->index() );
924 const VET v3( element->value() );
926 const size_t j4( element->index() );
927 const VET v4( element->value() );
932 const size_t ibegin( ( IsLower_v<MT1> )
933 ?( IsStrictlyLower_v<MT1> ? j1+1UL : j1 )
935 const size_t iend( ( IsUpper_v<MT1> )
936 ?( IsStrictlyUpper_v<MT1> ? j4 : j4+1UL )
940 for(
size_t i=ibegin; i<iend; ++i ) {
941 y[i] += A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
944 for( ; element!=
end; ++element )
946 const size_t j1( element->index() );
947 const VET v1( element->value() );
949 const size_t ibegin( ( IsLower_v<MT1> )
950 ?( IsStrictlyLower_v<MT1> ? j1+1UL : j1 )
952 const size_t iend( ( IsUpper_v<MT1> )
953 ?( IsStrictlyUpper_v<MT1> ? j1 : j1+1UL )
957 for(
size_t i=ibegin; i<iend; ++i ) {
958 y[i] += A(i,j1) * v1;
979 template<
typename VT1
982 static inline auto selectAddAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
983 -> EnableIf_t< UseVectorizedKernel_v<VT1,MT1,VT2> >
987 constexpr
bool remainder( !IsPadded_v<MT1> || !IsPadded_v<VT1> );
989 const size_t M( A.rows() );
991 auto element( x.begin() );
992 const auto end( x.end() );
994 const size_t jpos( x.nonZeros() & size_t(-4) );
995 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == jpos,
"Invalid end calculation" );
997 for(
size_t j=0UL; (j+4UL)<=jpos; j+=4UL )
999 const size_t j1( element->index() );
1000 const VET v1( element->value() );
1002 const size_t j2( element->index() );
1003 const VET v2( element->value() );
1005 const size_t j3( element->index() );
1006 const VET v3( element->value() );
1008 const size_t j4( element->index() );
1009 const VET v4( element->value() );
1019 const size_t ibegin( ( IsLower_v<MT1> )
1020 ?( ( IsStrictlyLower_v<MT1> ? j1+1UL : j1 ) &
size_t(-
SIMDSIZE) )
1022 const size_t iend( ( IsUpper_v<MT1> )
1023 ?( IsStrictlyUpper_v<MT1> ? j4 : j4+1UL )
1027 const size_t ipos( remainder ? ( iend &
size_t(-
SIMDSIZE) ) : iend );
1033 y.store( i, y.load(i) + A.load(i,j1) * xmm1 + A.load(i,j2) * xmm2 + A.load(i,j3) * xmm3 + A.load(i,j4) * xmm4 );
1035 for( ; remainder && i<iend; ++i ) {
1036 y[i] += A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
1039 for( ; element!=
end; ++element )
1041 const size_t j1( element->index() );
1042 const VET v1( element->value() );
1046 const size_t ibegin( ( IsLower_v<MT1> )
1047 ?( ( IsStrictlyLower_v<MT1> ? j1+1UL : j1 ) &
size_t(-
SIMDSIZE) )
1049 const size_t iend( ( IsUpper_v<MT1> )
1050 ?( IsStrictlyUpper_v<MT1> ? j1 : j1+1UL )
1054 const size_t ipos( remainder ? ( iend &
size_t(-
SIMDSIZE) ) : iend );
1060 y.store( i, y.load(i) + A.load(i,j1) * xmm1 );
1062 for( ; remainder && i<iend; ++i ) {
1063 y[i] += A(i,j1) * v1;
1087 template<
typename VT1 >
1088 friend inline void subAssign( DenseVector<VT1,false>& lhs,
const TDMatSVecMultExpr& rhs )
1096 if( x.nonZeros() == 0UL )
return;
1108 TDMatSVecMultExpr::selectSubAssignKernel( ~lhs, A, x );
1127 template<
typename VT1
1130 static inline auto selectSubAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
1131 -> EnableIf_t< UseDefaultKernel_v<VT1,MT1,VT2> >
1135 const size_t M( A.rows() );
1137 auto element( x.begin() );
1138 const auto end( x.end() );
1140 for( ; element!=
end; ++element )
1142 const size_t index( element->index() );
1144 if( IsDiagonal_v<MT1> )
1146 y[index] -= A(index,index) * element->value();
1150 const size_t ibegin( ( IsLower_v<MT1> )
1151 ?( IsStrictlyLower_v<MT1> ? index+1UL : index )
1153 const size_t iend( ( IsUpper_v<MT1> )
1154 ?( IsStrictlyUpper_v<MT1> ? index : index+1UL )
1158 for(
size_t i=ibegin; i<iend; ++i ) {
1159 y[i] -= A(i,index) * element->value();
1181 template<
typename VT1
1184 static inline auto selectSubAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
1185 -> EnableIf_t< UseOptimizedKernel_v<VT1,MT1,VT2> >
1189 const size_t M( A.rows() );
1191 auto element( x.begin() );
1192 const auto end( x.end() );
1194 const size_t jpos( x.nonZeros() & size_t(-4) );
1195 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == jpos,
"Invalid end calculation" );
1197 for(
size_t j=0UL; (j+4UL)<=jpos; j+=4UL )
1199 const size_t j1( element->index() );
1200 const VET v1( element->value() );
1202 const size_t j2( element->index() );
1203 const VET v2( element->value() );
1205 const size_t j3( element->index() );
1206 const VET v3( element->value() );
1208 const size_t j4( element->index() );
1209 const VET v4( element->value() );
1214 const size_t ibegin( ( IsLower_v<MT1> )
1215 ?( IsStrictlyLower_v<MT1> ? j1+1UL : j1 )
1217 const size_t iend( ( IsUpper_v<MT1> )
1218 ?( IsStrictlyUpper_v<MT1> ? j4 : j4+1UL )
1222 for(
size_t i=ibegin; i<iend; ++i ) {
1223 y[i] -= A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
1226 for( ; element!=
end; ++element )
1228 const size_t j1( element->index() );
1229 const VET v1( element->value() );
1231 const size_t ibegin( ( IsLower_v<MT1> )
1232 ?( IsStrictlyLower_v<MT1> ? j1+1UL : j1 )
1234 const size_t iend( ( IsUpper_v<MT1> )
1235 ?( IsStrictlyUpper_v<MT1> ? j1 : j1+1UL )
1239 for(
size_t i=ibegin; i<iend; ++i ) {
1240 y[i] -= A(i,j1) * v1;
1261 template<
typename VT1
1264 static inline auto selectSubAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
1265 -> EnableIf_t< UseVectorizedKernel_v<VT1,MT1,VT2> >
1269 constexpr
bool remainder( !IsPadded_v<MT1> || !IsPadded_v<VT1> );
1271 const size_t M( A.rows() );
1273 auto element( x.begin() );
1274 const auto end( x.end() );
1276 const size_t jpos( x.nonZeros() & size_t(-4) );
1277 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == jpos,
"Invalid end calculation" );
1279 for(
size_t j=0UL; (j+4UL)<=jpos; j+=4UL )
1281 const size_t j1( element->index() );
1282 const VET v1( element->value() );
1284 const size_t j2( element->index() );
1285 const VET v2( element->value() );
1287 const size_t j3( element->index() );
1288 const VET v3( element->value() );
1290 const size_t j4( element->index() );
1291 const VET v4( element->value() );
1301 const size_t ibegin( ( IsLower_v<MT1> )
1302 ?( ( IsStrictlyLower_v<MT1> ? j1+1UL : j1 ) &
size_t(-
SIMDSIZE) )
1304 const size_t iend( ( IsUpper_v<MT1> )
1305 ?( IsStrictlyUpper_v<MT1> ? j4 : j4+1UL )
1309 const size_t ipos( remainder ? ( iend &
size_t(-
SIMDSIZE) ) : iend );
1315 y.store( i, y.load(i) - A.load(i,j1) * xmm1 - A.load(i,j2) * xmm2 - A.load(i,j3) * xmm3 - A.load(i,j4) * xmm4 );
1317 for( ; remainder && i<iend; ++i ) {
1318 y[i] -= A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
1321 for( ; element!=
end; ++element )
1323 const size_t j1( element->index() );
1324 const VET v1( element->value() );
1328 const size_t ibegin( ( IsLower_v<MT1> )
1329 ?( ( IsStrictlyLower_v<MT1> ? j1+1UL : j1 ) &
size_t(-
SIMDSIZE) )
1331 const size_t iend( ( IsUpper_v<MT1> )
1332 ?( IsStrictlyUpper_v<MT1> ? j1 : j1+1UL )
1336 const size_t ipos( remainder ? ( iend &
size_t(-
SIMDSIZE) ) : iend );
1342 y.store( i, y.load(i) - A.load(i,j1) * xmm1 );
1344 for( ; remainder && i<iend; ++i ) {
1345 y[i] -= A(i,j1) * v1;
1369 template<
typename VT1 >
1370 friend inline void multAssign( DenseVector<VT1,false>& lhs,
const TDMatSVecMultExpr& rhs )
1381 multAssign( ~lhs, tmp );
1403 template<
typename VT1 >
1404 friend inline void divAssign( DenseVector<VT1,false>& lhs,
const TDMatSVecMultExpr& rhs )
1415 divAssign( ~lhs, tmp );
1439 template<
typename VT1 >
1441 -> EnableIf_t< UseSMPAssign_v<VT1> >
1449 if( x.nonZeros() == 0UL ) {
1484 template<
typename VT1 >
1486 -> EnableIf_t< UseSMPAssign_v<VT1> >
1517 template<
typename VT1 >
1519 -> EnableIf_t< UseSMPAssign_v<VT1> >
1527 if( x.nonZeros() == 0UL )
return;
1563 template<
typename VT1 >
1565 -> EnableIf_t< UseSMPAssign_v<VT1> >
1573 if( x.nonZeros() == 0UL )
return;
1609 template<
typename VT1 >
1611 -> EnableIf_t< UseSMPAssign_v<VT1> >
1646 template<
typename VT1 >
1648 -> EnableIf_t< UseSMPAssign_v<VT1> >
1703 template<
typename MT
1705 , DisableIf_t< IsZero_v<VT> >* =
nullptr >
1706 inline const TDMatSVecMultExpr<MT,VT>
1707 tdmatsvecmult(
const DenseMatrix<MT,true>& mat,
const SparseVector<VT,false>& vec )
1713 return TDMatSVecMultExpr<MT,VT>( ~mat, ~vec );
1732 template<
typename MT
1734 , EnableIf_t< IsZero_v<VT> >* =
nullptr >
1735 inline decltype(
auto)
1736 tdmatsvecmult( const DenseMatrix<MT,true>& mat, const SparseVector<VT,false>& vec )
1744 using ReturnType =
const MultTrait_t< ResultType_t<MT>, ResultType_t<VT> >;
1749 return ReturnType( (~mat).
rows() );
1787 template<
typename MT
1789 inline decltype(
auto)
1800 return tdmatsvecmult( ~mat, ~vec );
1815 template<
typename MT,
typename VT >
1816 struct IsAligned< TDMatSVecMultExpr<MT,VT> >
1817 :
public IsAligned<MT>
#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.
Header file for the blaze::checked and blaze::unchecked instances.
RightOperand vec_
Right-hand side sparse vector of the multiplication expression.
Definition: TDMatSVecMultExpr.h:368
SIMDTrait_t< ElementType > SIMDType
Resulting SIMD element type.
Definition: TDMatSVecMultExpr.h:194
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
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: TDMatSVecMultExpr.h:350
ElementType_t< MRT > MET
Element type of the left-hand side dense matrix expression.
Definition: TDMatSVecMultExpr.h:115
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a column dense or sparse vector type...
Definition: ColumnVector.h:61
Header file for the serial shim.
Header file for the IsDiagonal type trait.
const ResultType CompositeType
Data type for composite expression templates.
Definition: TDMatSVecMultExpr.h:196
#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
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.
typename SIMDTrait< T >::Type SIMDTrait_t
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_t alias declaration provid...
Definition: SIMDTrait.h:315
Header file for the DenseVector base class.
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 Computation base class.
Header file for the reset shim.
Header file for the RequiresEvaluation type trait.
System settings for performance optimizations.
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: TDMatSVecMultExpr.h:220
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
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
auto smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:220
Constraint on the transpose flag of vector types.
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: TDMatSVecMultExpr.h:283
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
Header file for the DisableIf class template.
CompositeType_t< VT > VCT
Composite type of the right-hand side sparse vector expression.
Definition: TDMatSVecMultExpr.h:118
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 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
ElementType_t< VRT > VET
Element type of the right-hand side sparse vector expression.
Definition: TDMatSVecMultExpr.h:116
ResultType_t< VT > VRT
Result type of the right-hand side sparse vector expression.
Definition: TDMatSVecMultExpr.h:114
If_t< evaluateVector, const VRT, CompositeType_t< VT > > RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: TDMatSVecMultExpr.h:208
#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
LeftOperand mat_
Left-hand side dense matrix of the multiplication expression.
Definition: TDMatSVecMultExpr.h:367
#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.
static constexpr bool evaluateMatrix
Compilation switch for the composite type of the left-hand side dense matrix expression.
Definition: TDMatSVecMultExpr.h:123
MultTrait_t< MRT, VRT > ResultType
Result type for expression template evaluations.
Definition: TDMatSVecMultExpr.h:191
If_t< IsExpression_v< MT >, const MT, const MT & > LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: TDMatSVecMultExpr.h:199
Header file for all SIMD functionality.
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
Header file for the IsLower type trait.
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional vector type,...
Definition: SparseVector.h:61
Header file for the IsAligned type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_MATMATMULTEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a matrix/matrix multiplication expressio...
Definition: MatMatMultExpr.h:83
LeftOperand leftOperand() const noexcept
Returns the left-hand side transpose dense matrix operand.
Definition: TDMatSVecMultExpr.h:306
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATVECMULTEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid matrix/vector ...
Definition: MatVecMultExpr.h:104
Constraint on the data type.
Header file for the exception macros of the math module.
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
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: TDMatSVecMultExpr.h:249
Constraint on the data type.
Constraint on the data type.
ResultType_t< MT > MRT
Result type of the left-hand side dense matrix expression.
Definition: TDMatSVecMultExpr.h:113
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Header file for the IsPadded type trait.
typename MultTrait< T1, T2 >::Type MultTrait_t
Auxiliary alias declaration for the MultTrait class template.The MultTrait_t alias declaration provid...
Definition: MultTrait.h:240
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse vector operand.
Definition: TDMatSVecMultExpr.h:316
Expression object for transpose dense matrix-sparse vector multiplications.The TDMatSVecMultExpr clas...
Definition: Forward.h:172
CompositeType_t< MT > MCT
Composite type of the left-hand side dense matrix expression.
Definition: TDMatSVecMultExpr.h:117
Header file for the IsSIMDCombinable type trait.
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.
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.The CompositeType_t alias declaration pro...
Definition: Aliases.h:90
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: TDMatSVecMultExpr.h:296
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
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: TDMatSVecMultExpr.h:328
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
#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.
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
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
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
Constraints on the storage order of matrix types.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
TDMatSVecMultExpr(const MT &mat, const VT &vec) noexcept
Constructor for the TDMatSVecMultExpr class.
Definition: TDMatSVecMultExpr.h:235
#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
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: TDMatSVecMultExpr.h:192
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type,...
Definition: DenseVector.h:61
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: TDMatSVecMultExpr.h:213
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: TDMatSVecMultExpr.h:340
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: TDMatSVecMultExpr.h:360
Header file for the IsComputation type trait class.
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
If_t< IsExpression_v< VT >, const VT, const VT & > RightOperand
Composite type of the right-hand side dense vector expression.
Definition: TDMatSVecMultExpr.h:202
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TDMatSVecMultExpr.h:195
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: TDMatSVecMultExpr.h:193
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:146
static constexpr bool evaluateVector
Compilation switch for the composite type of the right-hand side dense vector expression.
Definition: TDMatSVecMultExpr.h:128
Constraint on the data type.
Header file for the IsUpper type trait.
If_t< evaluateMatrix, const MRT, MCT > LT
Type for the assignment of the left-hand side dense matrix operand.
Definition: TDMatSVecMultExpr.h:205
Header file for the MatVecMultExpr base class.
Constraint on the data type.
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: TDMatSVecMultExpr.h:226
Header file for the IsResizable 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
auto smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP multiplication assignment of a vector to a dense vector.
Definition: DenseVector.h:191
Header file for the IsExpression type trait class.
Header file for the function trace functionality.