35 #ifndef _BLAZE_MATH_EXPRESSIONS_TDMATTSMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TDMATTSMATMULTEXPR_H_
104 template<
typename MT1
106 class TDMatTSMatMultExpr :
public DenseMatrix< TDMatTSMatMultExpr<MT1,MT2>, true >
107 ,
private MatMatMultExpr
108 ,
private Computation
136 template<
typename MT >
137 struct UseSMPAssign {
138 enum { value = ( evaluateLeft || evaluateRight ) };
148 template<
typename T1,
typename T2,
typename T3 >
149 struct UseVectorizedKernel {
150 enum { value = T1::vectorizable && T2::vectorizable &&
151 IsColumnMajorMatrix<T1>::value &&
152 IsSame<typename T1::ElementType,typename T2::ElementType>::value &&
153 IsSame<typename T1::ElementType,typename T3::ElementType>::value &&
154 IntrinsicTrait<typename T1::ElementType>::addition &&
155 IntrinsicTrait<typename T1::ElementType>::subtraction &&
156 IntrinsicTrait<typename T1::ElementType>::multiplication };
167 template<
typename T1,
typename T2,
typename T3 >
168 struct UseOptimizedKernel {
169 enum { value = !UseVectorizedKernel<T1,T2,T3>::value &&
170 !IsResizable<typename T1::ElementType>::value &&
171 !IsResizable<ET1>::value };
181 template<
typename T1,
typename T2,
typename T3 >
182 struct UseDefaultKernel {
183 enum { value = !UseVectorizedKernel<T1,T2,T3>::value &&
184 !UseOptimizedKernel<T1,T2,T3>::value };
215 enum { vectorizable = MT1::vectorizable &&
221 enum { smpAssignable = !evaluateLeft && MT1::smpAssignable &&
222 !evaluateRight && MT2::smpAssignable };
255 if(
lhs_.columns() == 0UL )
263 const ConstIterator end( B.end(j) );
264 ConstIterator element( B.begin(j) );
271 tmp =
lhs_(i,element->index()) * element->value();
273 for( ; element!=end; ++element )
274 tmp +=
lhs_(i,element->index()) * element->value();
280 for(
size_t k=1UL; k<
lhs_.columns(); ++k ) {
305 return rhs_.columns();
335 template<
typename T >
337 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
347 template<
typename T >
349 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
359 return lhs_.isAligned();
392 template<
typename MT
411 TDMatTSMatMultExpr::selectAssignKernel( ~lhs, A, B );
430 template<
typename MT3
437 const size_t iend( A.rows() &
size_t(-4) );
440 for(
size_t i=0UL; i<iend; i+=4UL ) {
441 for(
size_t j=0UL; j<B.columns(); ++j )
443 ConstIterator element( B.begin(j) );
444 const ConstIterator end( B.end(j) );
446 if( element == end ) {
448 reset( (~C)(i+1UL,j) );
449 reset( (~C)(i+2UL,j) );
450 reset( (~C)(i+3UL,j) );
454 (~C)(i ,j) = A(i ,element->index()) * element->value();
455 (~C)(i+1UL,j) = A(i+1UL,element->index()) * element->value();
456 (~C)(i+2UL,j) = A(i+2UL,element->index()) * element->value();
457 (~C)(i+3UL,j) = A(i+3UL,element->index()) * element->value();
459 for( ; element!=end; ++element ) {
460 (~C)(i ,j) += A(i ,element->index()) * element->value();
461 (~C)(i+1UL,j) += A(i+1UL,element->index()) * element->value();
462 (~C)(i+2UL,j) += A(i+2UL,element->index()) * element->value();
463 (~C)(i+3UL,j) += A(i+3UL,element->index()) * element->value();
468 for(
size_t i=iend; i<A.rows(); ++i ) {
469 for(
size_t j=0UL; j<B.columns(); ++j )
471 ConstIterator element( B.begin(j) );
472 const ConstIterator end( B.end(j) );
474 if( element == end ) {
479 (~C)(i,j) = A(i,element->index()) * element->value();
481 for( ; element!=end; ++element )
482 (~C)(i,j) += A(i,element->index()) * element->value();
503 template<
typename MT3
506 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
507 selectAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
511 for(
size_t j=0UL; j<B.columns(); ++j ) {
512 for(
size_t i=0UL; i<(~C).
rows(); ++i ) {
515 ConstIterator element( B.begin(j) );
516 const ConstIterator end( B.end(j) );
517 for( ; element!=end; ++element ) {
518 for(
size_t i=0UL; i<A.rows(); ++i ) {
520 (~C)(i,j) = A(i,element->index()) * element->value();
522 (~C)(i,j) += A(i,element->index()) * element->value();
544 template<
typename MT3
547 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
548 selectAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
552 const size_t iend( A.rows() & size_t(-4) );
557 for(
size_t j=0UL; j<B.columns(); ++j )
559 const ConstIterator end( B.end(j) );
560 ConstIterator element( B.begin(j) );
562 const size_t kend( B.nonZeros(j) & size_t(-4) );
564 for(
size_t k=0UL; k<kend; k+=4UL ) {
565 const size_t j1( element->index() );
566 const ET2 v1( element->value() );
568 const size_t j2( element->index() );
569 const ET2 v2( element->value() );
571 const size_t j3( element->index() );
572 const ET2 v3( element->value() );
574 const size_t j4( element->index() );
575 const ET2 v4( element->value() );
578 for(
size_t i=0UL; i<iend; i+=4UL ) {
579 (~C)(i ,j) += A(i ,j1) * v1 + A(i ,j2) * v2 + A(i ,j3) * v3 + A(i ,j4) * v4;
580 (~C)(i+1UL,j) += A(i+1UL,j1) * v1 + A(i+1UL,j2) * v2 + A(i+1UL,j3) * v3 + A(i+1UL,j4) * v4;
581 (~C)(i+2UL,j) += A(i+2UL,j1) * v1 + A(i+2UL,j2) * v2 + A(i+2UL,j3) * v3 + A(i+2UL,j4) * v4;
582 (~C)(i+3UL,j) += A(i+3UL,j1) * v1 + A(i+3UL,j2) * v2 + A(i+3UL,j3) * v3 + A(i+3UL,j4) * v4;
584 for(
size_t i=iend; i<A.rows(); ++i ) {
585 (~C)(i,j) += A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
589 for( ; element!=end; ++element ) {
590 for(
size_t i=0UL; i<iend; i+=4UL ) {
591 (~C)(i ,j) += A(i ,element->index()) * element->value();
592 (~C)(i+1UL,j) += A(i+1UL,element->index()) * element->value();
593 (~C)(i+2UL,j) += A(i+2UL,element->index()) * element->value();
594 (~C)(i+3UL,j) += A(i+3UL,element->index()) * element->value();
596 for(
size_t i=iend; i<A.rows(); ++i ) {
597 (~C)(i,j) += A(i,element->index()) * element->value();
619 template<
typename MT3
622 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
623 selectAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
625 typedef IntrinsicTrait<ElementType> IT;
628 const size_t M( A.rows() );
632 for(
size_t j=0UL; j<B.columns(); ++j )
634 const ConstIterator end( B.end(j) );
635 ConstIterator element( B.begin(j) );
637 const size_t kend( B.nonZeros(j) & size_t(-4) );
639 for(
size_t k=0UL; k<kend; k+=4UL ) {
640 const size_t j1( element->index() );
643 const size_t j2( element->index() );
646 const size_t j3( element->index() );
649 const size_t j4( element->index() );
653 for(
size_t i=0UL; i<M; i+=IT::size ) {
654 (~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 );
658 for( ; element!=end; ++element ) {
659 const size_t j1( element->index() );
662 for(
size_t i=0UL; i<M; i+=IT::size ) {
663 (~C).
store( i, j, (~C).load(i,j) + A.load(i,j1) * v1 );
684 template<
typename MT
690 typedef typename SelectType< SO, ResultType, OppositeType >::Type TmpType;
702 const TmpType tmp(
serial( rhs ) );
721 template<
typename MT
740 TDMatTSMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
759 template<
typename MT3
762 static inline void selectAddAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
766 const size_t iend( A.rows() & size_t(-4) );
769 for(
size_t i=0UL; i<iend; i+=4UL ) {
770 for(
size_t j=0UL; j<B.columns(); ++j )
772 ConstIterator element( B.begin(j) );
773 const ConstIterator end( B.end(j) );
775 for( ; element!=end; ++element ) {
776 (~C)(i ,j) += A(i ,element->index()) * element->value();
777 (~C)(i+1UL,j) += A(i+1UL,element->index()) * element->value();
778 (~C)(i+2UL,j) += A(i+2UL,element->index()) * element->value();
779 (~C)(i+3UL,j) += A(i+3UL,element->index()) * element->value();
784 for(
size_t i=iend; i<A.rows(); ++i ) {
785 for(
size_t j=0UL; j<B.columns(); ++j )
787 ConstIterator element( B.begin(j) );
788 const ConstIterator end( B.end(j) );
790 for( ; element!=end; ++element )
791 (~C)(i,j) += A(i,element->index()) * element->value();
812 template<
typename MT3
815 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
816 selectAddAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
820 for(
size_t j=0UL; j<B.columns(); ++j ) {
821 ConstIterator element( B.begin(j) );
822 const ConstIterator end( B.end(j) );
823 for( ; element!=end; ++element ) {
824 for(
size_t i=0UL; i<A.rows(); ++i ) {
826 (~C)(i,j) = A(i,element->index()) * element->value();
828 (~C)(i,j) += A(i,element->index()) * element->value();
850 template<
typename MT3
853 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
854 selectAddAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
858 const size_t iend( A.rows() & size_t(-4) );
861 for(
size_t j=0UL; j<B.columns(); ++j )
863 const ConstIterator end( B.end(j) );
864 ConstIterator element( B.begin(j) );
866 const size_t kend( B.nonZeros(j) & size_t(-4) );
868 for(
size_t k=0UL; k<kend; k+=4UL ) {
869 const size_t j1( element->index() );
870 const ET2 v1( element->value() );
872 const size_t j2( element->index() );
873 const ET2 v2( element->value() );
875 const size_t j3( element->index() );
876 const ET2 v3( element->value() );
878 const size_t j4( element->index() );
879 const ET2 v4( element->value() );
882 for(
size_t i=0UL; i<iend; i+=4UL ) {
883 (~C)(i ,j) += A(i ,j1) * v1 + A(i ,j2) * v2 + A(i ,j3) * v3 + A(i ,j4) * v4;
884 (~C)(i+1UL,j) += A(i+1UL,j1) * v1 + A(i+1UL,j2) * v2 + A(i+1UL,j3) * v3 + A(i+1UL,j4) * v4;
885 (~C)(i+2UL,j) += A(i+2UL,j1) * v1 + A(i+2UL,j2) * v2 + A(i+2UL,j3) * v3 + A(i+2UL,j4) * v4;
886 (~C)(i+3UL,j) += A(i+3UL,j1) * v1 + A(i+3UL,j2) * v2 + A(i+3UL,j3) * v3 + A(i+3UL,j4) * v4;
888 for(
size_t i=iend; i<A.rows(); ++i ) {
889 (~C)(i,j) += A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
893 for( ; element!=end; ++element ) {
894 for(
size_t i=0UL; i<iend; i+=4UL ) {
895 (~C)(i ,j) += A(i ,element->index()) * element->value();
896 (~C)(i+1UL,j) += A(i+1UL,element->index()) * element->value();
897 (~C)(i+2UL,j) += A(i+2UL,element->index()) * element->value();
898 (~C)(i+3UL,j) += A(i+3UL,element->index()) * element->value();
900 for(
size_t i=iend; i<A.rows(); ++i ) {
901 (~C)(i,j) += A(i,element->index()) * element->value();
923 template<
typename MT3
926 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
927 selectAddAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
929 typedef IntrinsicTrait<ElementType> IT;
932 const size_t M( A.rows() );
934 for(
size_t j=0UL; j<B.columns(); ++j )
936 const ConstIterator end( B.end(j) );
937 ConstIterator element( B.begin(j) );
939 const size_t kend( B.nonZeros(j) & size_t(-4) );
941 for(
size_t k=0UL; k<kend; k+=4UL ) {
942 const size_t j1( element->index() );
945 const size_t j2( element->index() );
948 const size_t j3( element->index() );
951 const size_t j4( element->index() );
955 for(
size_t i=0UL; i<M; i+=IT::size ) {
956 (~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 );
960 for( ; element!=end; ++element ) {
961 const size_t j1( element->index() );
964 for(
size_t i=0UL; i<M; i+=IT::size ) {
965 (~C).
store( i, j, (~C).load(i,j) + A.load(i,j1) * v1 );
990 template<
typename MT
1009 TDMatTSMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1028 template<
typename MT3
1031 static inline void selectSubAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
1035 const size_t iend( A.rows() & size_t(-4) );
1038 for(
size_t i=0UL; i<iend; i+=4UL ) {
1039 for(
size_t j=0UL; j<B.columns(); ++j )
1041 ConstIterator element( B.begin(j) );
1042 const ConstIterator end( B.end(j) );
1044 for( ; element!=end; ++element ) {
1045 (~C)(i ,j) -= A(i ,element->index()) * element->value();
1046 (~C)(i+1UL,j) -= A(i+1UL,element->index()) * element->value();
1047 (~C)(i+2UL,j) -= A(i+2UL,element->index()) * element->value();
1048 (~C)(i+3UL,j) -= A(i+3UL,element->index()) * element->value();
1053 for(
size_t i=iend; i<A.rows(); ++i ) {
1054 for(
size_t j=0UL; j<B.columns(); ++j )
1056 ConstIterator element( B.begin(j) );
1057 const ConstIterator end( B.end(j) );
1059 for( ; element!=end; ++element )
1060 (~C)(i,j) -= A(i,element->index()) * element->value();
1081 template<
typename MT3
1084 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
1085 selectSubAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
1089 for(
size_t j=0UL; j<B.columns(); ++j ) {
1090 ConstIterator element( B.begin(j) );
1091 const ConstIterator end( B.end(j) );
1092 for( ; element!=end; ++element ) {
1093 for(
size_t i=0UL; i<A.rows(); ++i ) {
1095 (~C)(i,j) = -A(i,element->index()) * element->value();
1097 (~C)(i,j) -= A(i,element->index()) * element->value();
1119 template<
typename MT3
1122 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
1123 selectSubAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
1127 const size_t iend( A.rows() & size_t(-4) );
1130 for(
size_t j=0UL; j<B.columns(); ++j )
1132 const ConstIterator end( B.end(j) );
1133 ConstIterator element( B.begin(j) );
1135 const size_t kend( B.nonZeros(j) & size_t(-4) );
1137 for(
size_t k=0UL; k<kend; k+=4UL ) {
1138 const size_t j1( element->index() );
1139 const ET2 v1( element->value() );
1141 const size_t j2( element->index() );
1142 const ET2 v2( element->value() );
1144 const size_t j3( element->index() );
1145 const ET2 v3( element->value() );
1147 const size_t j4( element->index() );
1148 const ET2 v4( element->value() );
1151 for(
size_t i=0UL; i<iend; i+=4UL ) {
1152 (~C)(i ,j) -= A(i ,j1) * v1 + A(i ,j2) * v2 + A(i ,j3) * v3 + A(i ,j4) * v4;
1153 (~C)(i+1UL,j) -= A(i+1UL,j1) * v1 + A(i+1UL,j2) * v2 + A(i+1UL,j3) * v3 + A(i+1UL,j4) * v4;
1154 (~C)(i+2UL,j) -= A(i+2UL,j1) * v1 + A(i+2UL,j2) * v2 + A(i+2UL,j3) * v3 + A(i+2UL,j4) * v4;
1155 (~C)(i+3UL,j) -= A(i+3UL,j1) * v1 + A(i+3UL,j2) * v2 + A(i+3UL,j3) * v3 + A(i+3UL,j4) * v4;
1157 for(
size_t i=iend; i<A.rows(); ++i ) {
1158 (~C)(i,j) -= A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
1162 for( ; element!=end; ++element ) {
1163 for(
size_t i=0UL; i<iend; i+=4UL ) {
1164 (~C)(i ,j) -= A(i ,element->index()) * element->value();
1165 (~C)(i+1UL,j) -= A(i+1UL,element->index()) * element->value();
1166 (~C)(i+2UL,j) -= A(i+2UL,element->index()) * element->value();
1167 (~C)(i+3UL,j) -= A(i+3UL,element->index()) * element->value();
1169 for(
size_t i=iend; i<A.rows(); ++i ) {
1170 (~C)(i,j) -= A(i,element->index()) * element->value();
1192 template<
typename MT3
1195 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
1196 selectSubAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
1198 typedef IntrinsicTrait<ElementType> IT;
1201 const size_t M( A.rows() );
1203 for(
size_t j=0UL; j<B.columns(); ++j )
1205 const ConstIterator end( B.end(j) );
1206 ConstIterator element( B.begin(j) );
1208 const size_t kend( B.nonZeros(j) & size_t(-4) );
1210 for(
size_t k=0UL; k<kend; k+=4UL ) {
1211 const size_t j1( element->index() );
1214 const size_t j2( element->index() );
1217 const size_t j3( element->index() );
1220 const size_t j4( element->index() );
1224 for(
size_t i=0UL; i<M; i+=IT::size ) {
1225 (~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 );
1229 for( ; element!=end; ++element ) {
1230 const size_t j1( element->index() );
1233 for(
size_t i=0UL; i<M; i+=IT::size ) {
1234 (~C).
store( i, j, (~C).load(i,j) - A.load(i,j1) * v1 );
1269 template<
typename MT
1271 friend inline typename EnableIf< UseSMPAssign<MT> >::Type
1309 template<
typename MT
1311 friend inline typename EnableIf< UseSMPAssign<MT> >::Type
1316 typedef typename SelectType< SO, ResultType, OppositeType >::Type TmpType;
1328 const TmpType tmp( rhs );
1349 template<
typename MT
1351 friend inline typename EnableIf< UseSMPAssign<MT> >::Type
1393 template<
typename MT
1395 friend inline typename EnableIf< UseSMPAssign<MT> >::Type
1479 template<
typename T1
1481 inline const TDMatTSMatMultExpr<T1,T2>
1487 throw std::invalid_argument(
"Matrix sizes do not match" );
1504 template<
typename MT1,
typename MT2,
typename VT >
1509 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1510 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1511 IsDenseVector<VT>::value && IsColumnVector<VT>::value
1512 ,
typename TDMatDVecMultExprTrait< MT1, typename TSMatDVecMultExprTrait<MT2,VT>::Type >::Type
1513 , INVALID_TYPE >::Type Type;
1522 template<
typename MT1,
typename MT2,
typename VT >
1527 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1528 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1529 IsSparseVector<VT>::value && IsColumnVector<VT>::value
1530 ,
typename TDMatDVecMultExprTrait< MT1, typename TSMatDVecMultExprTrait<MT2,VT>::Type >::Type
1531 , INVALID_TYPE >::Type Type;
1540 template<
typename VT,
typename MT1,
typename MT2 >
1545 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1546 IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1547 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value
1548 ,
typename TDVecTSMatMultExprTrait< typename TDVecTDMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1549 , INVALID_TYPE >::Type Type;
1558 template<
typename VT,
typename MT1,
typename MT2 >
1563 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1564 IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1565 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value
1566 ,
typename TDVecTSMatMultExprTrait< typename TSVecTDMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1567 , INVALID_TYPE >::Type Type;
1576 template<
typename MT1,
typename MT2,
bool AF >
1581 typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT1,AF>::Type
1582 ,
typename SubmatrixExprTrait<const MT2,AF>::Type >::Type Type;
1591 template<
typename MT1,
typename MT2 >
1596 typedef typename MultExprTrait< typename RowExprTrait<const MT1>::Type, MT2 >::Type Type;
1605 template<
typename MT1,
typename MT2 >
1610 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:114
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:4599
EnableIf< IsIntegral< T > >::Type store(T *address, const typename Store< T, sizeof(T)>::Type &value)
Aligned store of a vector of integral values.
Definition: Store.h:223
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:4329
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:152
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:132
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:4642
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:199
#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:198
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2408
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:251
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:690
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:201
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:107
size_t rows() const
Returns the current number of rows of the matrix.
Definition: TDMatTSMatMultExpr.h:294
Constraint on the data type.
TDMatTSMatMultExpr(const MT1 &lhs, const MT2 &rhs)
Constructor for the TDMatTSMatMultExpr class.
Definition: TDMatTSMatMultExpr.h:231
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:122
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const size_t SMP_TDMATTSMATMULT_THRESHOLD
SMP column-major dense matrix/column-major sparse matrix multiplication threshold.This threshold specifies when a column-major dense matrix/column-major sparse matrix multiplication can be executed in parallel. 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:995
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: TDMatTSMatMultExpr.h:196
MT2::CompositeType CT2
Composite type of the right-hand side sparse matrix expression.
Definition: TDMatTSMatMultExpr.h:117
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
MT1::CompositeType CT1
Composite type of the left-hand side dense matrix expression.
Definition: TDMatTSMatMultExpr.h:116
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:2412
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: TDMatTSMatMultExpr.h:246
Header file for the TDMatSVecMultExprTrait class template.
Header file for the TDVecTSMatMultExprTrait class template.
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:368
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:271
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: TDMatTSMatMultExpr.h:358
LeftOperand leftOperand() const
Returns the left-hand side transpose dense matrix operand.
Definition: TDMatTSMatMultExpr.h:314
#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:324
Constraints on the storage order of matrix types.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2406
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:195
Header file for the EnableIf class template.
Header file for the serial shim.
LeftOperand lhs_
Left-hand side dense matrix of the multiplication expression.
Definition: TDMatTSMatMultExpr.h:375
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:92
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:197
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:301
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: TDMatTSMatMultExpr.h:194
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:331
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:336
MT1::ResultType RT1
Result type of the left-hand side dense matrix expression.
Definition: TDMatTSMatMultExpr.h:112
RT2::ElementType ET2
Element type of the right-hand side sparse matrix expression.
Definition: TDMatTSMatMultExpr.h:115
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: TDMatTSMatMultExpr.h:193
Header file for the RemoveReference type trait.
#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:210
TDMatTSMatMultExpr< MT1, MT2 > This
Type of this TDMatTSMatMultExpr instance.
Definition: TDMatTSMatMultExpr.h:191
MT2::ResultType RT2
Result type of the right-hand side sparse matrix expression.
Definition: TDMatTSMatMultExpr.h:113
SelectType< evaluateLeft, const RT1, CT1 >::Type LT
Type for the assignment of the left-hand side dense matrix operand.
Definition: TDMatTSMatMultExpr.h:207
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:348
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2403
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:204
RightOperand rhs_
Right-hand side sparse matrix of the multiplication expression.
Definition: TDMatTSMatMultExpr.h:376
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.
#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
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:192
size_t columns() const
Returns the current number of columns of the matrix.
Definition: TDMatTSMatMultExpr.h:304