35 #ifndef _BLAZE_MATH_EXPRESSIONS_TSVECDMATMULTEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_TSVECDMATMULTEXPR_H_ 105 template<
typename VT
107 class TSVecDMatMultExpr
108 :
public TVecMatMultExpr< DenseVector< TSVecDMatMultExpr<VT,MT>, true > >
109 ,
private Computation
123 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 && T3::simdEnabled &&
153 IsSIMDCombinable_v< ElementType_t<T1>
167 template<
typename T1,
typename T2,
typename T3 >
168 static constexpr
bool UseOptimizedKernel_v =
169 ( useOptimizedKernels &&
170 !UseVectorizedKernel_v<T1,T2,T3> &&
172 !IsResizable_v< ElementType_t<T1> > &&
173 !IsResizable_v<VET> );
182 template<
typename T1,
typename T2,
typename T3 >
183 static constexpr
bool UseDefaultKernel_v =
184 ( !UseVectorizedKernel_v<T1,T2,T3> && !UseOptimizedKernel_v<T1,T2,T3> );
215 ( !IsDiagonal_v<MT> &&
217 HasSIMDAdd_v<VET,MET> &&
218 HasSIMDMult_v<VET,MET> );
253 if( IsDiagonal_v<MT> )
255 return vec_[index] *
mat_(index,index);
257 else if( IsLower_v<MT> )
259 const size_t begin( IsStrictlyLower_v<MT> ? index+1UL : index );
264 else if( IsUpper_v<MT> )
266 const size_t n( IsStrictlyUpper_v<MT> ? index : index+1UL );
285 if( index >=
mat_.columns() ) {
288 return (*
this)[index];
297 inline size_t size() const noexcept {
298 return mat_.columns();
328 template<
typename T >
329 inline bool canAlias(
const T* alias )
const noexcept {
330 return vec_.isAliased( alias ) ||
mat_.isAliased( alias );
340 template<
typename T >
341 inline bool isAliased(
const T* alias )
const noexcept {
342 return vec_.isAliased( alias ) ||
mat_.isAliased( alias );
352 return mat_.isAligned();
362 return (
size() > SMP_TSVECDMATMULT_THRESHOLD );
385 template<
typename VT2 >
394 if( x.nonZeros() == 0UL ) {
409 TSVecDMatMultExpr::selectAssignKernel( ~lhs, x, A );
428 template<
typename VT1
431 static inline auto selectAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
436 const size_t N( A.columns() );
438 auto element( x.begin() );
439 const auto end( x.end() );
443 if( IsUpper_v<MT1> ) {
444 const size_t jend( IsStrictlyUpper_v<MT1> ? element->index()+1UL : element->index() );
445 for(
size_t j=0UL; j<jend; ++j )
449 for( ; element!=
end; ++element )
451 const size_t index( element->index() );
453 if( IsDiagonal_v<MT1> )
455 for(
size_t j=last; j<index; ++j )
458 y[index] = element->value() * A(index,index);
463 const size_t jbegin( ( IsUpper_v<MT1> )
464 ?( IsStrictlyUpper_v<MT1> ? index+1UL : index )
466 const size_t jend( ( IsLower_v<MT1> )
467 ?( IsStrictlyLower_v<MT1> ? index : index+1UL )
471 for(
size_t j=jbegin; j<last; ++j ) {
472 y[j] += element->value() * A(index,j);
474 for(
size_t j=last; j<jend; ++j ) {
475 y[j] = element->value() * A(index,j);
482 if( IsLower_v<MT1> ) {
483 for(
size_t j=last; j<N; ++j )
504 template<
typename VT1
507 static inline auto selectAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
508 -> EnableIf_t< UseOptimizedKernel_v<VT1,VT2,MT1> >
512 const size_t N( A.columns() );
514 auto element( x.begin() );
515 const auto end( x.end() );
517 const size_t ipos( x.nonZeros() & size_t(-4) );
518 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == ipos,
"Invalid end calculation" );
522 const size_t i1( element->index() );
523 const VET v1( element->value() );
525 const size_t i2( element->index() );
526 const VET v2( element->value() );
528 const size_t i3( element->index() );
529 const VET v3( element->value() );
531 const size_t i4( element->index() );
532 const VET v4( element->value() );
537 for(
size_t j=0UL; j<N; ++j ) {
538 y[j] = v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
543 const size_t i1( element->index() );
544 const VET v1( element->value() );
547 for(
size_t j=0UL; j<N; ++j ) {
552 for(
size_t i=(ipos>3UL)?(4UL):(1UL); (i+4UL)<=ipos; i+=4UL )
554 const size_t i1( element->index() );
555 const VET v1( element->value() );
557 const size_t i2( element->index() );
558 const VET v2( element->value() );
560 const size_t i3( element->index() );
561 const VET v3( element->value() );
563 const size_t i4( element->index() );
564 const VET v4( element->value() );
569 const size_t jbegin( ( IsUpper_v<MT1> )
570 ?( IsStrictlyUpper_v<MT1> ? i1+1UL : i1 )
572 const size_t jend( ( IsLower_v<MT1> )
573 ?( IsStrictlyLower_v<MT1> ? i4 : i4+1UL )
577 for(
size_t j=jbegin; j<jend; ++j ) {
578 y[j] += v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
581 for( ; element!=
end; ++element )
583 const size_t i1( element->index() );
584 const VET v1( element->value() );
586 const size_t jbegin( ( IsUpper_v<MT1> )
587 ?( IsStrictlyUpper_v<MT1> ? i1+1UL : i1 )
589 const size_t jend( ( IsLower_v<MT1> )
590 ?( IsStrictlyLower_v<MT1> ? i1 : i1+1UL )
594 for(
size_t j=jbegin; j<jend; ++j ) {
595 y[j] += v1 * A(i1,j);
616 template<
typename VT1
619 static inline auto selectAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
620 -> EnableIf_t< UseVectorizedKernel_v<VT1,VT2,MT1> >
624 constexpr
bool remainder( !IsPadded_v<VT1> || !IsPadded_v<MT1> );
626 const size_t N( A.columns() );
628 auto element( x.begin() );
629 const auto end( x.end() );
631 const size_t ipos( x.nonZeros() & size_t(-4) );
632 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == ipos,
"Invalid end calculation" );
636 const size_t i1( element->index() );
637 const VET v1( element->value() );
639 const size_t i2( element->index() );
640 const VET v2( element->value() );
642 const size_t i3( element->index() );
643 const VET v3( element->value() );
645 const size_t i4( element->index() );
646 const VET v4( element->value() );
656 const size_t jpos( remainder ? ( N &
size_t(-
SIMDSIZE) ) : N );
662 y.store( j, xmm1 * A.load(i1,j) + xmm2 * A.load(i2,j) + xmm3 * A.load(i3,j) + xmm4 * A.load(i4,j) );
664 for( ; remainder && j<N; ++j ) {
665 y[j] = v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
670 const size_t i1( element->index() );
671 const VET v1( element->value() );
676 const size_t jpos( remainder ? ( N &
size_t(-
SIMDSIZE) ) : N );
682 y.store( j, xmm1 * A.load(i1,j) );
684 for( ; remainder && j<N; ++j ) {
689 for(
size_t i=(ipos>3UL)?(4UL):(1UL); (i+4UL)<=ipos; i+=4UL )
691 const size_t i1( element->index() );
692 const VET v1( element->value() );
694 const size_t i2( element->index() );
695 const VET v2( element->value() );
697 const size_t i3( element->index() );
698 const VET v3( element->value() );
700 const size_t i4( element->index() );
701 const VET v4( element->value() );
711 const size_t jbegin( ( IsUpper_v<MT1> )
712 ?( ( IsStrictlyUpper_v<MT1> ? i1+1UL : i1 ) &
size_t(-
SIMDSIZE) )
714 const size_t jend( ( IsLower_v<MT1> )
715 ?( IsStrictlyLower_v<MT1> ? i4 : i4+1UL )
719 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
725 y.store( j, y.load(j) + xmm1 * A.load(i1,j) + xmm2 * A.load(i2,j) + xmm3 * A.load(i3,j) + xmm4 * A.load(i4,j) );
727 for( ; remainder && j<jend; ++j ) {
728 y[j] += v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
731 for( ; element!=
end; ++element )
733 const size_t i1( element->index() );
734 const VET v1( element->value() );
738 const size_t jbegin( ( IsUpper_v<MT1> )
739 ?( ( IsStrictlyUpper_v<MT1> ? i1+1UL : i1 ) &
size_t(-
SIMDSIZE) )
741 const size_t jend( ( IsLower_v<MT1> )
742 ?( IsStrictlyLower_v<MT1> ? i1 : i1+1UL )
746 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
752 y.store( j, y.load(j) + xmm1 * A.load(i1,j) );
754 for( ; remainder && j<jend; ++j ) {
755 y[j] += v1 * A(i1,j);
775 template<
typename VT2 >
776 friend inline void assign( SparseVector<VT2,true>& lhs,
const TSVecDMatMultExpr& rhs )
804 template<
typename VT2 >
813 if( x.nonZeros() == 0UL )
return;
825 TSVecDMatMultExpr::selectAddAssignKernel( ~lhs, x, A );
843 template<
typename VT1
846 static inline auto selectAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
851 const size_t N( A.columns() );
853 auto element( x.begin() );
854 const auto end( x.end() );
856 for( ; element!=
end; ++element )
858 const size_t index( element->index() );
860 if( IsDiagonal_v<MT1> )
862 y[index] += A(index,index) * element->value();
866 const size_t jbegin( ( IsUpper_v<MT1> )
867 ?( IsStrictlyUpper_v<MT1> ? index+1UL : index )
869 const size_t jend( ( IsLower_v<MT1> )
870 ?( IsStrictlyLower_v<MT1> ? index : index+1UL )
874 for(
size_t j=jbegin; j<jend; ++j ) {
875 y[j] += element->value() * A(index,j);
897 template<
typename VT1
900 static inline auto selectAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
901 -> EnableIf_t< UseOptimizedKernel_v<VT1,VT2,MT1> >
905 const size_t N( A.columns() );
907 auto element( x.begin() );
908 const auto end( x.end() );
910 const size_t ipos( x.nonZeros() & size_t(-4) );
911 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == ipos,
"Invalid end calculation" );
913 for(
size_t i=0UL; (i+4UL)<=ipos; i+=4UL )
915 const size_t i1( element->index() );
916 const VET v1( element->value() );
918 const size_t i2( element->index() );
919 const VET v2( element->value() );
921 const size_t i3( element->index() );
922 const VET v3( element->value() );
924 const size_t i4( element->index() );
925 const VET v4( element->value() );
930 const size_t jbegin( ( IsUpper_v<MT1> )
931 ?( IsStrictlyUpper_v<MT1> ? i+1UL : i1 )
933 const size_t jend( ( IsLower_v<MT1> )
934 ?( IsStrictlyLower_v<MT1> ? i4 : i4+1UL )
938 for(
size_t j=jbegin; j<jend; ++j ) {
939 y[j] += v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
942 for( ; element!=
end; ++element )
944 const size_t i1( element->index() );
945 const VET v1( element->value() );
947 const size_t jbegin( ( IsUpper_v<MT1> )
948 ?( IsStrictlyUpper_v<MT1> ? i1+1UL : i1 )
950 const size_t jend( ( IsLower_v<MT1> )
951 ?( IsStrictlyLower_v<MT1> ? i1 : i1+1UL )
955 for(
size_t j=jbegin; j<jend; ++j ) {
956 y[j] += v1 * A(i1,j);
977 template<
typename VT1
980 static inline auto selectAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
981 -> EnableIf_t< UseVectorizedKernel_v<VT1,VT2,MT1> >
985 constexpr
bool remainder( !IsPadded_v<VT1> || !IsPadded_v<MT1> );
987 const size_t N( A.columns() );
989 auto element( x.begin() );
990 const auto end( x.end() );
992 const size_t ipos( x.nonZeros() & size_t(-4) );
993 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == ipos,
"Invalid end calculation" );
995 for(
size_t i=0UL; (i+4UL)<=ipos; i+=4UL )
997 const size_t i1( element->index() );
998 const VET v1( element->value() );
1000 const size_t i2( element->index() );
1001 const VET v2( element->value() );
1003 const size_t i3( element->index() );
1004 const VET v3( element->value() );
1006 const size_t i4( element->index() );
1007 const VET v4( element->value() );
1017 const size_t jbegin( ( IsUpper_v<MT1> )
1018 ?( ( IsStrictlyUpper_v<MT1> ? i1+1UL : i1 ) &
size_t(-
SIMDSIZE) )
1020 const size_t jend( ( IsLower_v<MT1> )
1021 ?( IsStrictlyLower_v<MT1> ? i4 : i4+1UL )
1025 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
1031 y.store( j, y.load(j) + xmm1 * A.load(i1,j) + xmm2 * A.load(i2,j) + xmm3 * A.load(i3,j) + xmm4 * A.load(i4,j) );
1033 for( ; remainder && j<jend; ++j ) {
1034 y[j] += v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
1037 for( ; element!=
end; ++element )
1039 const size_t i1( element->index() );
1040 const VET v1( element->value() );
1044 const size_t jbegin( ( IsUpper_v<MT1> )
1045 ?( ( IsStrictlyUpper_v<MT1> ? i1+1UL : i1 ) &
size_t(-
SIMDSIZE) )
1047 const size_t jend( ( IsLower_v<MT1> )
1048 ?( IsStrictlyLower_v<MT1> ? i1 : i1+1UL )
1052 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
1058 y.store( j, y.load(j) + xmm1 * A.load(i1,j) );
1060 for( ; remainder && j<jend; ++j ) {
1061 y[j] += v1 * A(i1,j);
1084 template<
typename VT2 >
1093 if( x.nonZeros() == 0UL )
return;
1105 TSVecDMatMultExpr::selectSubAssignKernel( ~lhs, x, A );
1123 template<
typename VT1
1126 static inline auto selectSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1131 const size_t N( A.columns() );
1133 auto element( x.begin() );
1134 const auto end( x.end() );
1136 for( ; element!=
end; ++element )
1138 const size_t index( element->index() );
1140 if( IsDiagonal_v<MT1> )
1142 y[index] -= A(index,index) * element->value();
1146 const size_t jbegin( ( IsUpper_v<MT1> )
1147 ?( IsStrictlyUpper_v<MT1> ? index+1UL : index )
1149 const size_t jend( ( IsLower_v<MT1> )
1150 ?( IsStrictlyLower_v<MT1> ? index : index+1UL )
1154 for(
size_t j=jbegin; j<jend; ++j ) {
1155 y[j] -= element->value() * A(index,j);
1177 template<
typename VT1
1180 static inline auto selectSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1181 -> EnableIf_t< UseOptimizedKernel_v<VT1,VT2,MT1> >
1185 const size_t N( A.columns() );
1187 auto element( x.begin() );
1188 const auto end( x.end() );
1190 const size_t ipos( x.nonZeros() & size_t(-4) );
1191 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == ipos,
"Invalid end calculation" );
1193 for(
size_t i=0UL; (i+4UL)<=ipos; i+=4UL )
1195 const size_t i1( element->index() );
1196 const VET v1( element->value() );
1198 const size_t i2( element->index() );
1199 const VET v2( element->value() );
1201 const size_t i3( element->index() );
1202 const VET v3( element->value() );
1204 const size_t i4( element->index() );
1205 const VET v4( element->value() );
1210 const size_t jbegin( ( IsUpper_v<MT1> )
1211 ?( IsStrictlyUpper_v<MT1> ? i+1UL : i1 )
1213 const size_t jend( ( IsLower_v<MT1> )
1214 ?( IsStrictlyLower_v<MT1> ? i4 : i4+1UL )
1218 for(
size_t j=jbegin; j<jend; ++j ) {
1219 y[j] -= v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
1222 for( ; element!=
end; ++element )
1224 const size_t i1( element->index() );
1225 const VET v1( element->value() );
1227 const size_t jbegin( ( IsUpper_v<MT1> )
1228 ?( IsStrictlyUpper_v<MT1> ? i1+1UL : i1 )
1230 const size_t jend( ( IsLower_v<MT1> )
1231 ?( IsStrictlyLower_v<MT1> ? i1 : i1+1UL )
1235 for(
size_t j=jbegin; j<jend; ++j ) {
1236 y[j] -= v1 * A(i1,j);
1257 template<
typename VT1
1260 static inline auto selectSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1261 -> EnableIf_t< UseVectorizedKernel_v<VT1,VT2,MT1> >
1265 constexpr
bool remainder( !IsPadded_v<VT1> || !IsPadded_v<MT1> );
1267 const size_t N( A.columns() );
1269 auto element( x.begin() );
1270 const auto end( x.end() );
1272 const size_t ipos( x.nonZeros() & size_t(-4) );
1273 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == ipos,
"Invalid end calculation" );
1275 for(
size_t i=0UL; (i+4UL)<=ipos; i+=4UL )
1277 const size_t i1( element->index() );
1278 const VET v1( element->value() );
1280 const size_t i2( element->index() );
1281 const VET v2( element->value() );
1283 const size_t i3( element->index() );
1284 const VET v3( element->value() );
1286 const size_t i4( element->index() );
1287 const VET v4( element->value() );
1297 const size_t jbegin( ( IsUpper_v<MT1> )
1298 ?( ( IsStrictlyUpper_v<MT1> ? i1+1UL : i1 ) &
size_t(-
SIMDSIZE) )
1300 const size_t jend( ( IsLower_v<MT1> )
1301 ?( IsStrictlyLower_v<MT1> ? i4 : i4+1UL )
1305 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
1311 y.store( j, y.load(j) - xmm1 * A.load(i1,j) - xmm2 * A.load(i2,j) - xmm3 * A.load(i3,j) - xmm4 * A.load(i4,j) );
1313 for( ; remainder && j<jend; ++j ) {
1314 y[j] -= v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
1317 for( ; element!=
end; ++element )
1319 const size_t i1( element->index() );
1320 const VET v1( element->value() );
1324 const size_t jbegin( ( IsUpper_v<MT1> )
1325 ?( ( IsStrictlyUpper_v<MT1> ? i1+1UL : i1 ) &
size_t(-
SIMDSIZE) )
1327 const size_t jend( ( IsLower_v<MT1> )
1328 ?( IsStrictlyLower_v<MT1> ? i1 : i1+1UL )
1332 const size_t jpos( remainder ? ( jend &
size_t(-
SIMDSIZE) ) : jend );
1338 y.store( j, y.load(j) - xmm1 * A.load(i1,j) );
1340 for( ; remainder && j<jend; ++j ) {
1341 y[j] -= v1 * A(i1,j);
1364 template<
typename VT2 >
1396 template<
typename VT2 >
1431 template<
typename VT2 >
1441 if( x.nonZeros() == 0UL ) {
1476 template<
typename VT2 >
1478 -> EnableIf_t< UseSMPAssign_v<VT2> >
1508 template<
typename VT2 >
1518 if( x.nonZeros() == 0UL )
return;
1552 template<
typename VT2 >
1562 if( x.nonZeros() == 0UL )
return;
1596 template<
typename VT2 >
1631 template<
typename VT2 >
1687 template<
typename VT
1689 , DisableIf_t< IsZero_v<VT> >* =
nullptr >
1690 inline const TSVecDMatMultExpr<VT,MT>
1691 tsvecdmatmult(
const SparseVector<VT,true>& vec,
const DenseMatrix<MT,false>& mat )
1697 return TSVecDMatMultExpr<VT,MT>( ~vec, ~mat );
1716 template<
typename VT
1718 , EnableIf_t< IsZero_v<VT> >* =
nullptr >
1719 inline decltype(
auto)
1720 tsvecdmatmult( const SparseVector<VT,true>& vec, const DenseMatrix<MT,false>& mat )
1728 using ReturnType =
const MultTrait_t< ResultType_t<VT>, ResultType_t<MT> >;
1733 return ReturnType( (~mat).
columns() );
1770 template<
typename VT
1772 inline decltype(
auto)
1779 if( (~vec).
size() != (~mat).
rows() ) {
1783 return tsvecdmatmult( ~vec, ~mat );
1810 template<
typename VT
1812 inline decltype(
auto)
1813 operator*( const SparseVector<VT,true>& vec, const MatMatMultExpr<MT>& mat )
1817 return ( vec * (~mat).leftOperand() ) * (~mat).rightOperand();
1833 template<
typename VT,
typename MT >
1834 struct IsAligned< TSVecDMatMultExpr<VT,MT> >
1835 :
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.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
Header file for the blaze::checked and blaze::unchecked instances.
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: TSVecDMatMultExpr.h:297
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: TSVecDMatMultExpr.h:341
friend void multAssign(DenseVector< VT2, true > &lhs, const TSVecDMatMultExpr &rhs)
Multiplication assignment of a transpose sparse vector-dense matrix multiplication to a dense vector ...
Definition: TSVecDMatMultExpr.h:1365
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TSVecDMatMultExpr.h:196
Header file for basic type definitions.
friend auto smpSubAssign(DenseVector< VT2, true > &lhs, const TSVecDMatMultExpr &rhs) -> EnableIf_t< UseSMPAssign_v< VT2 > >
SMP subtraction assignment of a transpose sparse vector-dense matrix multiplication to a dense vector...
Definition: TSVecDMatMultExpr.h:1553
Expression object for transpose sparse vector-dense matrix multiplications.The TSVecDMatMultExpr clas...
Definition: Forward.h:194
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
ElementType_t< MRT > MET
Element type of the right-hand side dense matrix expression.
Definition: TSVecDMatMultExpr.h:116
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.
SIMDTrait_t< ElementType > SIMDType
Resulting SIMD element type.
Definition: TSVecDMatMultExpr.h:195
Header file for the IsDiagonal type trait.
If_t< IsExpression_v< MT >, const MT, const MT & > RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TSVecDMatMultExpr.h:203
#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
friend auto smpAddAssign(DenseVector< VT2, true > &lhs, const TSVecDMatMultExpr &rhs) -> EnableIf_t< UseSMPAssign_v< VT2 > >
SMP addition assignment of a transpose sparse vector-dense matrix multiplication to a dense vector ( ...
Definition: TSVecDMatMultExpr.h:1509
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
LeftOperand vec_
Left-hand side sparse vector of the multiplication expression.
Definition: TSVecDMatMultExpr.h:368
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.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: TSVecDMatMultExpr.h:329
Header file for the Computation base class.
Header file for the MatMatMultExpr base class.
Header file for the reset shim.
Constraints on the storage order of matrix types.
Header file for the RequiresEvaluation type trait.
System settings for performance optimizations.
static constexpr bool evaluateMatrix
Compilation switch for the composite type of the right-hand side dense matrix expression.
Definition: TSVecDMatMultExpr.h:128
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
static constexpr bool evaluateVector
Compilation switch for the composite type of the left-hand side sparse vector expression.
Definition: TSVecDMatMultExpr.h:123
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
If_t< evaluateVector, const VRT, VCT > LT
Type for the assignment of the left-hand side sparse vector operand.
Definition: TSVecDMatMultExpr.h:206
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
RightOperand mat_
Right-hand side dense matrix of the multiplication expression.
Definition: TSVecDMatMultExpr.h:369
Header file for the DisableIf class template.
friend void addAssign(DenseVector< VT2, true > &lhs, const TSVecDMatMultExpr &rhs)
Addition assignment of a transpose sparse vector-dense matrix multiplication to a dense vector ( ).
Definition: TSVecDMatMultExpr.h:805
Header file for the multiplication trait.
RightOperand rightOperand() const noexcept
Returns the right-hand side dense matrix operand.
Definition: TSVecDMatMultExpr.h:317
Header file for the IsStrictlyUpper type trait.
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse vector operand.
Definition: TSVecDMatMultExpr.h:307
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
friend void divAssign(DenseVector< VT2, true > &lhs, const TSVecDMatMultExpr &rhs)
Division assignment of a transpose sparse vector-dense matrix multiplication to a dense vector ( ).
Definition: TSVecDMatMultExpr.h:1397
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: TSVecDMatMultExpr.h:193
#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
const ResultType CompositeType
Data type for composite expression templates.
Definition: TSVecDMatMultExpr.h:197
#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.
friend auto smpDivAssign(DenseVector< VT2, true > &lhs, const TSVecDMatMultExpr &rhs) -> EnableIf_t< UseSMPAssign_v< VT2 > >
SMP division assignment of a transpose sparse vector-dense matrix multiplication to a dense vector ( ...
Definition: TSVecDMatMultExpr.h:1632
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
If_t< evaluateMatrix, const MRT, MCT > RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: TSVecDMatMultExpr.h:209
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
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: TSVecDMatMultExpr.h:227
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
Constraint on the data type.
Constraint on the data type.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Header file for the IsPadded type trait.
ElementType_t< VRT > VET
Element type of the left-hand side sparse vector expression.
Definition: TSVecDMatMultExpr.h:115
ResultType_t< MT > MRT
Result type of the right-hand side dense matrix expression.
Definition: TSVecDMatMultExpr.h:114
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
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: TSVecDMatMultExpr.h:194
Header file for the IsSIMDCombinable type trait.
#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.
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: TSVecDMatMultExpr.h:351
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
If_t< IsExpression_v< VT >, const VT, const VT & > LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: TSVecDMatMultExpr.h:200
Header file for the IsZero type trait.
Constraint on the data type.
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.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: TSVecDMatMultExpr.h:250
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
Header file for the TVecMatMultExpr base class.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
TSVecDMatMultExpr(const VT &vec, const MT &mat) noexcept
Constructor for the TSVecDMatMultExpr class.
Definition: TSVecDMatMultExpr.h:236
#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
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: TSVecDMatMultExpr.h:361
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_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
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_TVECMATMULTEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid vector/matrix ...
Definition: TVecMatMultExpr.h:104
CompositeType_t< MT > MCT
Composite type of the right-hand side dense matrix expression.
Definition: TSVecDMatMultExpr.h:118
Header file for the IsComputation type trait class.
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: TSVecDMatMultExpr.h:221
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:146
ResultType_t< VT > VRT
Result type of the left-hand side sparse vector expression.
Definition: TSVecDMatMultExpr.h:113
#define BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a row dense or sparse vector type (i...
Definition: RowVector.h:61
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: TSVecDMatMultExpr.h:214
friend void subAssign(DenseVector< VT2, true > &lhs, const TSVecDMatMultExpr &rhs)
Subtraction assignment of a transpose sparse vector-dense matrix multiplication to a dense vector ( )...
Definition: TSVecDMatMultExpr.h:1085
Header file for the IsUpper type trait.
Constraint on the data type.
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: TSVecDMatMultExpr.h:284
MultTrait_t< VRT, MRT > ResultType
Result type for expression template evaluations.
Definition: TSVecDMatMultExpr.h:192
CompositeType_t< VT > VCT
Composite type of the left-hand side sparse vector expression.
Definition: TSVecDMatMultExpr.h:117
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
friend auto smpMultAssign(DenseVector< VT2, true > &lhs, const TSVecDMatMultExpr &rhs) -> EnableIf_t< UseSMPAssign_v< VT2 > >
SMP multiplication assignment of a transpose sparse vector-dense matrix multiplication to a dense vec...
Definition: TSVecDMatMultExpr.h:1597
Constraint on the transpose flag of vector types.
Header file for the IsExpression type trait class.
Header file for the function trace functionality.