35 #ifndef _BLAZE_MATH_EXPRESSIONS_TSVECDMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TSVECDMATMULTEXPR_H_
103 template<
typename VT
105 class TSVecDMatMultExpr :
public DenseVector< TSVecDMatMultExpr<VT,MT>, true >
106 ,
private TVecMatMultExpr
107 ,
private Computation
136 template<
typename T1 >
137 struct UseSMPAssign {
138 enum { value = ( evaluateVector || evaluateMatrix ) };
149 template<
typename T1,
typename T2,
typename T3 >
150 struct UseVectorizedKernel {
152 !IsDiagonal<T3>::value &&
153 T1::vectorizable && T3::vectorizable &&
154 IsSame<typename T1::ElementType,typename T2::ElementType>::value &&
155 IsSame<typename T1::ElementType,typename T3::ElementType>::value &&
156 IntrinsicTrait<typename T1::ElementType>::addition &&
157 IntrinsicTrait<typename T1::ElementType>::multiplication };
168 template<
typename T1,
typename T2,
typename T3 >
169 struct UseOptimizedKernel {
171 !UseVectorizedKernel<T1,T2,T3>::value &&
172 !IsDiagonal<T3>::value &&
173 !IsResizable<typename T1::ElementType>::value &&
174 !IsResizable<VET>::value };
184 template<
typename T1,
typename T2,
typename T3 >
185 struct UseDefaultKernel {
186 enum { value = !UseVectorizedKernel<T1,T2,T3>::value &&
187 !UseOptimizedKernel<T1,T2,T3>::value };
224 enum { smpAssignable = !evaluateVector && VT::smpAssignable &&
225 !evaluateMatrix && MT::smpAssignable };
266 if( element != end ) {
267 res = element->value() *
mat_( element->index(), index );
269 for( ; element!=
end; ++element ) {
270 res += element->value() *
mat_( element->index(), index );
285 inline ReturnType
at(
size_t index )
const {
286 if( index >=
mat_.columns() ) {
289 return (*
this)[index];
299 return mat_.columns();
329 template<
typename T >
331 return vec_.isAliased( alias ) ||
mat_.isAliased( alias );
341 template<
typename T >
343 return vec_.isAliased( alias ) ||
mat_.isAliased( alias );
353 return mat_.isAligned();
363 return (
size() > SMP_TSVECDMATMULT_THRESHOLD );
386 template<
typename VT2 >
394 LT x(
serial( rhs.vec_ ) );
395 if( x.nonZeros() == 0UL ) {
401 RT A(
serial( rhs.mat_ ) );
410 TSVecDMatMultExpr::selectAssignKernel( ~lhs, x, A );
429 template<
typename VT1
433 selectAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
439 const size_t N( A.columns() );
441 ConstIterator element( x.begin() );
442 const ConstIterator
end( x.end() );
448 for(
size_t j=0UL; j<jend; ++j )
452 for( ; element!=
end; ++element )
454 const size_t index( element->index() );
456 if( IsDiagonal<MT1>::value )
460 for(
size_t j=last; j<index; ++j )
463 y[index] = element->value() * A(index,index);
468 const size_t jbegin( ( IsUpper<MT1>::value )
469 ?( IsStrictlyUpper<MT1>::value ? index+1UL : index )
471 const size_t jend( ( IsLower<MT1>::value )
472 ?( IsStrictlyLower<MT1>::value ? index : index+1UL )
476 for(
size_t j=jbegin; j<last; ++j ) {
477 y[j] += element->value() * A(index,j);
479 for(
size_t j=last; j<jend; ++j ) {
480 y[j] = element->value() * A(index,j);
487 if( IsLower<MT1>::value ) {
488 for(
size_t j=last; j<N; ++j )
509 template<
typename VT1
512 static inline typename EnableIf< UseOptimizedKernel<VT1,VT2,MT1> >::Type
513 selectAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
519 const size_t N( A.columns() );
521 ConstIterator element( x.begin() );
522 const ConstIterator
end( x.end() );
524 const size_t ipos( x.nonZeros() & size_t(-4) );
525 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == ipos,
"Invalid end calculation" );
529 const size_t i1( element->index() );
530 const VET v1( element->value() );
532 const size_t i2( element->index() );
533 const VET v2( element->value() );
535 const size_t i3( element->index() );
536 const VET v3( element->value() );
538 const size_t i4( element->index() );
539 const VET v4( element->value() );
544 for(
size_t j=0UL; j<N; ++j ) {
545 y[j] = v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
550 const size_t i1( element->index() );
551 const VET v1( element->value() );
554 for(
size_t j=0UL; j<N; ++j ) {
559 for(
size_t i=(ipos>3UL)?(4UL):(1UL); (i+4UL)<=ipos; i+=4UL )
561 const size_t i1( element->index() );
562 const VET v1( element->value() );
564 const size_t i2( element->index() );
565 const VET v2( element->value() );
567 const size_t i3( element->index() );
568 const VET v3( element->value() );
570 const size_t i4( element->index() );
571 const VET v4( element->value() );
576 const size_t jbegin( ( IsUpper<MT1>::value )
577 ?( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 )
579 const size_t jend( ( IsLower<MT1>::value )
580 ?( IsStrictlyLower<MT1>::value ? i4 : i4+1UL )
584 for(
size_t j=jbegin; j<jend; ++j ) {
585 y[j] += v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
588 for( ; element!=
end; ++element )
590 const size_t i1( element->index() );
591 const VET v1( element->value() );
593 const size_t jbegin( ( IsUpper<MT1>::value )
594 ?( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 )
596 const size_t jend( ( IsLower<MT1>::value )
597 ?( IsStrictlyLower<MT1>::value ? i1 : i1+1UL )
601 for(
size_t j=jbegin; j<jend; ++j ) {
602 y[j] += v1 * A(i1,j);
623 template<
typename VT1
626 static inline typename EnableIf< UseVectorizedKernel<VT1,VT2,MT1> >::Type
627 selectAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
629 typedef IntrinsicTrait<ElementType> IT;
634 const size_t N( A.columns() );
636 const bool remainder( !IsPadded<VT1>::value || !IsPadded<MT1>::value );
638 ConstIterator element( x.begin() );
639 const ConstIterator
end( x.end() );
641 const size_t ipos( x.nonZeros() & size_t(-4) );
642 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == ipos,
"Invalid end calculation" );
646 const size_t i1( element->index() );
647 const VET v1( element->value() );
649 const size_t i2( element->index() );
650 const VET v2( element->value() );
652 const size_t i3( element->index() );
653 const VET v3( element->value() );
655 const size_t i4( element->index() );
656 const VET v4( element->value() );
661 const IntrinsicType xmm1(
set( v1 ) );
662 const IntrinsicType xmm2(
set( v2 ) );
663 const IntrinsicType xmm3(
set( v3 ) );
664 const IntrinsicType xmm4(
set( v4 ) );
666 const size_t jpos( remainder ? ( N &
size_t(-
IT::size) ) : N );
672 y.store( j, xmm1 * A.load(i1,j) + xmm2 * A.load(i2,j) + xmm3 * A.load(i3,j) + xmm4 * A.load(i4,j) );
674 for( ; remainder && j<N; ++j ) {
675 y[j] = v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
680 const size_t i1( element->index() );
681 const VET v1( element->value() );
684 const IntrinsicType xmm1(
set( v1 ) );
686 const size_t jpos( remainder ? ( N &
size_t(-
IT::size) ) : N );
692 y.store( j, xmm1 * A.load(i1,j) );
694 for( ; remainder && j<N; ++j ) {
699 for(
size_t i=(ipos>3UL)?(4UL):(1UL); (i+4UL)<=ipos; i+=4UL )
701 const size_t i1( element->index() );
702 const VET v1( element->value() );
704 const size_t i2( element->index() );
705 const VET v2( element->value() );
707 const size_t i3( element->index() );
708 const VET v3( element->value() );
710 const size_t i4( element->index() );
711 const VET v4( element->value() );
716 const IntrinsicType xmm1(
set( v1 ) );
717 const IntrinsicType xmm2(
set( v2 ) );
718 const IntrinsicType xmm3(
set( v3 ) );
719 const IntrinsicType xmm4(
set( v4 ) );
721 const size_t jbegin( ( IsUpper<MT1>::value )
722 ?( ( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 ) &
size_t(-
IT::size) )
724 const size_t jend( ( IsLower<MT1>::value )
725 ?( IsStrictlyLower<MT1>::value ? i4 : i4+1UL )
729 const size_t jpos( remainder ? ( jend &
size_t(-
IT::size) ) : jend );
735 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) );
737 for( ; remainder && j<jend; ++j ) {
738 y[j] += v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
741 for( ; element!=
end; ++element )
743 const size_t i1( element->index() );
744 const VET v1( element->value() );
746 const IntrinsicType xmm1(
set( v1 ) );
748 const size_t jbegin( ( IsUpper<MT1>::value )
749 ?( ( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 ) &
size_t(-
IT::size) )
751 const size_t jend( ( IsLower<MT1>::value )
752 ?( IsStrictlyLower<MT1>::value ? i1 : i1+1UL )
756 const size_t jpos( remainder ? ( jend &
size_t(-
IT::size) ) : jend );
762 y.store( j, y.load(j) + xmm1 * A.load(i1,j) );
764 for( ; remainder && j<jend; ++j ) {
765 y[j] += v1 * A(i1,j);
785 template<
typename VT2 >
786 friend inline void assign( SparseVector<VT2,true>& lhs,
const TSVecDMatMultExpr& rhs )
796 const ResultType tmp(
serial( rhs ) );
814 template<
typename VT2 >
822 LT x(
serial( rhs.vec_ ) );
823 if( x.nonZeros() == 0UL )
return;
826 RT A(
serial( rhs.mat_ ) );
835 TSVecDMatMultExpr::selectAddAssignKernel( ~lhs, x, A );
853 template<
typename VT1
857 selectAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
863 const size_t N( A.columns() );
865 ConstIterator element( x.begin() );
866 const ConstIterator
end( x.end() );
868 for( ; element!=
end; ++element )
870 const size_t index( element->index() );
874 y[index] += A(index,index) * element->value();
878 const size_t jbegin( ( IsUpper<MT1>::value )
879 ?( IsStrictlyUpper<MT1>::value ? index+1UL : index )
881 const size_t jend( ( IsLower<MT1>::value )
882 ?( IsStrictlyLower<MT1>::value ? index : index+1UL )
886 for(
size_t j=jbegin; j<jend; ++j ) {
887 y[j] += element->value() * A(index,j);
909 template<
typename VT1
912 static inline typename EnableIf< UseOptimizedKernel<VT1,VT2,MT1> >::Type
913 selectAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
919 const size_t N( A.columns() );
921 ConstIterator element( x.begin() );
922 const ConstIterator
end( x.end() );
924 const size_t ipos( x.nonZeros() & size_t(-4) );
925 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == ipos,
"Invalid end calculation" );
927 for(
size_t i=0UL; (i+4UL)<=ipos; i+=4UL )
929 const size_t i1( element->index() );
930 const VET v1( element->value() );
932 const size_t i2( element->index() );
933 const VET v2( element->value() );
935 const size_t i3( element->index() );
936 const VET v3( element->value() );
938 const size_t i4( element->index() );
939 const VET v4( element->value() );
944 const size_t jbegin( ( IsUpper<MT1>::value )
945 ?( IsStrictlyUpper<MT1>::value ? i+1UL : i1 )
947 const size_t jend( ( IsLower<MT1>::value )
948 ?( IsStrictlyLower<MT1>::value ? i4 : i4+1UL )
952 for(
size_t j=jbegin; j<jend; ++j ) {
953 y[j] += v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
956 for( ; element!=
end; ++element )
958 const size_t i1( element->index() );
959 const VET v1( element->value() );
961 const size_t jbegin( ( IsUpper<MT1>::value )
962 ?( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 )
964 const size_t jend( ( IsLower<MT1>::value )
965 ?( IsStrictlyLower<MT1>::value ? i1 : i1+1UL )
969 for(
size_t j=jbegin; j<jend; ++j ) {
970 y[j] += v1 * A(i1,j);
991 template<
typename VT1
994 static inline typename EnableIf< UseVectorizedKernel<VT1,VT2,MT1> >::Type
995 selectAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
997 typedef IntrinsicTrait<ElementType> IT;
1002 const size_t N( A.columns() );
1004 const bool remainder( !IsPadded<VT1>::value || !IsPadded<MT1>::value );
1006 ConstIterator element( x.begin() );
1007 const ConstIterator
end( x.end() );
1009 const size_t ipos( x.nonZeros() & size_t(-4) );
1010 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == ipos,
"Invalid end calculation" );
1012 for(
size_t i=0UL; (i+4UL)<=ipos; i+=4UL )
1014 const size_t i1( element->index() );
1015 const VET v1( element->value() );
1017 const size_t i2( element->index() );
1018 const VET v2( element->value() );
1020 const size_t i3( element->index() );
1021 const VET v3( element->value() );
1023 const size_t i4( element->index() );
1024 const VET v4( element->value() );
1029 const IntrinsicType xmm1(
set( v1 ) );
1030 const IntrinsicType xmm2(
set( v2 ) );
1031 const IntrinsicType xmm3(
set( v3 ) );
1032 const IntrinsicType xmm4(
set( v4 ) );
1034 const size_t jbegin( ( IsUpper<MT1>::value )
1035 ?( ( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 ) &
size_t(-
IT::size) )
1037 const size_t jend( ( IsLower<MT1>::value )
1038 ?( IsStrictlyLower<MT1>::value ? i4 : i4+1UL )
1042 const size_t jpos( remainder ? ( jend &
size_t(-
IT::size) ) : jend );
1048 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) );
1050 for( ; remainder && j<jend; ++j ) {
1051 y[j] += v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
1054 for( ; element!=
end; ++element )
1056 const size_t i1( element->index() );
1057 const VET v1( element->value() );
1059 const IntrinsicType xmm1(
set( v1 ) );
1061 const size_t jbegin( ( IsUpper<MT1>::value )
1062 ?( ( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 ) &
size_t(-
IT::size) )
1064 const size_t jend( ( IsLower<MT1>::value )
1065 ?( IsStrictlyLower<MT1>::value ? i1 : i1+1UL )
1069 const size_t jpos( remainder ? ( jend &
size_t(-
IT::size) ) : jend );
1075 y.store( j, y.load(j) + xmm1 * A.load(i1,j) );
1077 for( ; remainder && j<jend; ++j ) {
1078 y[j] += v1 * A(i1,j);
1101 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 typename EnableIf< UseOptimizedKernel<VT1,VT2,MT1> >::Type
1202 selectSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
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 typename EnableIf< UseVectorizedKernel<VT1,VT2,MT1> >::Type
1284 selectSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1286 typedef IntrinsicTrait<ElementType> IT;
1291 const size_t N( A.columns() );
1293 const bool remainder( !IsPadded<VT1>::value || !IsPadded<MT1>::value );
1295 ConstIterator element( x.begin() );
1296 const ConstIterator
end( x.end() );
1298 const size_t ipos( x.nonZeros() & size_t(-4) );
1299 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == ipos,
"Invalid end calculation" );
1301 for(
size_t i=0UL; (i+4UL)<=ipos; i+=4UL )
1303 const size_t i1( element->index() );
1304 const VET v1( element->value() );
1306 const size_t i2( element->index() );
1307 const VET v2( element->value() );
1309 const size_t i3( element->index() );
1310 const VET v3( element->value() );
1312 const size_t i4( element->index() );
1313 const VET v4( element->value() );
1318 const IntrinsicType xmm1(
set( v1 ) );
1319 const IntrinsicType xmm2(
set( v2 ) );
1320 const IntrinsicType xmm3(
set( v3 ) );
1321 const IntrinsicType xmm4(
set( v4 ) );
1323 const size_t jbegin( ( IsUpper<MT1>::value )
1324 ?( ( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 ) &
size_t(-
IT::size) )
1326 const size_t jend( ( IsLower<MT1>::value )
1327 ?( IsStrictlyLower<MT1>::value ? i4 : i4+1UL )
1331 const size_t jpos( remainder ? ( jend &
size_t(-
IT::size) ) : jend );
1337 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) );
1339 for( ; remainder && j<jend; ++j ) {
1340 y[j] -= v1 * A(i1,j) + v2 * A(i2,j) + v3 * A(i3,j) + v4 * A(i4,j);
1343 for( ; element!=x.end(); ++element )
1345 const size_t i1( element->index() );
1346 const VET v1( element->value() );
1348 const IntrinsicType xmm1(
set( v1 ) );
1350 const size_t jbegin( ( IsUpper<MT1>::value )
1351 ?( ( IsStrictlyUpper<MT1>::value ? i1+1UL : i1 ) &
size_t(-
IT::size) )
1353 const size_t jend( ( IsLower<MT1>::value )
1354 ?( IsStrictlyLower<MT1>::value ? i1 : i1+1UL )
1358 const size_t jpos( remainder ? ( jend &
size_t(-
IT::size) ) : jend );
1364 y.store( j, y.load(j) - xmm1 * A.load(i1,j) );
1366 for( ; remainder && j<jend; ++j ) {
1367 y[j] -= v1 * A(i1,j);
1390 template<
typename VT2 >
1401 const ResultType tmp(
serial( rhs ) );
1425 template<
typename VT2 >
1435 if( x.nonZeros() == 0UL ) {
1470 template<
typename VT2 >
1471 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
1482 const ResultType tmp( rhs );
1502 template<
typename VT2 >
1503 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
1512 if( x.nonZeros() == 0UL )
return;
1546 template<
typename VT2 >
1558 if( x.nonZeros() == 0UL )
return;
1592 template<
typename VT2 >
1604 const ResultType tmp( rhs );
1665 template<
typename T1,
typename T2 >
1666 inline const typename DisableIf< IsMatMatMultExpr<T2>, TSVecDMatMultExpr<T1,T2> >::Type
1671 if( (~vec).
size() != (~mat).
rows() ) {
1701 template<
typename T1
1704 inline const typename EnableIf< IsMatMatMultExpr<T2>,
typename MultExprTrait<T1,T2>::Type >::Type
1726 template<
typename VT,
typename MT >
1743 template<
typename VT,
typename MT >
1744 struct IsAligned<
TSVecDMatMultExpr<VT,MT> > :
public IsTrue< IsAligned<MT>::value >
1760 template<
typename VT,
typename MT,
bool AF >
1765 typedef typename MultExprTrait< typename SubvectorExprTrait<const VT,AF>::Type
1766 ,
typename SubmatrixExprTrait<const MT,AF>::Type >::Type Type;
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: TSVecDMatMultExpr.h:198
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: TSVecDMatMultExpr.h:342
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type set(T value)
Sets all values in the vector to the given 2-byte integral value.
Definition: Set.h:73
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
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:1391
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:7820
Header file for basic type definitions.
TSVecDMatMultExpr< VT, MT > This
Type of this TSVecDMatMultExpr instance.
Definition: TSVecDMatMultExpr.h:194
Expression object for transpose sparse vector-dense matrix multiplications.The TSVecDMatMultExpr clas...
Definition: Forward.h:160
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: TSVecDMatMultExpr.h:203
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TSVecDMatMultExpr.h:206
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:250
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
Header file for the IsDiagonal type trait.
#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:79
Header file for the IsSame and IsStrictlySame type traits.
LeftOperand vec_
Left-hand side sparse vector of the multiplication expression.
Definition: TSVecDMatMultExpr.h:369
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:507
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:259
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:308
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:90
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: TSVecDMatMultExpr.h:285
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
Header file for the Computation base class.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:158
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:90
Constraints on the storage order of matrix types.
Header file for the RequiresEvaluation type trait.
System settings for performance optimizations.
MRT::ElementType MET
Element type of the right-hand side dense matrix expression.
Definition: TSVecDMatMultExpr.h:114
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
VRT::ElementType VET
Element type of the left-hand side sparse vector expression.
Definition: TSVecDMatMultExpr.h:113
Constraint on the data type.
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: TSVecDMatMultExpr.h:352
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: TSVecDMatMultExpr.h:362
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: TSVecDMatMultExpr.h:196
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:370
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:261
VT::CompositeType VCT
Composite type of the left-hand side sparse vector expression.
Definition: TSVecDMatMultExpr.h:115
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
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:815
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
MT::CompositeType MCT
Composite type of the right-hand side dense matrix expression.
Definition: TSVecDMatMultExpr.h:116
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
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 exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
Header file for the Columns type trait.
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:79
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:92
SelectType< evaluateVector, const VRT, VCT >::Type LT
Type for the assignment of the left-hand side sparse vector operand.
Definition: TSVecDMatMultExpr.h:209
#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:78
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: TSVecDMatMultExpr.h:330
Constraint on the data type.
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
TSVecDMatMultExpr(const VT &vec, const MT &mat)
Constructor for the TSVecDMatMultExpr class.
Definition: TSVecDMatMultExpr.h:234
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Header file for the serial shim.
SelectType< evaluateMatrix, const MRT, MCT >::Type RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: TSVecDMatMultExpr.h:212
friend EnableIf< UseSMPAssign< VT2 > >::Type 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:1594
#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:116
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:79
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
ResultType::ElementType ElementType
Resulting element type.
Definition: TSVecDMatMultExpr.h:197
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type 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
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TSVecDMatMultExpr.h:199
Base template for the MultTrait class.
Definition: MultTrait.h:138
friend EnableIf< UseSMPAssign< VT2 > >::Type 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:1504
LeftOperand leftOperand() const
Returns the left-hand side sparse vector operand.
Definition: TSVecDMatMultExpr.h:308
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
const bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
Header file for the reset shim.
Constraint on the data type.
size_t size() const
Returns the current size/dimension of the vector.
Definition: TSVecDMatMultExpr.h:298
Compile time check for data types.This type trait tests whether or not the given template parameter i...
Definition: IsBlasCompatible.h:99
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: TSVecDMatMultExpr.h:248
Header file for the TVecMatMultExpr base class.
Constraint on the data type.
MultTrait< VRT, MRT >::Type ResultType
Result type for expression template evaluations.
Definition: TSVecDMatMultExpr.h:195
Header file for the RemoveReference type trait.
Header file for all intrinsic functionality.
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
#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:79
#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:166
Header file for the IsComputation type trait class.
friend EnableIf< UseSMPAssign< VT2 > >::Type 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:1548
RightOperand rightOperand() const
Returns the right-hand side dense matrix operand.
Definition: TSVecDMatMultExpr.h:318
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:118
#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
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
#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:79
Header file for the SubvectorExprTrait class template.
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:1102
Header file for the IsUpper type trait.
Header file for exception macros.
Header file for the IsResizable type trait.
const ResultType CompositeType
Data type for composite expression templates.
Definition: TSVecDMatMultExpr.h:200
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
VT::ResultType VRT
Result type of the left-hand side sparse vector expression.
Definition: TSVecDMatMultExpr.h:111
Constraint on the transpose flag of vector types.
MT::ResultType MRT
Result type of the right-hand side dense matrix expression.
Definition: TSVecDMatMultExpr.h:112
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.