35 #ifndef _BLAZE_MATH_EXPRESSIONS_TDMATSVECMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TDMATSVECMULTEXPR_H_
103 template<
typename MT
105 class TDMatSVecMultExpr :
public DenseVector< TDMatSVecMultExpr<MT,VT>, false >
106 ,
private MatVecMultExpr
107 ,
private Computation
136 template<
typename T1 >
137 struct UseSMPAssign {
138 enum { value = ( evaluateMatrix || evaluateVector ) };
149 template<
typename T1,
typename T2,
typename T3 >
150 struct UseVectorizedKernel {
153 T1::vectorizable && T2::vectorizable &&
168 template<
typename T1,
typename T2,
typename T3 >
169 struct UseOptimizedKernel {
170 enum { value = !UseVectorizedKernel<T1,T2,T3>::value &&
183 template<
typename T1,
typename T2,
typename T3 >
184 struct UseDefaultKernel {
185 enum { value = !UseVectorizedKernel<T1,T2,T3>::value &&
186 !UseOptimizedKernel<T1,T2,T3>::value };
223 enum { smpAssignable = !evaluateMatrix && MT::smpAssignable &&
224 !evaluateVector && VT::smpAssignable };
265 if( element != end ) {
266 res =
mat_( index, element->index() ) * element->value();
268 for( ; element!=x.end(); ++element ) {
269 res +=
mat_( index, element->index() ) * element->value();
284 inline ReturnType
at(
size_t index )
const {
285 if( index >=
mat_.rows() ) {
288 return (*
this)[index];
328 template<
typename T >
330 return mat_.isAliased( alias ) ||
vec_.isAliased( alias );
340 template<
typename T >
342 return mat_.isAliased( alias ) ||
vec_.isAliased( alias );
352 return mat_.isAligned();
362 return (
size() > SMP_TDMATSVECMULT_THRESHOLD );
385 template<
typename VT1 >
393 RT x(
serial( rhs.vec_ ) );
394 if( x.nonZeros() == 0UL ) {
400 LT A(
serial( rhs.mat_ ) );
409 TDMatSVecMultExpr::selectAssignKernel( ~lhs, A, x );
428 template<
typename VT1
432 selectAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
438 const size_t M( A.rows() );
440 ConstIterator element( x.begin() );
441 const ConstIterator
end( x.end() );
447 for(
size_t i=0UL; i<iend; ++i )
451 for( ; element!=
end; ++element )
453 const size_t index( element->index() );
455 if( IsDiagonal<MT1>::value )
457 for(
size_t i=last; i<index; ++i )
460 y[index] = A(index,index) * element->value();
465 const size_t ibegin( ( IsLower<MT1>::value )
466 ?( IsStrictlyLower<MT1>::value ? index+1UL : index )
468 const size_t iend( ( IsUpper<MT1>::value )
469 ?( IsStrictlyUpper<MT1>::value ? index : index+1UL )
473 for(
size_t i=ibegin; i<last; ++i ) {
474 y[i] += A(i,index) * element->value();
476 for(
size_t i=last; i<iend; ++i ) {
477 y[i] = A(i,index) * element->value();
484 if( IsUpper<MT1>::value ) {
485 for(
size_t i=last; i<M; ++i )
506 template<
typename VT1
509 static inline typename EnableIf< UseOptimizedKernel<VT1,MT1,VT2> >::Type
510 selectAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
516 const size_t M( A.rows() );
518 ConstIterator element( x.begin() );
519 const ConstIterator
end( x.end() );
521 const size_t jpos( x.nonZeros() & size_t(-4) );
522 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == jpos,
"Invalid end calculation" );
526 const size_t j1( element->index() );
527 const VET v1( element->value() );
529 const size_t j2( element->index() );
530 const VET v2( element->value() );
532 const size_t j3( element->index() );
533 const VET v3( element->value() );
535 const size_t j4( element->index() );
536 const VET v4( element->value() );
541 for(
size_t i=0UL; i<M; ++i ) {
542 y[i] = A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
547 const size_t j1( element->index() );
548 const VET v1( element->value() );
551 for(
size_t i=0UL; i<M; ++i ) {
556 for(
size_t j=(jpos>3UL)?(4UL):(1UL); (j+4UL)<=jpos; j+=4UL )
558 const size_t j1( element->index() );
559 const VET v1( element->value() );
561 const size_t j2( element->index() );
562 const VET v2( element->value() );
564 const size_t j3( element->index() );
565 const VET v3( element->value() );
567 const size_t j4( element->index() );
568 const VET v4( element->value() );
573 const size_t ibegin( ( IsLower<MT1>::value )
574 ?( IsStrictlyLower<MT1>::value ? j1+1UL : j1 )
576 const size_t iend( ( IsUpper<MT1>::value )
577 ?( IsStrictlyUpper<MT1>::value ? j4 : j4+1UL )
581 for(
size_t i=ibegin; i<iend; ++i ) {
582 y[i] += A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
585 for( ; element!=
end; ++element )
587 const size_t j1( element->index() );
588 const VET v1( element->value() );
590 const size_t ibegin( ( IsLower<MT1>::value )
591 ?( IsStrictlyLower<MT1>::value ? j1+1UL : j1 )
593 const size_t iend( ( IsUpper<MT1>::value )
594 ?( IsStrictlyUpper<MT1>::value ? j1 : j1+1UL )
598 for(
size_t i=ibegin; i<iend; ++i ) {
599 y[i] += A(i,j1) * v1;
620 template<
typename VT1
623 static inline typename EnableIf< UseVectorizedKernel<VT1,MT1,VT2> >::Type
624 selectAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
626 typedef IntrinsicTrait<ElementType> IT;
631 const size_t M( A.rows() );
633 const bool remainder( !IsPadded<MT1>::value || !IsPadded<VT1>::value );
635 ConstIterator element( x.begin() );
636 const ConstIterator
end( x.end() );
638 const size_t jpos( x.nonZeros() & size_t(-4) );
639 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == jpos,
"Invalid end calculation" );
643 const size_t j1( element->index() );
644 const VET v1( element->value() );
646 const size_t j2( element->index() );
647 const VET v2( element->value() );
649 const size_t j3( element->index() );
650 const VET v3( element->value() );
652 const size_t j4( element->index() );
653 const VET v4( element->value() );
658 const IntrinsicType xmm1(
set( v1 ) );
659 const IntrinsicType xmm2(
set( v2 ) );
660 const IntrinsicType xmm3(
set( v3 ) );
661 const IntrinsicType xmm4(
set( v4 ) );
663 const size_t ipos( remainder ? ( M &
size_t(-
IT::size) ) : M );
669 y.store( i, A.load(i,j1) * xmm1 + A.load(i,j2) * xmm2 + A.load(i,j3) * xmm3 + A.load(i,j4) * xmm4 );
671 for( ; remainder && i<M; ++i ) {
672 y[i] = A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
677 const size_t j1( element->index() );
678 const VET v1( element->value() );
681 const IntrinsicType xmm1(
set( v1 ) );
683 const size_t ipos( remainder ? ( M &
size_t(-
IT::size) ) : M );
689 y.store( i, A.load(i,j1) * xmm1 );
691 for( ; remainder && i<M; ++i ) {
696 for(
size_t j=(jpos>3UL)?(4UL):(1UL); (j+4UL)<=jpos; j+=4UL )
698 const size_t j1( element->index() );
699 const VET v1( element->value() );
701 const size_t j2( element->index() );
702 const VET v2( element->value() );
704 const size_t j3( element->index() );
705 const VET v3( element->value() );
707 const size_t j4( element->index() );
708 const VET v4( element->value() );
713 const IntrinsicType xmm1(
set( v1 ) );
714 const IntrinsicType xmm2(
set( v2 ) );
715 const IntrinsicType xmm3(
set( v3 ) );
716 const IntrinsicType xmm4(
set( v4 ) );
718 const size_t ibegin( ( IsLower<MT1>::value )
719 ?( ( IsStrictlyLower<MT1>::value ? j1+1UL : j1 ) &
size_t(-
IT::size) )
721 const size_t iend( ( IsUpper<MT1>::value )
722 ?( IsStrictlyUpper<MT1>::value ? j4 : j4+1UL )
726 const size_t ipos( remainder ? ( iend &
size_t(-
IT::size) ) : iend );
732 y.store( i, y.load(i) + A.load(i,j1) * xmm1 + A.load(i,j2) * xmm2 + A.load(i,j3) * xmm3 + A.load(i,j4) * xmm4 );
734 for( ; remainder && i<iend; ++i ) {
735 y[i] += A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
739 for( ; element!=
end; ++element )
741 const size_t j1( element->index() );
742 const VET v1( element->value() );
744 const IntrinsicType xmm1(
set( v1 ) );
746 const size_t ibegin( ( IsLower<MT1>::value )
747 ?( ( IsStrictlyLower<MT1>::value ? j1+1UL : j1 ) &
size_t(-
IT::size) )
749 const size_t iend( ( IsUpper<MT1>::value )
750 ?( IsStrictlyUpper<MT1>::value ? j1 : j1+1UL )
754 const size_t ipos( remainder ? ( iend &
size_t(-
IT::size) ) : iend );
760 y.store( i, y.load(i) + A.load(i,j1) * xmm1 );
762 for( ; remainder && i<iend; ++i ) {
763 y[i] += A(i,j1) * v1;
783 template<
typename VT1 >
784 friend inline void assign( SparseVector<VT1,false>& lhs,
const TDMatSVecMultExpr& rhs )
794 const ResultType tmp(
serial( rhs ) );
813 template<
typename VT1 >
814 friend inline void addAssign( DenseVector<VT1,false>& lhs,
const TDMatSVecMultExpr& rhs )
823 RT x(
serial( rhs.vec_ ) );
824 if( x.nonZeros() == 0UL )
return;
827 LT A(
serial( rhs.mat_ ) );
836 TDMatSVecMultExpr::selectAddAssignKernel( ~lhs, A, x );
855 template<
typename VT1
858 static inline typename EnableIf< UseDefaultKernel<VT1,MT1,VT2> >::Type
859 selectAddAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
865 const size_t M( A.rows() );
867 ConstIterator element( x.begin() );
868 const ConstIterator
end( x.end() );
870 for( ; element!=
end; ++element )
872 const size_t index( element->index() );
874 if( IsDiagonal<MT1>::value )
876 y[index] += A(index,index) * element->value();
880 const size_t ibegin( ( IsLower<MT1>::value )
881 ?( IsStrictlyLower<MT1>::value ? index+1UL : index )
883 const size_t iend( ( IsUpper<MT1>::value )
884 ?( IsStrictlyUpper<MT1>::value ? index : index+1UL )
888 for(
size_t i=ibegin; i<iend; ++i ) {
889 y[i] += A(i,index) * element->value();
911 template<
typename VT1
914 static inline typename EnableIf< UseOptimizedKernel<VT1,MT1,VT2> >::Type
915 selectAddAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
921 const size_t M( A.rows() );
923 ConstIterator element( x.begin() );
924 const ConstIterator
end( x.end() );
926 const size_t jpos( x.nonZeros() & size_t(-4) );
927 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == jpos,
"Invalid end calculation" );
929 for(
size_t j=0UL; (j+4UL)<=jpos; j+=4UL )
931 const size_t j1( element->index() );
932 const VET v1( element->value() );
934 const size_t j2( element->index() );
935 const VET v2( element->value() );
937 const size_t j3( element->index() );
938 const VET v3( element->value() );
940 const size_t j4( element->index() );
941 const VET v4( element->value() );
946 const size_t ibegin( ( IsLower<MT1>::value )
947 ?( IsStrictlyLower<MT1>::value ? j1+1UL : j1 )
949 const size_t iend( ( IsUpper<MT1>::value )
950 ?( IsStrictlyUpper<MT1>::value ? j4 : j4+1UL )
954 for(
size_t i=ibegin; i<iend; ++i ) {
955 y[i] += A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
958 for( ; element!=
end; ++element )
960 const size_t j1( element->index() );
961 const VET v1( element->value() );
963 const size_t ibegin( ( IsLower<MT1>::value )
964 ?( IsStrictlyLower<MT1>::value ? j1+1UL : j1 )
966 const size_t iend( ( IsUpper<MT1>::value )
967 ?( IsStrictlyUpper<MT1>::value ? j1 : j1+1UL )
971 for(
size_t i=ibegin; i<iend; ++i ) {
972 y[i] += A(i,j1) * v1;
993 template<
typename VT1
996 static inline typename EnableIf< UseVectorizedKernel<VT1,MT1,VT2> >::Type
997 selectAddAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
999 typedef IntrinsicTrait<ElementType> IT;
1004 const size_t M( A.rows() );
1006 const bool remainder( !IsPadded<MT1>::value || !IsPadded<VT1>::value );
1008 ConstIterator element( x.begin() );
1009 const ConstIterator
end( x.end() );
1011 const size_t jpos( x.nonZeros() & size_t(-4) );
1012 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == jpos,
"Invalid end calculation" );
1014 for(
size_t j=0UL; (j+4UL)<=jpos; j+=4UL )
1016 const size_t j1( element->index() );
1017 const VET v1( element->value() );
1019 const size_t j2( element->index() );
1020 const VET v2( element->value() );
1022 const size_t j3( element->index() );
1023 const VET v3( element->value() );
1025 const size_t j4( element->index() );
1026 const VET v4( element->value() );
1031 const IntrinsicType xmm1(
set( v1 ) );
1032 const IntrinsicType xmm2(
set( v2 ) );
1033 const IntrinsicType xmm3(
set( v3 ) );
1034 const IntrinsicType xmm4(
set( v4 ) );
1036 const size_t ibegin( ( IsLower<MT1>::value )
1037 ?( ( IsStrictlyLower<MT1>::value ? j1+1UL : j1 ) &
size_t(-
IT::size) )
1039 const size_t iend( ( IsUpper<MT1>::value )
1040 ?( IsStrictlyUpper<MT1>::value ? j4 : j4+1UL )
1044 const size_t ipos( remainder ? ( iend &
size_t(-
IT::size) ) : iend );
1050 y.store( i, y.load(i) + A.load(i,j1) * xmm1 + A.load(i,j2) * xmm2 + A.load(i,j3) * xmm3 + A.load(i,j4) * xmm4 );
1052 for( ; remainder && i<iend; ++i ) {
1053 y[i] += A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
1056 for( ; element!=
end; ++element )
1058 const size_t j1( element->index() );
1059 const VET v1( element->value() );
1061 const IntrinsicType xmm1(
set( v1 ) );
1063 const size_t ibegin( ( IsLower<MT1>::value )
1064 ?( ( IsStrictlyLower<MT1>::value ? j1+1UL : j1 ) &
size_t(-
IT::size) )
1066 const size_t iend( ( IsUpper<MT1>::value )
1067 ?( IsStrictlyUpper<MT1>::value ? j1 : j1+1UL )
1071 const size_t ipos( remainder ? ( iend &
size_t(-
IT::size) ) : iend );
1077 y.store( i, y.load(i) + A.load(i,j1) * xmm1 );
1079 for( ; remainder && i<iend; ++i ) {
1080 y[i] += A(i,j1) * v1;
1104 template<
typename VT1 >
1105 friend inline void subAssign( DenseVector<VT1,false>& lhs,
const TDMatSVecMultExpr& rhs )
1114 RT x(
serial( rhs.vec_ ) );
1115 if( x.nonZeros() == 0UL )
return;
1118 LT A(
serial( rhs.mat_ ) );
1127 TDMatSVecMultExpr::selectSubAssignKernel( ~lhs, A, x );
1146 template<
typename VT1
1149 static inline typename EnableIf< UseDefaultKernel<VT1,MT1,VT2> >::Type
1150 selectSubAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
1156 const size_t M( A.rows() );
1158 ConstIterator element( x.begin() );
1159 const ConstIterator
end( x.end() );
1161 for( ; element!=
end; ++element )
1163 const size_t index( element->index() );
1165 if( IsDiagonal<MT1>::value )
1167 y[index] -= A(index,index) * element->value();
1171 const size_t ibegin( ( IsLower<MT1>::value )
1172 ?( IsStrictlyLower<MT1>::value ? index+1UL : index )
1174 const size_t iend( ( IsUpper<MT1>::value )
1175 ?( IsStrictlyUpper<MT1>::value ? index : index+1UL )
1179 for(
size_t i=ibegin; i<iend; ++i ) {
1180 y[i] -= A(i,index) * element->value();
1202 template<
typename VT1
1205 static inline typename EnableIf< UseOptimizedKernel<VT1,MT1,VT2> >::Type
1206 selectSubAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
1212 const size_t M( A.rows() );
1214 ConstIterator element( x.begin() );
1215 const ConstIterator
end( x.end() );
1217 const size_t jpos( x.nonZeros() & size_t(-4) );
1218 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == jpos,
"Invalid end calculation" );
1220 for(
size_t j=0UL; (j+4UL)<=jpos; j+=4UL )
1222 const size_t j1( element->index() );
1223 const VET v1( element->value() );
1225 const size_t j2( element->index() );
1226 const VET v2( element->value() );
1228 const size_t j3( element->index() );
1229 const VET v3( element->value() );
1231 const size_t j4( element->index() );
1232 const VET v4( element->value() );
1237 const size_t ibegin( ( IsLower<MT1>::value )
1238 ?( IsStrictlyLower<MT1>::value ? j1+1UL : j1 )
1240 const size_t iend( ( IsUpper<MT1>::value )
1241 ?( IsStrictlyUpper<MT1>::value ? j4 : j4+1UL )
1245 for(
size_t i=ibegin; i<iend; ++i ) {
1246 y[i] -= A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
1249 for( ; element!=
end; ++element )
1251 const size_t j1( element->index() );
1252 const VET v1( element->value() );
1254 const size_t ibegin( ( IsLower<MT1>::value )
1255 ?( IsStrictlyLower<MT1>::value ? j1+1UL : j1 )
1257 const size_t iend( ( IsUpper<MT1>::value )
1258 ?( IsStrictlyUpper<MT1>::value ? j1 : j1+1UL )
1262 for(
size_t i=ibegin; i<iend; ++i ) {
1263 y[i] -= A(i,j1) * v1;
1284 template<
typename VT1
1287 static inline typename EnableIf< UseVectorizedKernel<VT1,MT1,VT2> >::Type
1288 selectSubAssignKernel( VT1& y,
const MT1& A,
const VT2& x )
1290 typedef IntrinsicTrait<ElementType> IT;
1295 const size_t M( A.rows() );
1297 const bool remainder( !IsPadded<MT1>::value || !IsPadded<VT1>::value );
1299 ConstIterator element( x.begin() );
1300 const ConstIterator
end( x.end() );
1302 const size_t jpos( x.nonZeros() & size_t(-4) );
1303 BLAZE_INTERNAL_ASSERT( ( x.nonZeros() - ( x.nonZeros() % 4UL ) ) == jpos,
"Invalid end calculation" );
1305 for(
size_t j=0UL; (j+4UL)<=jpos; j+=4UL )
1307 const size_t j1( element->index() );
1308 const VET v1( element->value() );
1310 const size_t j2( element->index() );
1311 const VET v2( element->value() );
1313 const size_t j3( element->index() );
1314 const VET v3( element->value() );
1316 const size_t j4( element->index() );
1317 const VET v4( element->value() );
1322 const IntrinsicType xmm1(
set( v1 ) );
1323 const IntrinsicType xmm2(
set( v2 ) );
1324 const IntrinsicType xmm3(
set( v3 ) );
1325 const IntrinsicType xmm4(
set( v4 ) );
1327 const size_t ibegin( ( IsLower<MT1>::value )
1328 ?( ( IsStrictlyLower<MT1>::value ? j1+1UL : j1 ) &
size_t(-
IT::size) )
1330 const size_t iend( ( IsUpper<MT1>::value )
1331 ?( IsStrictlyUpper<MT1>::value ? j4 : j4+1UL )
1335 const size_t ipos( remainder ? ( iend &
size_t(-
IT::size) ) : iend );
1341 y.store( i, y.load(i) - A.load(i,j1) * xmm1 - A.load(i,j2) * xmm2 - A.load(i,j3) * xmm3 - A.load(i,j4) * xmm4 );
1343 for( ; remainder && i<iend; ++i ) {
1344 y[i] -= A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
1347 for( ; element!=
end; ++element )
1349 const size_t j1( element->index() );
1350 const VET v1( element->value() );
1352 const IntrinsicType xmm1(
set( v1 ) );
1354 const size_t ibegin( ( IsLower<MT1>::value )
1355 ?( ( IsStrictlyLower<MT1>::value ? j1+1UL : j1 ) &
size_t(-
IT::size) )
1357 const size_t iend( ( IsUpper<MT1>::value )
1358 ?( IsStrictlyUpper<MT1>::value ? j1 : j1+1UL )
1362 const size_t ipos( remainder ? ( iend &
size_t(-
IT::size) ) : iend );
1368 y.store( i, y.load(i) - A.load(i,j1) * xmm1 );
1370 for( ; remainder && i<iend; ++i ) {
1371 y[i] -= A(i,j1) * v1;
1395 template<
typename VT1 >
1396 friend inline void multAssign( DenseVector<VT1,false>& lhs,
const TDMatSVecMultExpr& rhs )
1406 const ResultType tmp(
serial( rhs ) );
1407 multAssign( ~lhs, tmp );
1431 template<
typename VT1 >
1432 friend inline typename EnableIf< UseSMPAssign<VT1> >::Type
1441 if( x.nonZeros() == 0UL ) {
1476 template<
typename VT1 >
1477 friend inline typename EnableIf< UseSMPAssign<VT1> >::Type
1488 const ResultType tmp( rhs );
1509 template<
typename VT1 >
1510 friend inline typename EnableIf< UseSMPAssign<VT1> >::Type
1521 if( x.nonZeros() == 0UL )
return;
1557 template<
typename VT1 >
1558 friend inline typename EnableIf< UseSMPAssign<VT1> >::Type
1569 if( x.nonZeros() == 0UL )
return;
1605 template<
typename VT1 >
1606 friend inline typename EnableIf< UseSMPAssign<VT1> >::Type
1617 const ResultType tmp( rhs );
1680 template<
typename T1
1682 inline const typename DisableIf< IsMatMatMultExpr<T1>, TDMatSVecMultExpr<T1,T2> >::Type
1706 template<
typename MT,
typename VT >
1723 template<
typename MT,
typename VT >
1724 struct IsAligned<
TDMatSVecMultExpr<MT,VT> > :
public IsTrue< IsAligned<MT>::value >
1740 template<
typename MT,
typename VT,
bool AF >
1745 typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type
1746 ,
typename SubvectorExprTrait<const VT,AF>::Type >::Type Type;
#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
RightOperand vec_
Right-hand side sparse vector of the multiplication expression.
Definition: TDMatSVecMultExpr.h:369
Header file for the Rows type trait.
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.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
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
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a column dense or sparse vector type...
Definition: ColumnVector.h:79
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.
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: TDMatSVecMultExpr.h:197
VT::CompositeType VCT
Composite type of the right-hand side sparse vector expression.
Definition: TDMatSVecMultExpr.h:116
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
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
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
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TDMatSVecMultExpr.h:198
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:90
Header file for the RequiresEvaluation type trait.
System settings for performance optimizations.
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: TDMatSVecMultExpr.h:202
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.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: TDMatSVecMultExpr.h:195
MT::ResultType MRT
Result type of the left-hand side dense matrix expression.
Definition: TDMatSVecMultExpr.h:111
Constraint on the transpose flag of vector types.
Constraint on the data type.
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
SelectType< evaluateVector, const VRT, typename VT::CompositeType >::Type RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: TDMatSVecMultExpr.h:211
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:261
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.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
VRT::ElementType VET
Element type of the right-hand side sparse vector expression.
Definition: TDMatSVecMultExpr.h:114
MultTrait< MRT, VRT >::Type ResultType
Result type for expression template evaluations.
Definition: TDMatSVecMultExpr.h:194
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
MT::CompositeType MCT
Composite type of the left-hand side dense matrix expression.
Definition: TDMatSVecMultExpr.h:115
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: ColumnMajorMatrix.h:79
LeftOperand leftOperand() const
Returns the left-hand side transpose dense matrix operand.
Definition: TDMatSVecMultExpr.h:307
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: TDMatSVecMultExpr.h:361
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
ResultType::ElementType ElementType
Resulting element type.
Definition: TDMatSVecMultExpr.h:196
Header file for the IsMatMatMultExpr type trait class.
LeftOperand mat_
Left-hand side dense matrix of the multiplication expression.
Definition: TDMatSVecMultExpr.h:368
#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
MRT::ElementType MET
Element type of the left-hand side dense matrix expression.
Definition: TDMatSVecMultExpr.h:113
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< evaluateMatrix, const MRT, MCT >::Type LT
Type for the assignment of the left-hand side dense matrix operand.
Definition: TDMatSVecMultExpr.h:208
#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
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATVECMULTEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid matrix/vector ...
Definition: MatVecMultExpr.h:166
Constraint on the data type.
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type RightOperand
Composite type of the right-hand side dense vector expression.
Definition: TDMatSVecMultExpr.h:205
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.
VT::ResultType VRT
Result type of the right-hand side sparse vector expression.
Definition: TDMatSVecMultExpr.h:112
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Header file for the serial shim.
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: TDMatSVecMultExpr.h:329
Expression object for transpose dense matrix-sparse vector multiplications.The TDMatSVecMultExpr clas...
Definition: Forward.h:143
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:75
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the SubmatrixExprTrait class template.
RightOperand rightOperand() const
Returns the right-hand side sparse vector operand.
Definition: TDMatSVecMultExpr.h:317
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: TDMatSVecMultExpr.h:341
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
size_t size() const
Returns the current size/dimension of the vector.
Definition: TDMatSVecMultExpr.h:297
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
Base template for the MultTrait class.
Definition: MultTrait.h:138
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
const ResultType CompositeType
Data type for composite expression templates.
Definition: TDMatSVecMultExpr.h:199
Header file for the reset shim.
Compile time check for data types.This type trait tests whether or not the given template parameter i...
Definition: IsBlasCompatible.h:99
Constraints on the storage order of matrix types.
Header file for the RemoveReference type trait.
Header file for all intrinsic functionality.
TDMatSVecMultExpr(const MT &mat, const VT &vec)
Constructor for the TDMatSVecMultExpr class.
Definition: TDMatSVecMultExpr.h:233
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
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: TDMatSVecMultExpr.h:284
Header file for the IsComputation type trait class.
TDMatSVecMultExpr< MT, VT > This
Type of this TDMatSVecMultExpr instance.
Definition: TDMatSVecMultExpr.h:193
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
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
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:324
Header file for the SubvectorExprTrait class template.
Constraint on the data type.
Header file for the IsUpper type trait.
Header file for exception macros.
Header file for the MatVecMultExpr base class.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: TDMatSVecMultExpr.h:247
Header file for the IsResizable type trait.
EnableIf< IsDenseVector< VT1 > >::Type smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:189
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
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: TDMatSVecMultExpr.h:351