35 #ifndef _BLAZE_MATH_EXPRESSIONS_TDMATTSMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TDMATTSMATMULTEXPR_H_
106 template<
typename MT1
108 class TDMatTSMatMultExpr :
public DenseMatrix< TDMatTSMatMultExpr<MT1,MT2>, true >
109 ,
private MatMatMultExpr
110 ,
private Computation
137 template<
typename T1,
typename T2,
typename T3 >
138 struct UseSMPAssignKernel {
139 enum { value = evaluateLeft || evaluateRight };
149 template<
typename T1,
typename T2,
typename T3 >
150 struct UseVectorizedKernel {
151 enum { value = !UseSMPAssignKernel<T1,T2,T3>::value &&
152 T1::vectorizable && T2::vectorizable &&
153 IsColumnMajorMatrix<T1>::value &&
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>::subtraction &&
158 IntrinsicTrait<typename T1::ElementType>::multiplication };
169 template<
typename T1,
typename T2,
typename T3 >
170 struct UseOptimizedKernel {
171 enum { value = !UseSMPAssignKernel<T1,T2,T3>::value &&
172 !UseVectorizedKernel<T1,T2,T3>::value &&
173 !IsResizable<typename T1::ElementType>::value &&
174 !IsResizable<ET1>::value };
184 template<
typename T1,
typename T2,
typename T3 >
185 struct UseDefaultKernel {
186 enum { value = !UseSMPAssignKernel<T1,T2,T3>::value &&
187 !UseVectorizedKernel<T1,T2,T3>::value &&
188 !UseOptimizedKernel<T1,T2,T3>::value };
219 enum { vectorizable = MT1::vectorizable &&
225 enum { smpAssignable = !evaluateLeft && !evaluateRight };
258 if(
lhs_.columns() == 0UL )
266 const ConstIterator end( B.end(j) );
267 ConstIterator element( B.begin(j) );
274 tmp =
lhs_(i,element->index()) * element->value();
276 for( ; element!=end; ++element )
277 tmp +=
lhs_(i,element->index()) * element->value();
283 for(
size_t k=1UL; k<
lhs_.columns(); ++k ) {
308 return rhs_.columns();
338 template<
typename T >
340 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
350 template<
typename T >
352 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
362 return lhs_.isAligned();
395 template<
typename MT
414 TDMatTSMatMultExpr::selectAssignKernel( ~lhs, A, B );
433 template<
typename MT3
441 const size_t iend( A.rows() &
size_t(-4) );
444 for(
size_t i=0UL; i<iend; i+=4UL ) {
445 for(
size_t j=0UL; j<B.columns(); ++j )
447 ConstIterator element( B.begin(j) );
448 const ConstIterator end( B.end(j) );
450 if( element == end ) {
452 reset( (~C)(i+1UL,j) );
453 reset( (~C)(i+2UL,j) );
454 reset( (~C)(i+3UL,j) );
458 (~C)(i ,j) = A(i ,element->index()) * element->value();
459 (~C)(i+1UL,j) = A(i+1UL,element->index()) * element->value();
460 (~C)(i+2UL,j) = A(i+2UL,element->index()) * element->value();
461 (~C)(i+3UL,j) = A(i+3UL,element->index()) * element->value();
463 for( ; element!=end; ++element ) {
464 (~C)(i ,j) += A(i ,element->index()) * element->value();
465 (~C)(i+1UL,j) += A(i+1UL,element->index()) * element->value();
466 (~C)(i+2UL,j) += A(i+2UL,element->index()) * element->value();
467 (~C)(i+3UL,j) += A(i+3UL,element->index()) * element->value();
472 for(
size_t i=iend; i<A.rows(); ++i ) {
473 for(
size_t j=0UL; j<B.columns(); ++j )
475 ConstIterator element( B.begin(j) );
476 const ConstIterator end( B.end(j) );
478 if( element == end ) {
483 (~C)(i,j) = A(i,element->index()) * element->value();
485 for( ; element!=end; ++element )
486 (~C)(i,j) += A(i,element->index()) * element->value();
507 template<
typename MT3
510 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
511 selectAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
515 for(
size_t j=0UL; j<B.columns(); ++j ) {
516 for(
size_t i=0UL; i<(~C).
rows(); ++i ) {
519 ConstIterator element( B.begin(j) );
520 const ConstIterator end( B.end(j) );
521 for( ; element!=end; ++element ) {
522 for(
size_t i=0UL; i<A.rows(); ++i ) {
524 (~C)(i,j) = A(i,element->index()) * element->value();
526 (~C)(i,j) += A(i,element->index()) * element->value();
548 template<
typename MT3
551 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
552 selectAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
556 const size_t iend( A.rows() & size_t(-4) );
561 for(
size_t j=0UL; j<B.columns(); ++j )
563 const ConstIterator end( B.end(j) );
564 ConstIterator element( B.begin(j) );
566 const size_t kend( B.nonZeros(j) & size_t(-4) );
568 for(
size_t k=0UL; k<kend; k+=4UL ) {
569 const size_t j1( element->index() );
570 const ET2 v1( element->value() );
572 const size_t j2( element->index() );
573 const ET2 v2( element->value() );
575 const size_t j3( element->index() );
576 const ET2 v3( element->value() );
578 const size_t j4( element->index() );
579 const ET2 v4( element->value() );
582 for(
size_t i=0UL; i<iend; i+=4UL ) {
583 (~C)(i ,j) += A(i ,j1) * v1 + A(i ,j2) * v2 + A(i ,j3) * v3 + A(i ,j4) * v4;
584 (~C)(i+1UL,j) += A(i+1UL,j1) * v1 + A(i+1UL,j2) * v2 + A(i+1UL,j3) * v3 + A(i+1UL,j4) * v4;
585 (~C)(i+2UL,j) += A(i+2UL,j1) * v1 + A(i+2UL,j2) * v2 + A(i+2UL,j3) * v3 + A(i+2UL,j4) * v4;
586 (~C)(i+3UL,j) += A(i+3UL,j1) * v1 + A(i+3UL,j2) * v2 + A(i+3UL,j3) * v3 + A(i+3UL,j4) * v4;
588 for(
size_t i=iend; i<A.rows(); ++i ) {
589 (~C)(i,j) += A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
593 for( ; element!=end; ++element ) {
594 for(
size_t i=0UL; i<iend; i+=4UL ) {
595 (~C)(i ,j) += A(i ,element->index()) * element->value();
596 (~C)(i+1UL,j) += A(i+1UL,element->index()) * element->value();
597 (~C)(i+2UL,j) += A(i+2UL,element->index()) * element->value();
598 (~C)(i+3UL,j) += A(i+3UL,element->index()) * element->value();
600 for(
size_t i=iend; i<A.rows(); ++i ) {
601 (~C)(i,j) += A(i,element->index()) * element->value();
623 template<
typename MT3
626 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
627 selectAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
629 typedef IntrinsicTrait<ElementType> IT;
632 const size_t M( A.rows() );
636 for(
size_t j=0UL; j<B.columns(); ++j )
638 const ConstIterator end( B.end(j) );
639 ConstIterator element( B.begin(j) );
641 const size_t kend( B.nonZeros(j) & size_t(-4) );
643 for(
size_t k=0UL; k<kend; k+=4UL ) {
644 const size_t j1( element->index() );
647 const size_t j2( element->index() );
650 const size_t j3( element->index() );
653 const size_t j4( element->index() );
657 for(
size_t i=0UL; i<M; i+=IT::size ) {
658 (~C).
store( i, j, (~C).load(i,j) + A.load(i,j1) * v1 + A.load(i,j2) * v2 + A.load(i,j3) * v3 + A.load(i,j4) * v4 );
662 for( ; element!=end; ++element ) {
663 const size_t j1( element->index() );
666 for(
size_t i=0UL; i<M; i+=IT::size ) {
667 (~C).
store( i, j, (~C).load(i,j) + A.load(i,j1) * v1 );
689 template<
typename MT3
692 static inline typename EnableIf< UseSMPAssignKernel<MT3,MT4,MT5> >::Type
693 selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
712 template<
typename MT
718 typedef typename SelectType< SO, ResultType, OppositeType >::Type TmpType;
730 const TmpType tmp( rhs );
749 template<
typename MT
768 TDMatTSMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
787 template<
typename MT3
790 static inline typename DisableIf< UseSMPAssignKernel<MT3,MT4,MT5> >::Type
791 selectAddAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
795 const size_t iend( A.rows() & size_t(-4) );
798 for(
size_t i=0UL; i<iend; i+=4UL ) {
799 for(
size_t j=0UL; j<B.columns(); ++j )
801 ConstIterator element( B.begin(j) );
802 const ConstIterator end( B.end(j) );
804 for( ; element!=end; ++element ) {
805 (~C)(i ,j) += A(i ,element->index()) * element->value();
806 (~C)(i+1UL,j) += A(i+1UL,element->index()) * element->value();
807 (~C)(i+2UL,j) += A(i+2UL,element->index()) * element->value();
808 (~C)(i+3UL,j) += A(i+3UL,element->index()) * element->value();
813 for(
size_t i=iend; i<A.rows(); ++i ) {
814 for(
size_t j=0UL; j<B.columns(); ++j )
816 ConstIterator element( B.begin(j) );
817 const ConstIterator end( B.end(j) );
819 for( ; element!=end; ++element )
820 (~C)(i,j) += A(i,element->index()) * element->value();
841 template<
typename MT3
844 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
845 selectAddAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
849 for(
size_t j=0UL; j<B.columns(); ++j ) {
850 ConstIterator element( B.begin(j) );
851 const ConstIterator end( B.end(j) );
852 for( ; element!=end; ++element ) {
853 for(
size_t i=0UL; i<A.rows(); ++i ) {
855 (~C)(i,j) = A(i,element->index()) * element->value();
857 (~C)(i,j) += A(i,element->index()) * element->value();
879 template<
typename MT3
882 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
883 selectAddAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
887 const size_t iend( A.rows() & size_t(-4) );
890 for(
size_t j=0UL; j<B.columns(); ++j )
892 const ConstIterator end( B.end(j) );
893 ConstIterator element( B.begin(j) );
895 const size_t kend( B.nonZeros(j) & size_t(-4) );
897 for(
size_t k=0UL; k<kend; k+=4UL ) {
898 const size_t j1( element->index() );
899 const ET2 v1( element->value() );
901 const size_t j2( element->index() );
902 const ET2 v2( element->value() );
904 const size_t j3( element->index() );
905 const ET2 v3( element->value() );
907 const size_t j4( element->index() );
908 const ET2 v4( element->value() );
911 for(
size_t i=0UL; i<iend; i+=4UL ) {
912 (~C)(i ,j) += A(i ,j1) * v1 + A(i ,j2) * v2 + A(i ,j3) * v3 + A(i ,j4) * v4;
913 (~C)(i+1UL,j) += A(i+1UL,j1) * v1 + A(i+1UL,j2) * v2 + A(i+1UL,j3) * v3 + A(i+1UL,j4) * v4;
914 (~C)(i+2UL,j) += A(i+2UL,j1) * v1 + A(i+2UL,j2) * v2 + A(i+2UL,j3) * v3 + A(i+2UL,j4) * v4;
915 (~C)(i+3UL,j) += A(i+3UL,j1) * v1 + A(i+3UL,j2) * v2 + A(i+3UL,j3) * v3 + A(i+3UL,j4) * v4;
917 for(
size_t i=iend; i<A.rows(); ++i ) {
918 (~C)(i,j) += A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
922 for( ; element!=end; ++element ) {
923 for(
size_t i=0UL; i<iend; i+=4UL ) {
924 (~C)(i ,j) += A(i ,element->index()) * element->value();
925 (~C)(i+1UL,j) += A(i+1UL,element->index()) * element->value();
926 (~C)(i+2UL,j) += A(i+2UL,element->index()) * element->value();
927 (~C)(i+3UL,j) += A(i+3UL,element->index()) * element->value();
929 for(
size_t i=iend; i<A.rows(); ++i ) {
930 (~C)(i,j) += A(i,element->index()) * element->value();
952 template<
typename MT3
955 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
956 selectAddAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
958 typedef IntrinsicTrait<ElementType> IT;
961 const size_t M( A.rows() );
963 for(
size_t j=0UL; j<B.columns(); ++j )
965 const ConstIterator end( B.end(j) );
966 ConstIterator element( B.begin(j) );
968 const size_t kend( B.nonZeros(j) & size_t(-4) );
970 for(
size_t k=0UL; k<kend; k+=4UL ) {
971 const size_t j1( element->index() );
974 const size_t j2( element->index() );
977 const size_t j3( element->index() );
980 const size_t j4( element->index() );
984 for(
size_t i=0UL; i<M; i+=IT::size ) {
985 (~C).
store( i, j, (~C).load(i,j) + A.load(i,j1) * v1 + A.load(i,j2) * v2 + A.load(i,j3) * v3 + A.load(i,j4) * v4 );
989 for( ; element!=end; ++element ) {
990 const size_t j1( element->index() );
993 for(
size_t i=0UL; i<M; i+=IT::size ) {
994 (~C).
store( i, j, (~C).load(i,j) + A.load(i,j1) * v1 );
1016 template<
typename MT3
1019 static inline typename EnableIf< UseSMPAssignKernel<MT3,MT4,MT5> >::Type
1020 selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1044 template<
typename MT
1063 TDMatTSMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1082 template<
typename MT3
1085 static inline typename DisableIf< UseSMPAssignKernel<MT3,MT4,MT5> >::Type
1086 selectSubAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
1090 const size_t iend( A.rows() & size_t(-4) );
1093 for(
size_t i=0UL; i<iend; i+=4UL ) {
1094 for(
size_t j=0UL; j<B.columns(); ++j )
1096 ConstIterator element( B.begin(j) );
1097 const ConstIterator end( B.end(j) );
1099 for( ; element!=end; ++element ) {
1100 (~C)(i ,j) -= A(i ,element->index()) * element->value();
1101 (~C)(i+1UL,j) -= A(i+1UL,element->index()) * element->value();
1102 (~C)(i+2UL,j) -= A(i+2UL,element->index()) * element->value();
1103 (~C)(i+3UL,j) -= A(i+3UL,element->index()) * element->value();
1108 for(
size_t i=iend; i<A.rows(); ++i ) {
1109 for(
size_t j=0UL; j<B.columns(); ++j )
1111 ConstIterator element( B.begin(j) );
1112 const ConstIterator end( B.end(j) );
1114 for( ; element!=end; ++element )
1115 (~C)(i,j) -= A(i,element->index()) * element->value();
1136 template<
typename MT3
1139 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
1140 selectSubAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
1144 for(
size_t j=0UL; j<B.columns(); ++j ) {
1145 ConstIterator element( B.begin(j) );
1146 const ConstIterator end( B.end(j) );
1147 for( ; element!=end; ++element ) {
1148 for(
size_t i=0UL; i<A.rows(); ++i ) {
1150 (~C)(i,j) = -A(i,element->index()) * element->value();
1152 (~C)(i,j) -= A(i,element->index()) * element->value();
1174 template<
typename MT3
1177 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
1178 selectSubAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
1182 const size_t iend( A.rows() & size_t(-4) );
1185 for(
size_t j=0UL; j<B.columns(); ++j )
1187 const ConstIterator end( B.end(j) );
1188 ConstIterator element( B.begin(j) );
1190 const size_t kend( B.nonZeros(j) & size_t(-4) );
1192 for(
size_t k=0UL; k<kend; k+=4UL ) {
1193 const size_t j1( element->index() );
1194 const ET2 v1( element->value() );
1196 const size_t j2( element->index() );
1197 const ET2 v2( element->value() );
1199 const size_t j3( element->index() );
1200 const ET2 v3( element->value() );
1202 const size_t j4( element->index() );
1203 const ET2 v4( element->value() );
1206 for(
size_t i=0UL; i<iend; i+=4UL ) {
1207 (~C)(i ,j) -= A(i ,j1) * v1 + A(i ,j2) * v2 + A(i ,j3) * v3 + A(i ,j4) * v4;
1208 (~C)(i+1UL,j) -= A(i+1UL,j1) * v1 + A(i+1UL,j2) * v2 + A(i+1UL,j3) * v3 + A(i+1UL,j4) * v4;
1209 (~C)(i+2UL,j) -= A(i+2UL,j1) * v1 + A(i+2UL,j2) * v2 + A(i+2UL,j3) * v3 + A(i+2UL,j4) * v4;
1210 (~C)(i+3UL,j) -= A(i+3UL,j1) * v1 + A(i+3UL,j2) * v2 + A(i+3UL,j3) * v3 + A(i+3UL,j4) * v4;
1212 for(
size_t i=iend; i<A.rows(); ++i ) {
1213 (~C)(i,j) -= A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
1217 for( ; element!=end; ++element ) {
1218 for(
size_t i=0UL; i<iend; i+=4UL ) {
1219 (~C)(i ,j) -= A(i ,element->index()) * element->value();
1220 (~C)(i+1UL,j) -= A(i+1UL,element->index()) * element->value();
1221 (~C)(i+2UL,j) -= A(i+2UL,element->index()) * element->value();
1222 (~C)(i+3UL,j) -= A(i+3UL,element->index()) * element->value();
1224 for(
size_t i=iend; i<A.rows(); ++i ) {
1225 (~C)(i,j) -= A(i,element->index()) * element->value();
1247 template<
typename MT3
1250 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
1251 selectSubAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
1253 typedef IntrinsicTrait<ElementType> IT;
1256 const size_t M( A.rows() );
1258 for(
size_t j=0UL; j<B.columns(); ++j )
1260 const ConstIterator end( B.end(j) );
1261 ConstIterator element( B.begin(j) );
1263 const size_t kend( B.nonZeros(j) & size_t(-4) );
1265 for(
size_t k=0UL; k<kend; k+=4UL ) {
1266 const size_t j1( element->index() );
1269 const size_t j2( element->index() );
1272 const size_t j3( element->index() );
1275 const size_t j4( element->index() );
1279 for(
size_t i=0UL; i<M; i+=IT::size ) {
1280 (~C).
store( i, j, (~C).load(i,j) - A.load(i,j1) * v1 - A.load(i,j2) * v2 - A.load(i,j3) * v3 - A.load(i,j4) * v4 );
1284 for( ; element!=end; ++element ) {
1285 const size_t j1( element->index() );
1288 for(
size_t i=0UL; i<M; i+=IT::size ) {
1289 (~C).
store( i, j, (~C).load(i,j) - A.load(i,j1) * v1 );
1311 template<
typename MT3
1314 static inline typename EnableIf< UseSMPAssignKernel<MT3,MT4,MT5> >::Type
1315 selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1383 template<
typename T1
1385 inline const TDMatTSMatMultExpr<T1,T2>
1391 throw std::invalid_argument(
"Matrix sizes do not match" );
1408 template<
typename MT1,
typename MT2,
typename VT >
1409 struct TDMatDVecMultExprTrait< TDMatTSMatMultExpr<MT1,MT2>, VT >
1413 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1414 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1415 IsDenseVector<VT>::value && IsColumnVector<VT>::value
1416 ,
typename TDMatDVecMultExprTrait< MT1, typename TSMatDVecMultExprTrait<MT2,VT>::Type >::Type
1417 , INVALID_TYPE >::Type Type;
1426 template<
typename MT1,
typename MT2,
typename VT >
1427 struct TDMatSVecMultExprTrait< TDMatTSMatMultExpr<MT1,MT2>, VT >
1431 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1432 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1433 IsSparseVector<VT>::value && IsColumnVector<VT>::value
1434 ,
typename TDMatDVecMultExprTrait< MT1, typename TSMatDVecMultExprTrait<MT2,VT>::Type >::Type
1435 , INVALID_TYPE >::Type Type;
1444 template<
typename VT,
typename MT1,
typename MT2 >
1445 struct TDVecTDMatMultExprTrait< VT, TDMatTSMatMultExpr<MT1,MT2> >
1449 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1450 IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1451 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value
1452 ,
typename TDVecTSMatMultExprTrait< typename TDVecTDMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1453 , INVALID_TYPE >::Type Type;
1462 template<
typename VT,
typename MT1,
typename MT2 >
1463 struct TSVecTDMatMultExprTrait< VT, TDMatTSMatMultExpr<MT1,MT2> >
1467 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1468 IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1469 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value
1470 ,
typename TDVecTSMatMultExprTrait< typename TSVecTDMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1471 , INVALID_TYPE >::Type Type;
1480 template<
typename MT1,
typename MT2,
bool AF >
1481 struct SubmatrixExprTrait< TDMatTSMatMultExpr<MT1,MT2>, AF >
1485 typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT1,AF>::Type
1486 ,
typename SubmatrixExprTrait<const MT2,AF>::Type >::Type Type;
1495 template<
typename MT1,
typename MT2 >
1496 struct RowExprTrait< TDMatTSMatMultExpr<MT1,MT2> >
1500 typedef typename MultExprTrait< typename RowExprTrait<const MT1>::Type, MT2 >::Type Type;
1509 template<
typename MT1,
typename MT2 >
1510 struct ColumnExprTrait< TDMatTSMatMultExpr<MT1,MT2> >
1514 typedef typename MultExprTrait< MT1, typename ColumnExprTrait<const MT2>::Type >::Type Type;
RT1::ElementType ET1
Element type of the left-hand side dense matrix expression.
Definition: TDMatTSMatMultExpr.h:116
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
void reset(DynamicMatrix< Type, SO > &m)
Resetting the given dense matrix.
Definition: DynamicMatrix.h:4579
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:4075
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:151
Expression object for transpose dense matrix-transpose sparse matrix multiplications.The TDMatTSMatMultExpr class represents the compile time expression for multiplications between a column-major dense matrix and a column-major sparse matrix.
Definition: Forward.h:128
Header file for the IsSparseMatrix type trait.
bool isDefault(const DynamicMatrix< Type, SO > &m)
Returns whether the given dense matrix is in default state.
Definition: DynamicMatrix.h:4622
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:197
#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 ColumnExprTrait class template.
Header file for the IsColumnMajorMatrix type trait.
const ResultType CompositeType
Data type for composite expression templates.
Definition: TDMatTSMatMultExpr.h:202
Header file for the sparse matrix SMP implementation.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2384
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:249
Header file for the Computation base class.
Header file for the MatMatMultExpr 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
Header file for the RequiresEvaluation type trait.
SelectType< IsExpression< MT1 >::value, const MT1, const MT1 & >::Type LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: TDMatTSMatMultExpr.h:205
const size_t SMP_TDMATTSMATMULT_THRESHOLD
SMP column-major dense matrix/column-major sparse matrix multiplication threshold.This threshold represents the system-specific threshold for a parallel column-major dense matrix/column-major sparse matrix multiplication. In case the number of rows/columns of the target matrix is larger or equal to this threshold, the operation is executed in parallel. If the number of rows/columns is below this threshold the operation is executed single-threaded.
Definition: Thresholds.h:524
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:104
size_t rows() const
Returns the current number of rows of the matrix.
Definition: TDMatTSMatMultExpr.h:297
Constraint on the data type.
TDMatTSMatMultExpr(const MT1 &lhs, const MT2 &rhs)
Constructor for the TDMatTSMatMultExpr class.
Definition: TDMatTSMatMultExpr.h:234
Constraint on the data type.
Constraint on the data type.
Header file for the MultExprTrait class template.
void smpAddAssign(DenseMatrix< 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:121
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: TDMatTSMatMultExpr.h:200
MT2::CompositeType CT2
Composite type of the right-hand side sparse matrix expression.
Definition: TDMatTSMatMultExpr.h:119
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.
MT1::CompositeType CT1
Composite type of the left-hand side dense matrix expression.
Definition: TDMatTSMatMultExpr.h:118
Header file for the multiplication trait.
#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: StorageOrder.h:161
Header file for the TSVecTDMatMultExprTrait class template.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2388
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: TDMatTSMatMultExpr.h:249
Header file for the TDMatSVecMultExprTrait class template.
Header file for the TDVecTSMatMultExprTrait class template.
Header file for the dense matrix SMP implementation.
Header file for the DenseMatrix base class.
Header file for the TSMatDVecMultExprTrait class template.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: TDMatTSMatMultExpr.h:371
void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:179
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: TDMatTSMatMultExpr.h:361
LeftOperand leftOperand() const
Returns the left-hand side transpose dense matrix operand.
Definition: TDMatTSMatMultExpr.h:317
#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
RightOperand rightOperand() const
Returns the right-hand side transpose sparse matrix operand.
Definition: TDMatTSMatMultExpr.h:327
Constraints on the storage order of matrix types.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2382
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Header file for the IsDenseMatrix type trait.
ResultType::ElementType ElementType
Resulting element type.
Definition: TDMatTSMatMultExpr.h:199
Header file for the EnableIf class template.
LeftOperand lhs_
Left-hand side dense matrix of the multiplication expression.
Definition: TDMatTSMatMultExpr.h:378
void smpAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:91
Header file for the IsSparseVector type trait.
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: StorageOrder.h:81
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:748
Header file for run time assertion macros.
Utility type for generic codes.
Base template for the MultTrait class.
Definition: MultTrait.h:141
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TDMatTSMatMultExpr.h:201
void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:209
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: TDMatTSMatMultExpr.h:198
Header file for the reset shim.
void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:239
Header file for the isDefault shim.
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: TDMatTSMatMultExpr.h:339
MT1::ResultType RT1
Result type of the left-hand side dense matrix expression.
Definition: TDMatTSMatMultExpr.h:114
RT2::ElementType ET2
Element type of the right-hand side sparse matrix expression.
Definition: TDMatTSMatMultExpr.h:117
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: TDMatTSMatMultExpr.h:197
Header file for the RemoveReference type trait.
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.In case either of the two given data types T1 or T2 is not a matrix type ...
Definition: StorageOrder.h:283
Header file for the IsDenseVector type trait.
Header file for all intrinsic functionality.
SelectType< evaluateRight, const RT2, CT2 >::Type RT
Type for the assignment of the right-hand side sparse matrix operand.
Definition: TDMatTSMatMultExpr.h:214
TDMatTSMatMultExpr< MT1, MT2 > This
Type of this TDMatTSMatMultExpr instance.
Definition: TDMatTSMatMultExpr.h:195
MT2::ResultType RT2
Result type of the right-hand side sparse matrix expression.
Definition: TDMatTSMatMultExpr.h:115
SelectType< evaluateLeft, const RT1, CT1 >::Type LT
Type for the assignment of the left-hand side dense matrix operand.
Definition: TDMatTSMatMultExpr.h:211
Header file for the IsComputation type trait class.
Header file for the TDMatDVecMultExprTrait class template.
#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
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: TDMatTSMatMultExpr.h:351
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2379
size_t columns(const Matrix< MT, SO > &m)
Returns the current number of columns of the matrix.
Definition: Matrix.h:154
Header file for basic type definitions.
SelectType< IsExpression< MT2 >::value, const MT2, const MT2 & >::Type RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TDMatTSMatMultExpr.h:208
RightOperand rhs_
Right-hand side sparse matrix of the multiplication expression.
Definition: TDMatTSMatMultExpr.h:379
Header file for the IsColumnVector type trait.
Header file for the IsResizable type trait.
Size type of the Blaze library.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
size_t rows(const Matrix< MT, SO > &m)
Returns the current number of rows of the matrix.
Definition: Matrix.h:138
#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 TDVecTDMatMultExprTrait class template.
EnableIf< IsIntegral< T >, Set< T, sizeof(T)> >::Type::Type set(T value)
Sets all values in the vector to the given integral value.
Definition: Set.h:209
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:79
void store(float *address, const sse_float_t &value)
Aligned store of a vector of 'float' values.
Definition: Store.h:242
Header file for the IsExpression type trait class.
Header file for the TSMatSVecMultExprTrait class template.
Header file for the FunctionTrace class.
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: TDMatTSMatMultExpr.h:196
size_t columns() const
Returns the current number of columns of the matrix.
Definition: TDMatTSMatMultExpr.h:307