35 #ifndef _BLAZE_MATH_EXPRESSIONS_TSVECDMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TSVECDMATMULTEXPR_H_
108 template<
typename VT
110 class TSVecDMatMultExpr :
public DenseVector< TSVecDMatMultExpr<VT,MT>, true >
111 ,
private TVecMatMultExpr
112 ,
private Computation
140 template<
typename T1 >
141 struct UseSMPAssign {
142 enum :
bool { value = ( evaluateVector || evaluateMatrix ) };
153 template<
typename T1,
typename T2,
typename T3 >
154 struct UseVectorizedKernel {
156 !IsDiagonal<T3>::value &&
157 T1::simdEnabled && T3::simdEnabled &&
158 AreSIMDCombinable< ElementType_<T1>
160 , ElementType_<T3> >::value &&
161 HasSIMDAdd< ElementType_<T2>, ElementType_<T3> >::value &&
162 HasSIMDMult< ElementType_<T2>, ElementType_<T3> >::value };
173 template<
typename T1,
typename T2,
typename T3 >
174 struct UseOptimizedKernel {
176 !UseVectorizedKernel<T1,T2,T3>::value &&
177 !IsDiagonal<T3>::value &&
178 !IsResizable< ElementType_<T1> >::value &&
179 !IsResizable<VET>::value };
189 template<
typename T1,
typename T2,
typename T3 >
190 struct UseDefaultKernel {
191 enum :
bool { value = !UseVectorizedKernel<T1,T2,T3>::value &&
192 !UseOptimizedKernel<T1,T2,T3>::value };
228 enum :
bool { smpAssignable = !evaluateVector && VT::smpAssignable &&
229 !evaluateMatrix && MT::smpAssignable };
262 return vec_[index] *
mat_(index,index);
289 inline ReturnType
at(
size_t index )
const {
290 if( index >=
mat_.columns() ) {
293 return (*
this)[index];
302 inline size_t size() const noexcept {
303 return mat_.columns();
333 template<
typename T >
334 inline bool canAlias(
const T* alias )
const noexcept {
335 return vec_.isAliased( alias ) ||
mat_.isAliased( alias );
345 template<
typename T >
346 inline bool isAliased(
const T* alias )
const noexcept {
347 return vec_.isAliased( alias ) ||
mat_.isAliased( alias );
357 return mat_.isAligned();
367 return (
size() > SMP_TSVECDMATMULT_THRESHOLD );
390 template<
typename VT2 >
398 LT x(
serial( rhs.vec_ ) );
399 if( x.nonZeros() == 0UL ) {
405 RT A(
serial( rhs.mat_ ) );
414 TSVecDMatMultExpr::selectAssignKernel( ~lhs, x, A );
433 template<
typename VT1
437 selectAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
443 const size_t N( A.columns() );
445 ConstIterator element( x.begin() );
446 const ConstIterator
end( x.end() );
452 for(
size_t j=0UL; j<jend; ++j )
456 for( ; element!=
end; ++element )
458 const size_t index( element->index() );
460 if( IsDiagonal<MT1>::value )
464 for(
size_t j=last; j<index; ++j )
467 y[index] = element->value() * A(index,index);
472 const size_t jbegin( ( IsUpper<MT1>::value )
473 ?( IsStrictlyUpper<MT1>::value ? index+1UL : index )
475 const size_t jend( ( IsLower<MT1>::value )
476 ?( IsStrictlyLower<MT1>::value ? index : index+1UL )
480 for(
size_t j=jbegin; j<last; ++j ) {
481 y[j] += element->value() * A(index,j);
483 for(
size_t j=last; j<jend; ++j ) {
484 y[j] = element->value() * A(index,j);
491 if( IsLower<MT1>::value ) {
492 for(
size_t j=last; j<N; ++j )
513 template<
typename VT1
516 static inline EnableIf_< UseOptimizedKernel<VT1,VT2,MT1> >
517 selectAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
519 typedef ConstIterator_< RemoveReference_<LT> >
ConstIterator;
523 const size_t N( A.columns() );
525 ConstIterator element( x.begin() );
526 const ConstIterator
end( x.end() );
528 const size_t ipos( x.nonZeros() & size_t(-4) );
529 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == ipos,
"Invalid end calculation" );
533 const size_t i1( element->index() );
534 const VET v1( element->value() );
536 const size_t i2( element->index() );
537 const VET v2( element->value() );
539 const size_t i3( element->index() );
540 const VET v3( element->value() );
542 const size_t i4( element->index() );
543 const VET v4( element->value() );
548 for(
size_t j=0UL; j<N; ++j ) {
549 y[j] = v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
554 const size_t i1( element->index() );
555 const VET v1( element->value() );
558 for(
size_t j=0UL; j<N; ++j ) {
563 for(
size_t i=(ipos>3UL)?(4UL):(1UL); (i+4UL)<=ipos; i+=4UL )
565 const size_t i1( element->index() );
566 const VET v1( element->value() );
568 const size_t i2( element->index() );
569 const VET v2( element->value() );
571 const size_t i3( element->index() );
572 const VET v3( element->value() );
574 const size_t i4( element->index() );
575 const VET v4( element->value() );
580 const size_t jbegin( ( IsUpper<MT1>::value )
581 ?( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 )
583 const size_t jend( ( IsLower<MT1>::value )
584 ?( IsStrictlyLower<MT1>::value ? i4 : i4+1UL )
588 for(
size_t j=jbegin; j<jend; ++j ) {
589 y[j] += v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
592 for( ; element!=
end; ++element )
594 const size_t i1( element->index() );
595 const VET v1( element->value() );
597 const size_t jbegin( ( IsUpper<MT1>::value )
598 ?( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 )
600 const size_t jend( ( IsLower<MT1>::value )
601 ?( IsStrictlyLower<MT1>::value ? i1 : i1+1UL )
605 for(
size_t j=jbegin; j<jend; ++j ) {
606 y[j] += v1 * A(i1,j);
627 template<
typename VT1
630 static inline EnableIf_< UseVectorizedKernel<VT1,VT2,MT1> >
631 selectAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
633 typedef ConstIterator_< RemoveReference_<LT> >
ConstIterator;
637 const size_t N( A.columns() );
639 const bool remainder( !IsPadded<VT1>::value || !IsPadded<MT1>::value );
641 ConstIterator element( x.begin() );
642 const ConstIterator
end( x.end() );
644 const size_t ipos( x.nonZeros() & size_t(-4) );
645 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == ipos,
"Invalid end calculation" );
649 const size_t i1( element->index() );
650 const VET v1( element->value() );
652 const size_t i2( element->index() );
653 const VET v2( element->value() );
655 const size_t i3( element->index() );
656 const VET v3( element->value() );
658 const size_t i4( element->index() );
659 const VET v4( element->value() );
664 const SIMDType xmm1(
set( v1 ) );
665 const SIMDType xmm2(
set( v2 ) );
666 const SIMDType xmm3(
set( v3 ) );
667 const SIMDType xmm4(
set( v4 ) );
669 const size_t jpos( remainder ? ( N &
size_t(-SIMDSIZE) ) : N );
674 for( ; j<jpos; j+=SIMDSIZE ) {
675 y.store( j, xmm1 * A.load(i1,j) + xmm2 * A.load(i2,j) + xmm3 * A.load(i3,j) + xmm4 * A.load(i4,j) );
677 for( ; remainder && j<N; ++j ) {
678 y[j] = v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
683 const size_t i1( element->index() );
684 const VET v1( element->value() );
687 const SIMDType xmm1(
set( v1 ) );
689 const size_t jpos( remainder ? ( N &
size_t(-SIMDSIZE) ) : N );
694 for( ; j<jpos; j+=SIMDSIZE ) {
695 y.store( j, xmm1 * A.load(i1,j) );
697 for( ; remainder && j<N; ++j ) {
702 for(
size_t i=(ipos>3UL)?(4UL):(1UL); (i+4UL)<=ipos; i+=4UL )
704 const size_t i1( element->index() );
705 const VET v1( element->value() );
707 const size_t i2( element->index() );
708 const VET v2( element->value() );
710 const size_t i3( element->index() );
711 const VET v3( element->value() );
713 const size_t i4( element->index() );
714 const VET v4( element->value() );
719 const SIMDType xmm1(
set( v1 ) );
720 const SIMDType xmm2(
set( v2 ) );
721 const SIMDType xmm3(
set( v3 ) );
722 const SIMDType xmm4(
set( v4 ) );
724 const size_t jbegin( ( IsUpper<MT1>::value )
725 ?( ( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 ) &
size_t(-SIMDSIZE) )
727 const size_t jend( ( IsLower<MT1>::value )
728 ?( IsStrictlyLower<MT1>::value ? i4 : i4+1UL )
732 const size_t jpos( remainder ? ( jend &
size_t(-SIMDSIZE) ) : jend );
733 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % SIMDSIZE ) ) == jpos,
"Invalid end calculation" );
737 for( ; j<jpos; j+=SIMDSIZE ) {
738 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) );
740 for( ; remainder && j<jend; ++j ) {
741 y[j] += v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
744 for( ; element!=
end; ++element )
746 const size_t i1( element->index() );
747 const VET v1( element->value() );
749 const SIMDType xmm1(
set( v1 ) );
751 const size_t jbegin( ( IsUpper<MT1>::value )
752 ?( ( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 ) &
size_t(-SIMDSIZE) )
754 const size_t jend( ( IsLower<MT1>::value )
755 ?( IsStrictlyLower<MT1>::value ? i1 : i1+1UL )
759 const size_t jpos( remainder ? ( jend &
size_t(-SIMDSIZE) ) : jend );
760 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % SIMDSIZE ) ) == jpos,
"Invalid end calculation" );
764 for( ; j<jpos; j+=SIMDSIZE ) {
765 y.store( j, y.load(j) + xmm1 * A.load(i1,j) );
767 for( ; remainder && j<jend; ++j ) {
768 y[j] += v1 * A(i1,j);
788 template<
typename VT2 >
789 friend inline void assign( SparseVector<VT2,true>& lhs,
const TSVecDMatMultExpr& rhs )
799 const ResultType tmp(
serial( rhs ) );
817 template<
typename VT2 >
825 LT x(
serial( rhs.vec_ ) );
826 if( x.nonZeros() == 0UL )
return;
829 RT A(
serial( rhs.mat_ ) );
838 TSVecDMatMultExpr::selectAddAssignKernel( ~lhs, x, A );
856 template<
typename VT1
860 selectAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
866 const size_t N( A.columns() );
868 ConstIterator element( x.begin() );
869 const ConstIterator
end( x.end() );
871 for( ; element!=
end; ++element )
873 const size_t index( element->index() );
877 y[index] += A(index,index) * element->value();
881 const size_t jbegin( ( IsUpper<MT1>::value )
882 ?( IsStrictlyUpper<MT1>::value ? index+1UL : index )
884 const size_t jend( ( IsLower<MT1>::value )
885 ?( IsStrictlyLower<MT1>::value ? index : index+1UL )
889 for(
size_t j=jbegin; j<jend; ++j ) {
890 y[j] += element->value() * A(index,j);
912 template<
typename VT1
915 static inline EnableIf_< UseOptimizedKernel<VT1,VT2,MT1> >
916 selectAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
918 typedef ConstIterator_< RemoveReference_<LT> >
ConstIterator;
922 const size_t N( A.columns() );
924 ConstIterator element( x.begin() );
925 const ConstIterator
end( x.end() );
927 const size_t ipos( x.nonZeros() & size_t(-4) );
928 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == ipos,
"Invalid end calculation" );
930 for(
size_t i=0UL; (i+4UL)<=ipos; i+=4UL )
932 const size_t i1( element->index() );
933 const VET v1( element->value() );
935 const size_t i2( element->index() );
936 const VET v2( element->value() );
938 const size_t i3( element->index() );
939 const VET v3( element->value() );
941 const size_t i4( element->index() );
942 const VET v4( element->value() );
947 const size_t jbegin( ( IsUpper<MT1>::value )
948 ?( IsStrictlyUpper<MT1>::value ? i+1UL : i1 )
950 const size_t jend( ( IsLower<MT1>::value )
951 ?( IsStrictlyLower<MT1>::value ? i4 : i4+1UL )
955 for(
size_t j=jbegin; j<jend; ++j ) {
956 y[j] += v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
959 for( ; element!=
end; ++element )
961 const size_t i1( element->index() );
962 const VET v1( element->value() );
964 const size_t jbegin( ( IsUpper<MT1>::value )
965 ?( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 )
967 const size_t jend( ( IsLower<MT1>::value )
968 ?( IsStrictlyLower<MT1>::value ? i1 : i1+1UL )
972 for(
size_t j=jbegin; j<jend; ++j ) {
973 y[j] += v1 * A(i1,j);
994 template<
typename VT1
997 static inline EnableIf_< UseVectorizedKernel<VT1,VT2,MT1> >
998 selectAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1000 typedef ConstIterator_< RemoveReference_<LT> >
ConstIterator;
1004 const size_t N( A.columns() );
1006 const bool remainder( !IsPadded<VT1>::value || !IsPadded<MT1>::value );
1008 ConstIterator element( x.begin() );
1009 const ConstIterator
end( x.end() );
1011 const size_t ipos( x.nonZeros() & size_t(-4) );
1012 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == ipos,
"Invalid end calculation" );
1014 for(
size_t i=0UL; (i+4UL)<=ipos; i+=4UL )
1016 const size_t i1( element->index() );
1017 const VET v1( element->value() );
1019 const size_t i2( element->index() );
1020 const VET v2( element->value() );
1022 const size_t i3( element->index() );
1023 const VET v3( element->value() );
1025 const size_t i4( element->index() );
1026 const VET v4( element->value() );
1031 const SIMDType xmm1(
set( v1 ) );
1032 const SIMDType xmm2(
set( v2 ) );
1033 const SIMDType xmm3(
set( v3 ) );
1034 const SIMDType xmm4(
set( v4 ) );
1036 const size_t jbegin( ( IsUpper<MT1>::value )
1037 ?( ( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 ) &
size_t(-SIMDSIZE) )
1039 const size_t jend( ( IsLower<MT1>::value )
1040 ?( IsStrictlyLower<MT1>::value ? i4 : i4+1UL )
1044 const size_t jpos( remainder ? ( jend &
size_t(-SIMDSIZE) ) : jend );
1045 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % SIMDSIZE ) ) == jpos,
"Invalid end calculation" );
1049 for( ; j<jpos; j+=SIMDSIZE ) {
1050 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) );
1052 for( ; remainder && j<jend; ++j ) {
1053 y[j] += v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
1056 for( ; element!=
end; ++element )
1058 const size_t i1( element->index() );
1059 const VET v1( element->value() );
1061 const SIMDType xmm1(
set( v1 ) );
1063 const size_t jbegin( ( IsUpper<MT1>::value )
1064 ?( ( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 ) &
size_t(-SIMDSIZE) )
1066 const size_t jend( ( IsLower<MT1>::value )
1067 ?( IsStrictlyLower<MT1>::value ? i1 : i1+1UL )
1071 const size_t jpos( remainder ? ( jend &
size_t(-SIMDSIZE) ) : jend );
1072 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % SIMDSIZE ) ) == jpos,
"Invalid end calculation" );
1076 for( ; j<jpos; j+=SIMDSIZE ) {
1077 y.store( j, y.load(j) + xmm1 * A.load(i1,j) );
1079 for( ; remainder && j<jend; ++j ) {
1080 y[j] += v1 * A(i1,j);
1103 template<
typename VT2 >
1111 LT x(
serial( rhs.vec_ ) );
1112 if( x.nonZeros() == 0UL )
return;
1115 RT A(
serial( rhs.mat_ ) );
1124 TSVecDMatMultExpr::selectSubAssignKernel( ~lhs, x, A );
1142 template<
typename VT1
1146 selectSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1152 const size_t N( A.columns() );
1154 ConstIterator element( x.begin() );
1155 const ConstIterator
end( x.end() );
1157 for( ; element!=
end; ++element )
1159 const size_t index( element->index() );
1163 y[index] -= A(index,index) * element->value();
1167 const size_t jbegin( ( IsUpper<MT1>::value )
1168 ?( IsStrictlyUpper<MT1>::value ? index+1UL : index )
1170 const size_t jend( ( IsLower<MT1>::value )
1171 ?( IsStrictlyLower<MT1>::value ? index : index+1UL )
1175 for(
size_t j=jbegin; j<jend; ++j ) {
1176 y[j] -= element->value() * A(index,j);
1198 template<
typename VT1
1201 static inline EnableIf_< UseOptimizedKernel<VT1,VT2,MT1> >
1202 selectSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1204 typedef ConstIterator_< RemoveReference_<LT> >
ConstIterator;
1208 const size_t N( A.columns() );
1210 ConstIterator element( x.begin() );
1211 const ConstIterator
end( x.end() );
1213 const size_t ipos( x.nonZeros() & size_t(-4) );
1214 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == ipos,
"Invalid end calculation" );
1216 for(
size_t i=0UL; (i+4UL)<=ipos; i+=4UL )
1218 const size_t i1( element->index() );
1219 const VET v1( element->value() );
1221 const size_t i2( element->index() );
1222 const VET v2( element->value() );
1224 const size_t i3( element->index() );
1225 const VET v3( element->value() );
1227 const size_t i4( element->index() );
1228 const VET v4( element->value() );
1233 const size_t jbegin( ( IsUpper<MT1>::value )
1234 ?( IsStrictlyUpper<MT1>::value ? i+1UL : i1 )
1236 const size_t jend( ( IsLower<MT1>::value )
1237 ?( IsStrictlyLower<MT1>::value ? i4 : i4+1UL )
1241 for(
size_t j=jbegin; j<jend; ++j ) {
1242 y[j] -= v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
1245 for( ; element!=
end; ++element )
1247 const size_t i1( element->index() );
1248 const VET v1( element->value() );
1250 const size_t jbegin( ( IsUpper<MT1>::value )
1251 ?( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 )
1253 const size_t jend( ( IsLower<MT1>::value )
1254 ?( IsStrictlyLower<MT1>::value ? i1 : i1+1UL )
1258 for(
size_t j=jbegin; j<jend; ++j ) {
1259 y[j] -= v1 * A(i1,j);
1280 template<
typename VT1
1283 static inline EnableIf_< UseVectorizedKernel<VT1,VT2,MT1> >
1284 selectSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1286 typedef ConstIterator_< RemoveReference_<LT> >
ConstIterator;
1290 const size_t N( A.columns() );
1292 const bool remainder( !IsPadded<VT1>::value || !IsPadded<MT1>::value );
1294 ConstIterator element( x.begin() );
1295 const ConstIterator
end( x.end() );
1297 const size_t ipos( x.nonZeros() & size_t(-4) );
1298 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == ipos,
"Invalid end calculation" );
1300 for(
size_t i=0UL; (i+4UL)<=ipos; i+=4UL )
1302 const size_t i1( element->index() );
1303 const VET v1( element->value() );
1305 const size_t i2( element->index() );
1306 const VET v2( element->value() );
1308 const size_t i3( element->index() );
1309 const VET v3( element->value() );
1311 const size_t i4( element->index() );
1312 const VET v4( element->value() );
1317 const SIMDType xmm1(
set( v1 ) );
1318 const SIMDType xmm2(
set( v2 ) );
1319 const SIMDType xmm3(
set( v3 ) );
1320 const SIMDType xmm4(
set( v4 ) );
1322 const size_t jbegin( ( IsUpper<MT1>::value )
1323 ?( ( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 ) &
size_t(-SIMDSIZE) )
1325 const size_t jend( ( IsLower<MT1>::value )
1326 ?( IsStrictlyLower<MT1>::value ? i4 : i4+1UL )
1330 const size_t jpos( remainder ? ( jend &
size_t(-SIMDSIZE) ) : jend );
1331 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % SIMDSIZE ) ) == jpos,
"Invalid end calculation" );
1335 for( ; j<jpos; j+=SIMDSIZE ) {
1336 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) );
1338 for( ; remainder && j<jend; ++j ) {
1339 y[j] -= v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
1342 for( ; element!=x.end(); ++element )
1344 const size_t i1( element->index() );
1345 const VET v1( element->value() );
1347 const SIMDType xmm1(
set( v1 ) );
1349 const size_t jbegin( ( IsUpper<MT1>::value )
1350 ?( ( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 ) &
size_t(-SIMDSIZE) )
1352 const size_t jend( ( IsLower<MT1>::value )
1353 ?( IsStrictlyLower<MT1>::value ? i1 : i1+1UL )
1357 const size_t jpos( remainder ? ( jend &
size_t(-SIMDSIZE) ) : jend );
1358 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % SIMDSIZE ) ) == jpos,
"Invalid end calculation" );
1362 for( ; j<jpos; j+=SIMDSIZE ) {
1363 y.store( j, y.load(j) - xmm1 * A.load(i1,j) );
1365 for( ; remainder && j<jend; ++j ) {
1366 y[j] -= v1 * A(i1,j);
1389 template<
typename VT2 >
1400 const ResultType tmp(
serial( rhs ) );
1421 template<
typename VT2 >
1432 const ResultType tmp(
serial( rhs ) );
1456 template<
typename VT2 >
1466 if( x.nonZeros() == 0UL ) {
1501 template<
typename VT2 >
1502 friend inline EnableIf_< UseSMPAssign<VT2> >
1513 const ResultType tmp( rhs );
1533 template<
typename VT2 >
1534 friend inline EnableIf_< UseSMPAssign<VT2> >
1543 if( x.nonZeros() == 0UL )
return;
1577 template<
typename VT2 >
1587 if( x.nonZeros() == 0UL )
return;
1621 template<
typename VT2 >
1633 const ResultType tmp( rhs );
1656 template<
typename VT2 >
1668 const ResultType tmp( rhs );
1729 template<
typename T1,
typename T2 >
1730 inline const DisableIf_< IsMatMatMultExpr<T2>, TSVecDMatMultExpr<T1,T2> >
1735 if( (~vec).
size() != (~mat).
rows() ) {
1765 template<
typename T1
1768 inline const EnableIf_< IsMatMatMultExpr<T2>, MultExprTrait_<T1,T2> >
1790 template<
typename VT,
typename MT >
1807 template<
typename VT,
typename MT >
1825 template<
typename VT,
typename MT,
bool AF >
1830 using Type = MultExprTrait_< SubvectorExprTrait_<const VT,AF>
1831 , SubmatrixExprTrait_<const MT,AF> >;
MultTrait_< VRT, MRT > ResultType
Result type for expression template evaluations.
Definition: TSVecDMatMultExpr.h:200
friend EnableIf_< UseSMPAssign< VT2 > > smpDivAssign(DenseVector< VT2, true > &lhs, const TSVecDMatMultExpr &rhs)
SMP division assignment of a transpose sparse vector-dense matrix multiplication to a dense vector ( ...
Definition: TSVecDMatMultExpr.h:1658
#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
friend EnableIf_< UseSMPAssign< VT2 > > smpAddAssign(DenseVector< VT2, true > &lhs, const TSVecDMatMultExpr &rhs)
SMP addition assignment of a transpose sparse vector-dense matrix multiplication to a dense vector ( ...
Definition: TSVecDMatMultExpr.h:1535
Header file for auxiliary alias declarations.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:72
constexpr bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
ElementType_< ResultType > ElementType
Resulting element type.
Definition: TSVecDMatMultExpr.h:202
CompositeType_< VT > VCT
Composite type of the left-hand side sparse vector expression.
Definition: TSVecDMatMultExpr.h:120
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:1390
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7800
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: TSVecDMatMultExpr.h:302
Header file for basic type definitions.
TSVecDMatMultExpr< VT, MT > This
Type of this TSVecDMatMultExpr instance.
Definition: TSVecDMatMultExpr.h:199
Expression object for transpose sparse vector-dense matrix multiplications.The TSVecDMatMultExpr clas...
Definition: Forward.h:150
RightOperand rightOperand() const noexcept
Returns the right-hand side dense matrix operand.
Definition: TSVecDMatMultExpr.h:322
friend EnableIf_< UseSMPAssign< VT2 > > smpMultAssign(DenseVector< VT2, true > &lhs, const TSVecDMatMultExpr &rhs)
SMP multiplication assignment of a transpose sparse vector-dense matrix multiplication to a dense vec...
Definition: TSVecDMatMultExpr.h:1623
Header file for the serial shim.
Header file for the IsDiagonal type trait.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
#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 IsSame and IsStrictlySame type traits.
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:188
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:162
LeftOperand vec_
Left-hand side sparse vector of the multiplication expression.
Definition: TSVecDMatMultExpr.h:373
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:315
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
IfTrue_< evaluateVector, const VRT, VCT > LT
Type for the assignment of the left-hand side sparse vector operand.
Definition: TSVecDMatMultExpr.h:214
Header file for the DenseVector base class.
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
Availability of a SIMD addition for the given data types.Depending on the available instruction set (...
Definition: HasSIMDAdd.h:162
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: TSVecDMatMultExpr.h:289
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: TSVecDMatMultExpr.h:201
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:245
Header file for the Computation base class.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: TSVecDMatMultExpr.h:366
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
Constraints on the storage order of matrix types.
Header file for the RequiresEvaluation type trait.
System settings for performance optimizations.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, ColumnExprTrait_< MT > > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:126
If_< IsExpression< VT >, const VT, const VT & > LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: TSVecDMatMultExpr.h:208
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Constraint on the data type.
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse vector operand.
Definition: TSVecDMatMultExpr.h:312
Constraint on the data type.
Header file for the MultExprTrait class template.
RightOperand mat_
Right-hand side dense matrix of the multiplication expression.
Definition: TSVecDMatMultExpr.h:374
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
SubvectorExprTrait_< VT, unaligned > subvector(Vector< VT, TF > &vector, size_t index, size_t size)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:152
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
CompositeType_< MT > MCT
Composite type of the right-hand side dense matrix expression.
Definition: TSVecDMatMultExpr.h:121
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:818
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: TSVecDMatMultExpr.h:334
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
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:1422
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
ElementType_< VRT > VET
Element type of the left-hand side sparse vector expression.
Definition: TSVecDMatMultExpr.h:118
Header file for the IsMatMatMultExpr type trait class.
#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 Columns type trait.
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
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:70
Header file for the IsLower type trait.
#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.
Compile time check for diagonal matrices.This type trait tests whether or not the given template para...
Definition: IsDiagonal.h:90
IfTrue_< evaluateMatrix, const MRT, MCT > RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: TSVecDMatMultExpr.h:217
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:60
Constraint on the data type.
Header file for the exception macros of the math module.
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
BLAZE_ALWAYS_INLINE 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:254
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: TSVecDMatMultExpr.h:356
If_< IsExpression< MT >, const MT, const MT & > RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TSVecDMatMultExpr.h:211
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:76
ResultType_< VT > VRT
Result type of the left-hand side sparse vector expression.
Definition: TSVecDMatMultExpr.h:116
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
Header file for the SubmatrixExprTrait class template.
#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.
Header file for run time assertion macros.
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TSVecDMatMultExpr.h:204
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:160
Header file for the reset shim.
Constraint on the data type.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: TSVecDMatMultExpr.h:257
Header file for the TVecMatMultExpr base class.
Constraint on the data type.
TSVecDMatMultExpr(const VT &vec, const MT &mat) noexcept
Constructor for the TSVecDMatMultExpr class.
Definition: TSVecDMatMultExpr.h:243
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
Header file for the RemoveReference type trait.
ResultType_< MT > MRT
Result type of the right-hand side dense matrix expression.
Definition: TSVecDMatMultExpr.h:117
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:314
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
#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:110
Header file for the AreSIMDCombinable type trait.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: TSVecDMatMultExpr.h:346
Header file for the IsComputation type trait class.
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:110
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
Header file for the IntegralConstant class template.
#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
Header file for the SubvectorExprTrait class template.
SIMDTrait_< ElementType > SIMDType
Resulting SIMD element type.
Definition: TSVecDMatMultExpr.h:203
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
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:1104
Header file for the IsUpper type trait.
friend EnableIf_< UseSMPAssign< VT2 > > smpSubAssign(DenseVector< VT2, true > &lhs, const TSVecDMatMultExpr &rhs)
SMP subtraction assignment of a transpose sparse vector-dense matrix multiplication to a dense vector...
Definition: TSVecDMatMultExpr.h:1579
Header file for the IsResizable type trait.
const ResultType CompositeType
Data type for composite expression templates.
Definition: TSVecDMatMultExpr.h:205
ElementType_< MRT > MET
Element type of the right-hand side dense matrix expression.
Definition: TSVecDMatMultExpr.h:119
Header file for the Size type trait.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Constraint on the transpose flag of vector types.
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.