35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATDMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATDMATMULTEXPR_H_
104 template<
typename MT1
106 class SMatDMatMultExpr :
public DenseMatrix< SMatDMatMultExpr<MT1,MT2>, false >
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 && T3::vectorizable &&
151 IsRowMajorMatrix<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 = MT2::vectorizable &&
221 enum { smpAssignable = !evaluateLeft && MT1::smpAssignable &&
222 !evaluateRight && MT2::smpAssignable };
255 if(
lhs_.columns() == 0 )
263 const ConstIterator end( A.end(i) );
264 ConstIterator element( A.begin(i) );
271 tmp = element->value() *
rhs_(element->index(),j);
273 for( ; element!=end; ++element )
274 tmp += element->value() *
rhs_(element->index(),j);
280 for(
size_t k=1; 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 rhs_.isAligned();
391 template<
typename MT
410 SMatDMatMultExpr::selectAssignKernel( ~lhs, A, B );
429 template<
typename MT3
437 for(
size_t i=0UL; i<A.rows(); ++i )
439 const ConstIterator end( A.end(i) );
441 for(
size_t j=0UL; j<B.columns(); ++j )
443 ConstIterator element( A.begin(i) );
445 if( element != end ) {
446 (~C)(i,j) = element->value() * B(element->index(),j);
448 for( ; element!=end; ++element ) {
449 (~C)(i,j) += element->value() * B(element->index(),j);
475 template<
typename MT3
478 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
479 selectAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
483 const size_t jend( B.columns() & size_t(-4) );
488 for(
size_t i=0UL; i<A.rows(); ++i )
490 const ConstIterator end( A.end(i) );
491 ConstIterator element( A.begin(i) );
493 const size_t kend( A.nonZeros(i) & size_t(-4) );
495 for(
size_t k=0UL; k<kend; k+=4UL ) {
496 const size_t i1( element->index() );
497 const ET1 v1( element->value() );
499 const size_t i2( element->index() );
500 const ET1 v2( element->value() );
502 const size_t i3( element->index() );
503 const ET1 v3( element->value() );
505 const size_t i4( element->index() );
506 const ET1 v4( element->value() );
509 for(
size_t j=0UL; j<jend; j+=4UL ) {
510 (~C)(i,j ) += v1 * B(i1,j ) + v2 * B(i2,j ) + v3 * B(i3,j ) + v4 * B(i4,j );
511 (~C)(i,j+1UL) += v1 * B(i1,j+1UL) + v2 * B(i2,j+1UL) + v3 * B(i3,j+1UL) + v4 * B(i4,j+1UL);
512 (~C)(i,j+2UL) += v1 * B(i1,j+2UL) + v2 * B(i2,j+2UL) + v3 * B(i3,j+2UL) + v4 * B(i4,j+2UL);
513 (~C)(i,j+3UL) += v1 * B(i1,j+3UL) + v2 * B(i2,j+3UL) + v3 * B(i3,j+3UL) + v4 * B(i4,j+3UL);
515 for(
size_t j=jend; j<B.columns(); ++j ) {
516 (~C)(i,j) += v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
520 for( ; element!=end; ++element ) {
521 for(
size_t j=0UL; j<jend; j+=4UL ) {
522 (~C)(i,j ) += element->value() * B(element->index(),j );
523 (~C)(i,j+1UL) += element->value() * B(element->index(),j+1UL);
524 (~C)(i,j+2UL) += element->value() * B(element->index(),j+2UL);
525 (~C)(i,j+3UL) += element->value() * B(element->index(),j+3UL);
527 for(
size_t j=jend; j<B.columns(); ++j ) {
528 (~C)(i,j) += element->value() * B(element->index(),j);
550 template<
typename MT3
553 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
554 selectAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
556 typedef IntrinsicTrait<ElementType> IT;
559 const size_t N( B.columns() );
563 for(
size_t i=0UL; i<A.rows(); ++i )
565 const ConstIterator end( A.end(i) );
566 ConstIterator element( A.begin(i) );
568 const size_t kend( A.nonZeros(i) & size_t(-4) );
570 for(
size_t k=0UL; k<kend; k+=4UL ) {
571 const size_t i1( element->index() );
574 const size_t i2( element->index() );
577 const size_t i3( element->index() );
580 const size_t i4( element->index() );
584 for(
size_t j=0UL; j<N; j+=IT::size ) {
585 (~C).
store( i, j, (~C).load(i,j) + v1 * B.load(i1,j) + v2 * B.load(i2,j) + v3 * B.load(i3,j) + v4 * B.load(i4,j) );
589 for( ; element!=end; ++element ) {
590 const size_t i1( element->index() );
593 for(
size_t j=0UL; j<N; j+=IT::size ) {
594 (~C).
store( i, j, (~C).load(i,j) + v1 * B.load(i1,j) );
616 template<
typename MT3
619 static inline void selectAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
623 const size_t jend( B.columns() & size_t(-4) );
626 for(
size_t j=0UL; j<jend; j+=4UL ) {
627 for(
size_t i=0UL; i<A.rows(); ++i )
629 ConstIterator element( A.begin(i) );
630 const ConstIterator end( A.end(i) );
632 if( element == end ) {
634 reset( (~C)(i,j+1UL) );
635 reset( (~C)(i,j+2UL) );
636 reset( (~C)(i,j+3UL) );
640 (~C)(i,j ) = element->value() * B(element->index(),j );
641 (~C)(i,j+1UL) = element->value() * B(element->index(),j+1UL);
642 (~C)(i,j+2UL) = element->value() * B(element->index(),j+2UL);
643 (~C)(i,j+3UL) = element->value() * B(element->index(),j+3UL);
645 for( ; element!=end; ++element ) {
646 (~C)(i,j ) += element->value() * B(element->index(),j );
647 (~C)(i,j+1UL) += element->value() * B(element->index(),j+1UL);
648 (~C)(i,j+2UL) += element->value() * B(element->index(),j+2UL);
649 (~C)(i,j+3UL) += element->value() * B(element->index(),j+3UL);
654 for(
size_t j=jend; j<B.columns(); ++j ) {
655 for(
size_t i=0UL; i<A.rows(); ++i )
657 ConstIterator element( A.begin(i) );
658 const ConstIterator end( A.end(i) );
660 if( element == end ) {
665 (~C)(i,j) = element->value() * B(element->index(),j);
667 for( ; element!=end; ++element )
668 (~C)(i,j) += element->value() * B(element->index(),j);
687 template<
typename MT
693 typedef typename SelectType< SO, OppositeType, ResultType >::Type TmpType;
705 const TmpType tmp(
serial( rhs ) );
723 template<
typename MT
742 SMatDMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
761 template<
typename MT3
764 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
765 selectAddAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
769 for(
size_t i=0UL; i<A.rows(); ++i )
771 const ConstIterator end( A.end(i) );
773 for(
size_t j=0UL; j<B.columns(); ++j )
775 ConstIterator element( A.begin(i) );
777 for( ; element!=end; ++element ) {
778 (~C)(i,j) += element->value() * B(element->index(),j);
800 template<
typename MT3
803 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
804 selectAddAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
808 const size_t jend( B.columns() & size_t(-4) );
811 for(
size_t i=0UL; i<A.rows(); ++i )
813 const ConstIterator end( A.end(i) );
814 ConstIterator element( A.begin(i) );
816 const size_t kend( A.nonZeros(i) & size_t(-4) );
818 for(
size_t k=0UL; k<kend; k+=4UL ) {
819 const size_t i1( element->index() );
820 const ET1 v1( element->value() );
822 const size_t i2( element->index() );
823 const ET1 v2( element->value() );
825 const size_t i3( element->index() );
826 const ET1 v3( element->value() );
828 const size_t i4( element->index() );
829 const ET1 v4( element->value() );
832 for(
size_t j=0UL; j<jend; j+=4UL ) {
833 (~C)(i,j ) += v1 * B(i1,j ) + v2 * B(i2,j ) + v3 * B(i3,j ) + v4 * B(i4,j );
834 (~C)(i,j+1UL) += v1 * B(i1,j+1UL) + v2 * B(i2,j+1UL) + v3 * B(i3,j+1UL) + v4 * B(i4,j+1UL);
835 (~C)(i,j+2UL) += v1 * B(i1,j+2UL) + v2 * B(i2,j+2UL) + v3 * B(i3,j+2UL) + v4 * B(i4,j+2UL);
836 (~C)(i,j+3UL) += v1 * B(i1,j+3UL) + v2 * B(i2,j+3UL) + v3 * B(i3,j+3UL) + v4 * B(i4,j+3UL);
838 for(
size_t j=jend; j<B.columns(); ++j ) {
839 (~C)(i,j) += v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
843 for( ; element!=end; ++element ) {
844 for(
size_t j=0UL; j<jend; j+=4UL ) {
845 (~C)(i,j ) += element->value() * B(element->index(),j );
846 (~C)(i,j+1UL) += element->value() * B(element->index(),j+1UL);
847 (~C)(i,j+2UL) += element->value() * B(element->index(),j+2UL);
848 (~C)(i,j+3UL) += element->value() * B(element->index(),j+3UL);
850 for(
size_t j=jend; j<B.columns(); ++j ) {
851 (~C)(i,j) += element->value() * B(element->index(),j);
873 template<
typename MT3
876 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
877 selectAddAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
879 typedef IntrinsicTrait<ElementType> IT;
882 const size_t N( B.columns() );
884 for(
size_t i=0UL; i<A.rows(); ++i )
886 const ConstIterator end( A.end(i) );
887 ConstIterator element( A.begin(i) );
889 const size_t kend( A.nonZeros(i) & size_t(-4) );
891 for(
size_t k=0UL; k<kend; k+=4UL ) {
892 const size_t i1( element->index() );
895 const size_t i2( element->index() );
898 const size_t i3( element->index() );
901 const size_t i4( element->index() );
905 for(
size_t j=0UL; j<N; j+=IT::size ) {
906 (~C).
store( i, j, (~C).load(i,j) + v1 * B.load(i1,j) + v2 * B.load(i2,j) + v3 * B.load(i3,j) + v4 * B.load(i4,j) );
910 for( ; element!=end; ++element ) {
911 const size_t i1( element->index() );
914 for(
size_t j=0UL; j<N; j+=IT::size ) {
915 (~C).
store( i, j, (~C).load(i,j) + v1 * B.load(i1,j) );
937 template<
typename MT3
940 static inline void selectAddAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
944 const size_t jend( B.columns() & size_t(-4) );
947 for(
size_t j=0UL; j<jend; j+=4UL ) {
948 for(
size_t i=0UL; i<A.rows(); ++i )
950 ConstIterator element( A.begin(i) );
951 const ConstIterator end( A.end(i) );
953 for( ; element!=end; ++element ) {
954 (~C)(i,j ) += element->value() * B(element->index(),j );
955 (~C)(i,j+1UL) += element->value() * B(element->index(),j+1UL);
956 (~C)(i,j+2UL) += element->value() * B(element->index(),j+2UL);
957 (~C)(i,j+3UL) += element->value() * B(element->index(),j+3UL);
962 for(
size_t j=jend; j<B.columns(); ++j ) {
963 for(
size_t i=0UL; i<A.rows(); ++i )
965 ConstIterator element( A.begin(i) );
966 const ConstIterator end( A.end(i) );
968 for( ; element!=end; ++element )
969 (~C)(i,j) += element->value() * B(element->index(),j);
992 template<
typename MT
1011 SMatDMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1030 template<
typename MT3
1033 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
1034 selectSubAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
1038 for(
size_t i=0UL; i<A.rows(); ++i )
1040 const ConstIterator end( A.end(i) );
1042 for(
size_t j=0UL; j<B.columns(); ++j )
1044 ConstIterator element( A.begin(i) );
1046 for( ; element!=end; ++element ) {
1047 (~C)(i,j) -= element->value() * B(element->index(),j);
1069 template<
typename MT3
1072 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
1073 selectSubAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
1077 const size_t jend( B.columns() & size_t(-4) );
1078 BLAZE_INTERNAL_ASSERT( ( B.columns() - ( B.columns() % 4UL ) ) == jend,
"Invalid end calculation" );
1080 for(
size_t i=0UL; i<A.rows(); ++i )
1082 const ConstIterator end( A.end(i) );
1083 ConstIterator element( A.begin(i) );
1085 const size_t kend( A.nonZeros(i) & size_t(-4) );
1087 for(
size_t k=0UL; k<kend; k+=4UL ) {
1088 const size_t i1( element->index() );
1089 const ET1 v1( element->value() );
1091 const size_t i2( element->index() );
1092 const ET1 v2( element->value() );
1094 const size_t i3( element->index() );
1095 const ET1 v3( element->value() );
1097 const size_t i4( element->index() );
1098 const ET1 v4( element->value() );
1101 for(
size_t j=0UL; j<jend; j+=4UL ) {
1102 (~C)(i,j ) -= v1 * B(i1,j ) + v2 * B(i2,j ) + v3 * B(i3,j ) + v4 * B(i4,j );
1103 (~C)(i,j+1UL) -= v1 * B(i1,j+1UL) + v2 * B(i2,j+1UL) + v3 * B(i3,j+1UL) + v4 * B(i4,j+1UL);
1104 (~C)(i,j+2UL) -= v1 * B(i1,j+2UL) + v2 * B(i2,j+2UL) + v3 * B(i3,j+2UL) + v4 * B(i4,j+2UL);
1105 (~C)(i,j+3UL) -= v1 * B(i1,j+3UL) + v2 * B(i2,j+3UL) + v3 * B(i3,j+3UL) + v4 * B(i4,j+3UL);
1107 for(
size_t j=jend; j<B.columns(); ++j ) {
1108 (~C)(i,j) -= v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
1112 for( ; element!=end; ++element ) {
1113 for(
size_t j=0UL; j<jend; j+=4UL ) {
1114 (~C)(i,j ) -= element->value() * B(element->index(),j );
1115 (~C)(i,j+1UL) -= element->value() * B(element->index(),j+1UL);
1116 (~C)(i,j+2UL) -= element->value() * B(element->index(),j+2UL);
1117 (~C)(i,j+3UL) -= element->value() * B(element->index(),j+3UL);
1119 for(
size_t j=jend; j<B.columns(); ++j ) {
1120 (~C)(i,j) -= element->value() * B(element->index(),j);
1142 template<
typename MT3
1145 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
1146 selectSubAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
1148 typedef IntrinsicTrait<ElementType> IT;
1151 const size_t N( B.columns() );
1153 for(
size_t i=0UL; i<A.rows(); ++i )
1155 const ConstIterator end( A.end(i) );
1156 ConstIterator element( A.begin(i) );
1158 const size_t kend( A.nonZeros(i) & size_t(-4) );
1160 for(
size_t k=0UL; k<kend; k+=4UL ) {
1161 const size_t i1( element->index() );
1164 const size_t i2( element->index() );
1167 const size_t i3( element->index() );
1170 const size_t i4( element->index() );
1174 for(
size_t j=0UL; j<N; j+=IT::size ) {
1175 (~C).
store( i, j, (~C).load(i,j) - v1 * B.load(i1,j) - v2 * B.load(i2,j) - v3 * B.load(i3,j) - v4 * B.load(i4,j) );
1179 for( ; element!=end; ++element ) {
1180 const size_t i1( element->index() );
1183 for(
size_t j=0UL; j<N; j+=IT::size ) {
1184 (~C).
store( i, j, (~C).load(i,j) - v1 * B.load(i1,j) );
1206 template<
typename MT3
1209 static inline void selectSubAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
1213 const size_t jend( B.columns() & size_t(-4) );
1214 BLAZE_INTERNAL_ASSERT( ( B.columns() - ( B.columns() % 4UL ) ) == jend,
"Invalid end calculation" );
1216 for(
size_t j=0UL; j<jend; j+=4UL ) {
1217 for(
size_t i=0UL; i<A.rows(); ++i )
1219 ConstIterator element( A.begin(i) );
1220 const ConstIterator end( A.end(i) );
1222 for( ; element!=end; ++element ) {
1223 (~C)(i,j ) -= element->value() * B(element->index(),j );
1224 (~C)(i,j+1UL) -= element->value() * B(element->index(),j+1UL);
1225 (~C)(i,j+2UL) -= element->value() * B(element->index(),j+2UL);
1226 (~C)(i,j+3UL) -= element->value() * B(element->index(),j+3UL);
1231 for(
size_t j=jend; j<B.columns(); ++j ) {
1232 for(
size_t i=0UL; i<A.rows(); ++i )
1234 ConstIterator element( A.begin(i) );
1235 const ConstIterator end( A.end(i) );
1237 for( ; element!=end; ++element )
1238 (~C)(i,j) -= element->value() * B(element->index(),j);
1271 template<
typename MT
1273 friend inline typename EnableIf< UseSMPAssign<MT> >::Type
1310 template<
typename MT
1312 friend inline typename EnableIf< UseSMPAssign<MT> >::Type
1317 typedef typename SelectType< SO, OppositeType, ResultType >::Type TmpType;
1329 const TmpType tmp( rhs );
1350 template<
typename MT
1352 friend inline typename EnableIf< UseSMPAssign<MT> >::Type
1394 template<
typename MT
1396 friend inline typename EnableIf< UseSMPAssign<MT> >::Type
1480 template<
typename T1
1482 inline const SMatDMatMultExpr<T1,T2>
1488 throw std::invalid_argument(
"Matrix sizes do not match" );
1505 template<
typename MT1,
typename MT2,
typename VT >
1510 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1511 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1512 IsDenseVector<VT>::value && IsColumnVector<VT>::value
1513 ,
typename SMatDVecMultExprTrait< MT1, typename DMatDVecMultExprTrait<MT2,VT>::Type >::Type
1514 , INVALID_TYPE >::Type Type;
1523 template<
typename MT1,
typename MT2,
typename VT >
1528 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1529 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1530 IsSparseVector<VT>::value && IsColumnVector<VT>::value
1531 ,
typename SMatDVecMultExprTrait< MT1, typename DMatSVecMultExprTrait<MT2,VT>::Type >::Type
1532 , INVALID_TYPE >::Type Type;
1541 template<
typename VT,
typename MT1,
typename MT2 >
1546 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1547 IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1548 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value
1549 ,
typename TDVecDMatMultExprTrait< typename TDVecSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1550 , INVALID_TYPE >::Type Type;
1559 template<
typename VT,
typename MT1,
typename MT2 >
1564 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1565 IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1566 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value
1567 ,
typename TSVecDMatMultExprTrait< typename TSVecSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1568 , INVALID_TYPE >::Type Type;
1577 template<
typename MT1,
typename MT2,
bool AF >
1582 typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT1,AF>::Type
1583 ,
typename SubmatrixExprTrait<const MT2,AF>::Type >::Type Type;
1592 template<
typename MT1,
typename MT2 >
1597 typedef typename MultExprTrait< typename RowExprTrait<const MT1>::Type, MT2 >::Type Type;
1606 template<
typename MT1,
typename MT2 >
1611 typedef typename MultExprTrait< MT1, typename ColumnExprTrait<const MT2>::Type >::Type Type;
SelectType< IsExpression< MT1 >::value, const MT1, const MT1 & >::Type LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: SMatDMatMultExpr.h:201
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
Header file for the SMatDVecMultExprTrait class template.
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
LeftOperand leftOperand() const
Returns the left-hand side sparse matrix operand.
Definition: SMatDMatMultExpr.h:314
Header file for the IsSparseMatrix type trait.
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:199
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: SMatDMatMultExpr.h:368
#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 IsSame and IsStrictlySame type traits.
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
Header file for the TDVecSMatMultExprTrait class template.
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.
Expression object for sparse matrix-dense matrix multiplications.The SMatDMatMultExpr class represent...
Definition: Forward.h:89
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.
Header file for the TSVecSMatMultExprTrait class template.
const ElementType ReturnType
Return type for expression template evaluations.
Definition: SMatDMatMultExpr.h:197
SelectType< IsExpression< MT2 >::value, const MT2, const MT2 & >::Type RightOperand
Composite type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:204
const ResultType CompositeType
Data type for composite expression templates.
Definition: SMatDMatMultExpr.h:198
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
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
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SMatDMatMultExpr.h:348
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
RT1::ElementType ET1
Element type of the left-hand side sparse matrix expression.
Definition: SMatDMatMultExpr.h:114
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.
#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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2412
Header file for the DenseMatrix base class.
MT2::ResultType RT2
Result type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:113
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
Header file for the DMatDVecMultExprTrait class template.
RightOperand rightOperand() const
Returns the right-hand side dense matrix operand.
Definition: SMatDMatMultExpr.h:324
#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
Constraints on the storage order of matrix types.
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: SMatDMatMultExpr.h:192
SelectType< evaluateLeft, const RT1, CT1 >::Type LT
Type for the assignment of the left-hand side sparse matrix operand.
Definition: SMatDMatMultExpr.h:207
RightOperand rhs_
Right-hand side dense matrix of the multiplication expression.
Definition: SMatDMatMultExpr.h:376
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2406
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: SMatDMatMultExpr.h:358
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: SMatDMatMultExpr.h:196
Header file for the IsDenseMatrix type trait.
Header file for the EnableIf class template.
const size_t SMP_SMATDMATMULT_THRESHOLD
SMP row-major sparse matrix/row-major dense matrix multiplication threshold.This threshold specifies ...
Definition: Thresholds.h:1018
Header file for the serial shim.
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatDMatMultExpr.h:195
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
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatDMatMultExpr.h:193
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
LeftOperand lhs_
Left-hand side sparse matrix of the multiplication expression.
Definition: SMatDMatMultExpr.h:375
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
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SMatDMatMultExpr.h:336
Header file for run time assertion macros.
Utility type for generic codes.
Base template for the MultTrait class.
Definition: MultTrait.h:141
SelectType< evaluateRight, const RT2, CT2 >::Type RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: SMatDMatMultExpr.h:210
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
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
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
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatDMatMultExpr.h:294
MT1::ResultType RT1
Result type of the left-hand side sparse matrix expression.
Definition: SMatDMatMultExpr.h:112
Header file for the RemoveReference type trait.
MT2::CompositeType CT2
Composite type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:117
SMatDMatMultExpr< MT1, MT2 > This
Type of this SMatDMatMultExpr instance.
Definition: SMatDMatMultExpr.h:191
#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.
RT2::ElementType ET2
Element type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:115
Header file for the IsRowMajorMatrix type trait.
Header file for the IsComputation type trait class.
SMatDMatMultExpr(const MT1 &lhs, const MT2 &rhs)
Constructor for the SMatDMatMultExpr class.
Definition: SMatDMatMultExpr.h:231
Header file for the TDVecDMatMultExprTrait 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
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2403
MT1::CompositeType CT1
Composite type of the left-hand side sparse matrix expression.
Definition: SMatDMatMultExpr.h:116
Header file for basic type definitions.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatDMatMultExpr.h:246
Header file for the TSVecDMatMultExprTrait class template.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatDMatMultExpr.h:194
Header file for the DMatSVecMultExprTrait class template.
Header file for the IsColumnVector type trait.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatDMatMultExpr.h:304
Header file for the IsResizable 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
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 FunctionTrace class.