35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATDMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATDMATMULTEXPR_H_
105 template<
typename MT1
107 class SMatDMatMultExpr :
public DenseMatrix< SMatDMatMultExpr<MT1,MT2>, false >
108 ,
private MatMatMultExpr
109 ,
private Computation
136 template<
typename T1,
typename T2,
typename T3 >
137 struct UseSMPAssignKernel {
138 enum { value = evaluateLeft || evaluateRight };
148 template<
typename T1,
typename T2,
typename T3 >
149 struct UseVectorizedKernel {
150 enum { value = !UseSMPAssignKernel<T1,T2,T3>::value &&
151 T1::vectorizable && T3::vectorizable &&
152 IsRowMajorMatrix<T1>::value &&
153 IsSame<typename T1::ElementType,typename T2::ElementType>::value &&
154 IsSame<typename T1::ElementType,typename T3::ElementType>::value &&
155 IntrinsicTrait<typename T1::ElementType>::addition &&
156 IntrinsicTrait<typename T1::ElementType>::subtraction &&
157 IntrinsicTrait<typename T1::ElementType>::multiplication };
168 template<
typename T1,
typename T2,
typename T3 >
169 struct UseOptimizedKernel {
170 enum { value = !UseSMPAssignKernel<T1,T2,T3>::value &&
171 !UseVectorizedKernel<T1,T2,T3>::value &&
172 !IsResizable<typename T1::ElementType>::value &&
173 !IsResizable<ET1>::value };
183 template<
typename T1,
typename T2,
typename T3 >
184 struct UseDefaultKernel {
185 enum { value = !UseSMPAssignKernel<T1,T2,T3>::value &&
186 !UseVectorizedKernel<T1,T2,T3>::value &&
187 !UseOptimizedKernel<T1,T2,T3>::value };
218 enum { vectorizable = MT2::vectorizable &&
224 enum { smpAssignable = !evaluateLeft && !evaluateRight };
257 if(
lhs_.columns() == 0 )
265 const ConstIterator end( A.end(i) );
266 ConstIterator element( A.begin(i) );
273 tmp = element->value() *
rhs_(element->index(),j);
275 for( ; element!=end; ++element )
276 tmp += element->value() *
rhs_(element->index(),j);
282 for(
size_t k=1; k<
lhs_.columns(); ++k ) {
307 return rhs_.columns();
337 template<
typename T >
339 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
349 template<
typename T >
351 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
361 return rhs_.isAligned();
393 template<
typename MT
412 SMatDMatMultExpr::selectAssignKernel( ~lhs, A, B );
431 template<
typename MT3
439 for(
size_t i=0UL; i<A.rows(); ++i )
441 const ConstIterator end( A.end(i) );
443 for(
size_t j=0UL; j<B.columns(); ++j )
445 ConstIterator element( A.begin(i) );
447 if( element != end ) {
448 (~C)(i,j) = element->value() * B(element->index(),j);
450 for( ; element!=end; ++element ) {
451 (~C)(i,j) += element->value() * B(element->index(),j);
477 template<
typename MT3
480 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
481 selectAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
485 const size_t jend( B.columns() & size_t(-4) );
490 for(
size_t i=0UL; i<A.rows(); ++i )
492 const ConstIterator end( A.end(i) );
493 ConstIterator element( A.begin(i) );
495 const size_t kend( A.nonZeros(i) & size_t(-4) );
497 for(
size_t k=0UL; k<kend; k+=4UL ) {
498 const size_t i1( element->index() );
499 const ET1 v1( element->value() );
501 const size_t i2( element->index() );
502 const ET1 v2( element->value() );
504 const size_t i3( element->index() );
505 const ET1 v3( element->value() );
507 const size_t i4( element->index() );
508 const ET1 v4( element->value() );
511 for(
size_t j=0UL; j<jend; j+=4UL ) {
512 (~C)(i,j ) += v1 * B(i1,j ) + v2 * B(i2,j ) + v3 * B(i3,j ) + v4 * B(i4,j );
513 (~C)(i,j+1UL) += v1 * B(i1,j+1UL) + v2 * B(i2,j+1UL) + v3 * B(i3,j+1UL) + v4 * B(i4,j+1UL);
514 (~C)(i,j+2UL) += v1 * B(i1,j+2UL) + v2 * B(i2,j+2UL) + v3 * B(i3,j+2UL) + v4 * B(i4,j+2UL);
515 (~C)(i,j+3UL) += v1 * B(i1,j+3UL) + v2 * B(i2,j+3UL) + v3 * B(i3,j+3UL) + v4 * B(i4,j+3UL);
517 for(
size_t j=jend; j<B.columns(); ++j ) {
518 (~C)(i,j) += v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
522 for( ; element!=end; ++element ) {
523 for(
size_t j=0UL; j<jend; j+=4UL ) {
524 (~C)(i,j ) += element->value() * B(element->index(),j );
525 (~C)(i,j+1UL) += element->value() * B(element->index(),j+1UL);
526 (~C)(i,j+2UL) += element->value() * B(element->index(),j+2UL);
527 (~C)(i,j+3UL) += element->value() * B(element->index(),j+3UL);
529 for(
size_t j=jend; j<B.columns(); ++j ) {
530 (~C)(i,j) += element->value() * B(element->index(),j);
552 template<
typename MT3
555 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
556 selectAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
558 typedef IntrinsicTrait<ElementType> IT;
561 const size_t N( B.columns() );
565 for(
size_t i=0UL; i<A.rows(); ++i )
567 const ConstIterator end( A.end(i) );
568 ConstIterator element( A.begin(i) );
570 const size_t kend( A.nonZeros(i) & size_t(-4) );
572 for(
size_t k=0UL; k<kend; k+=4UL ) {
573 const size_t i1( element->index() );
576 const size_t i2( element->index() );
579 const size_t i3( element->index() );
582 const size_t i4( element->index() );
586 for(
size_t j=0UL; j<N; j+=IT::size ) {
587 (~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) );
591 for( ; element!=end; ++element ) {
592 const size_t i1( element->index() );
595 for(
size_t j=0UL; j<N; j+=IT::size ) {
596 (~C).
store( i, j, (~C).load(i,j) + v1 * B.load(i1,j) );
618 template<
typename MT3
621 static inline typename DisableIf< UseSMPAssignKernel<MT3,MT4,MT5> >::Type
622 selectAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
626 const size_t jend( B.columns() & size_t(-4) );
629 for(
size_t j=0UL; j<jend; j+=4UL ) {
630 for(
size_t i=0UL; i<A.rows(); ++i )
632 ConstIterator element( A.begin(i) );
633 const ConstIterator end( A.end(i) );
635 if( element == end ) {
637 reset( (~C)(i,j+1UL) );
638 reset( (~C)(i,j+2UL) );
639 reset( (~C)(i,j+3UL) );
643 (~C)(i,j ) = element->value() * B(element->index(),j );
644 (~C)(i,j+1UL) = element->value() * B(element->index(),j+1UL);
645 (~C)(i,j+2UL) = element->value() * B(element->index(),j+2UL);
646 (~C)(i,j+3UL) = element->value() * B(element->index(),j+3UL);
648 for( ; element!=end; ++element ) {
649 (~C)(i,j ) += element->value() * B(element->index(),j );
650 (~C)(i,j+1UL) += element->value() * B(element->index(),j+1UL);
651 (~C)(i,j+2UL) += element->value() * B(element->index(),j+2UL);
652 (~C)(i,j+3UL) += element->value() * B(element->index(),j+3UL);
657 for(
size_t j=jend; j<B.columns(); ++j ) {
658 for(
size_t i=0UL; i<A.rows(); ++i )
660 ConstIterator element( A.begin(i) );
661 const ConstIterator end( A.end(i) );
663 if( element == end ) {
668 (~C)(i,j) = element->value() * B(element->index(),j);
670 for( ; element!=end; ++element )
671 (~C)(i,j) += element->value() * B(element->index(),j);
692 template<
typename MT3
695 static inline typename EnableIf< UseSMPAssignKernel<MT3,MT4,MT5> >::Type
696 selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
715 template<
typename MT
721 typedef typename SelectType< SO, OppositeType, ResultType >::Type TmpType;
733 const TmpType tmp( rhs );
751 template<
typename MT
770 SMatDMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
789 template<
typename MT3
792 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
793 selectAddAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
797 for(
size_t i=0UL; i<A.rows(); ++i )
799 const ConstIterator end( A.end(i) );
801 for(
size_t j=0UL; j<B.columns(); ++j )
803 ConstIterator element( A.begin(i) );
805 for( ; element!=end; ++element ) {
806 (~C)(i,j) += element->value() * B(element->index(),j);
828 template<
typename MT3
831 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
832 selectAddAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
836 const size_t jend( B.columns() & size_t(-4) );
839 for(
size_t i=0UL; i<A.rows(); ++i )
841 const ConstIterator end( A.end(i) );
842 ConstIterator element( A.begin(i) );
844 const size_t kend( A.nonZeros(i) & size_t(-4) );
846 for(
size_t k=0UL; k<kend; k+=4UL ) {
847 const size_t i1( element->index() );
848 const ET1 v1( element->value() );
850 const size_t i2( element->index() );
851 const ET1 v2( element->value() );
853 const size_t i3( element->index() );
854 const ET1 v3( element->value() );
856 const size_t i4( element->index() );
857 const ET1 v4( element->value() );
860 for(
size_t j=0UL; j<jend; j+=4UL ) {
861 (~C)(i,j ) += v1 * B(i1,j ) + v2 * B(i2,j ) + v3 * B(i3,j ) + v4 * B(i4,j );
862 (~C)(i,j+1UL) += v1 * B(i1,j+1UL) + v2 * B(i2,j+1UL) + v3 * B(i3,j+1UL) + v4 * B(i4,j+1UL);
863 (~C)(i,j+2UL) += v1 * B(i1,j+2UL) + v2 * B(i2,j+2UL) + v3 * B(i3,j+2UL) + v4 * B(i4,j+2UL);
864 (~C)(i,j+3UL) += v1 * B(i1,j+3UL) + v2 * B(i2,j+3UL) + v3 * B(i3,j+3UL) + v4 * B(i4,j+3UL);
866 for(
size_t j=jend; j<B.columns(); ++j ) {
867 (~C)(i,j) += v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
871 for( ; element!=end; ++element ) {
872 for(
size_t j=0UL; j<jend; j+=4UL ) {
873 (~C)(i,j ) += element->value() * B(element->index(),j );
874 (~C)(i,j+1UL) += element->value() * B(element->index(),j+1UL);
875 (~C)(i,j+2UL) += element->value() * B(element->index(),j+2UL);
876 (~C)(i,j+3UL) += element->value() * B(element->index(),j+3UL);
878 for(
size_t j=jend; j<B.columns(); ++j ) {
879 (~C)(i,j) += element->value() * B(element->index(),j);
901 template<
typename MT3
904 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
905 selectAddAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
907 typedef IntrinsicTrait<ElementType> IT;
910 const size_t N( B.columns() );
912 for(
size_t i=0UL; i<A.rows(); ++i )
914 const ConstIterator end( A.end(i) );
915 ConstIterator element( A.begin(i) );
917 const size_t kend( A.nonZeros(i) & size_t(-4) );
919 for(
size_t k=0UL; k<kend; k+=4UL ) {
920 const size_t i1( element->index() );
923 const size_t i2( element->index() );
926 const size_t i3( element->index() );
929 const size_t i4( element->index() );
933 for(
size_t j=0UL; j<N; j+=IT::size ) {
934 (~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) );
938 for( ; element!=end; ++element ) {
939 const size_t i1( element->index() );
942 for(
size_t j=0UL; j<N; j+=IT::size ) {
943 (~C).
store( i, j, (~C).load(i,j) + v1 * B.load(i1,j) );
965 template<
typename MT3
968 static inline typename DisableIf< UseSMPAssignKernel<MT3,MT4,MT5> >::Type
969 selectAddAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
973 const size_t jend( B.columns() & size_t(-4) );
976 for(
size_t j=0UL; j<jend; j+=4UL ) {
977 for(
size_t i=0UL; i<A.rows(); ++i )
979 ConstIterator element( A.begin(i) );
980 const ConstIterator end( A.end(i) );
982 for( ; element!=end; ++element ) {
983 (~C)(i,j ) += element->value() * B(element->index(),j );
984 (~C)(i,j+1UL) += element->value() * B(element->index(),j+1UL);
985 (~C)(i,j+2UL) += element->value() * B(element->index(),j+2UL);
986 (~C)(i,j+3UL) += element->value() * B(element->index(),j+3UL);
991 for(
size_t j=jend; j<B.columns(); ++j ) {
992 for(
size_t i=0UL; i<A.rows(); ++i )
994 ConstIterator element( A.begin(i) );
995 const ConstIterator end( A.end(i) );
997 for( ; element!=end; ++element )
998 (~C)(i,j) += element->value() * B(element->index(),j);
1019 template<
typename MT3
1022 static inline typename EnableIf< UseSMPAssignKernel<MT3,MT4,MT5> >::Type
1023 selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1046 template<
typename MT
1065 SMatDMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1084 template<
typename MT3
1087 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
1088 selectSubAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
1092 for(
size_t i=0UL; i<A.rows(); ++i )
1094 const ConstIterator end( A.end(i) );
1096 for(
size_t j=0UL; j<B.columns(); ++j )
1098 ConstIterator element( A.begin(i) );
1100 for( ; element!=end; ++element ) {
1101 (~C)(i,j) -= element->value() * B(element->index(),j);
1123 template<
typename MT3
1126 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
1127 selectSubAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
1131 const size_t jend( B.columns() & size_t(-4) );
1132 BLAZE_INTERNAL_ASSERT( ( B.columns() - ( B.columns() % 4UL ) ) == jend,
"Invalid end calculation" );
1134 for(
size_t i=0UL; i<A.rows(); ++i )
1136 const ConstIterator end( A.end(i) );
1137 ConstIterator element( A.begin(i) );
1139 const size_t kend( A.nonZeros(i) & size_t(-4) );
1141 for(
size_t k=0UL; k<kend; k+=4UL ) {
1142 const size_t i1( element->index() );
1143 const ET1 v1( element->value() );
1145 const size_t i2( element->index() );
1146 const ET1 v2( element->value() );
1148 const size_t i3( element->index() );
1149 const ET1 v3( element->value() );
1151 const size_t i4( element->index() );
1152 const ET1 v4( element->value() );
1155 for(
size_t j=0UL; j<jend; j+=4UL ) {
1156 (~C)(i,j ) -= v1 * B(i1,j ) + v2 * B(i2,j ) + v3 * B(i3,j ) + v4 * B(i4,j );
1157 (~C)(i,j+1UL) -= v1 * B(i1,j+1UL) + v2 * B(i2,j+1UL) + v3 * B(i3,j+1UL) + v4 * B(i4,j+1UL);
1158 (~C)(i,j+2UL) -= v1 * B(i1,j+2UL) + v2 * B(i2,j+2UL) + v3 * B(i3,j+2UL) + v4 * B(i4,j+2UL);
1159 (~C)(i,j+3UL) -= v1 * B(i1,j+3UL) + v2 * B(i2,j+3UL) + v3 * B(i3,j+3UL) + v4 * B(i4,j+3UL);
1161 for(
size_t j=jend; j<B.columns(); ++j ) {
1162 (~C)(i,j) -= v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
1166 for( ; element!=end; ++element ) {
1167 for(
size_t j=0UL; j<jend; j+=4UL ) {
1168 (~C)(i,j ) -= element->value() * B(element->index(),j );
1169 (~C)(i,j+1UL) -= element->value() * B(element->index(),j+1UL);
1170 (~C)(i,j+2UL) -= element->value() * B(element->index(),j+2UL);
1171 (~C)(i,j+3UL) -= element->value() * B(element->index(),j+3UL);
1173 for(
size_t j=jend; j<B.columns(); ++j ) {
1174 (~C)(i,j) -= element->value() * B(element->index(),j);
1196 template<
typename MT3
1199 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
1200 selectSubAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
1202 typedef IntrinsicTrait<ElementType> IT;
1205 const size_t N( B.columns() );
1207 for(
size_t i=0UL; i<A.rows(); ++i )
1209 const ConstIterator end( A.end(i) );
1210 ConstIterator element( A.begin(i) );
1212 const size_t kend( A.nonZeros(i) & size_t(-4) );
1214 for(
size_t k=0UL; k<kend; k+=4UL ) {
1215 const size_t i1( element->index() );
1218 const size_t i2( element->index() );
1221 const size_t i3( element->index() );
1224 const size_t i4( element->index() );
1228 for(
size_t j=0UL; j<N; j+=IT::size ) {
1229 (~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) );
1233 for( ; element!=end; ++element ) {
1234 const size_t i1( element->index() );
1237 for(
size_t j=0UL; j<N; j+=IT::size ) {
1238 (~C).
store( i, j, (~C).load(i,j) - v1 * B.load(i1,j) );
1260 template<
typename MT3
1263 static inline typename DisableIf< UseSMPAssignKernel<MT3,MT4,MT5> >::Type
1264 selectSubAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
1268 const size_t jend( B.columns() & size_t(-4) );
1269 BLAZE_INTERNAL_ASSERT( ( B.columns() - ( B.columns() % 4UL ) ) == jend,
"Invalid end calculation" );
1271 for(
size_t j=0UL; j<jend; j+=4UL ) {
1272 for(
size_t i=0UL; i<A.rows(); ++i )
1274 ConstIterator element( A.begin(i) );
1275 const ConstIterator end( A.end(i) );
1277 for( ; element!=end; ++element ) {
1278 (~C)(i,j ) -= element->value() * B(element->index(),j );
1279 (~C)(i,j+1UL) -= element->value() * B(element->index(),j+1UL);
1280 (~C)(i,j+2UL) -= element->value() * B(element->index(),j+2UL);
1281 (~C)(i,j+3UL) -= element->value() * B(element->index(),j+3UL);
1286 for(
size_t j=jend; j<B.columns(); ++j ) {
1287 for(
size_t i=0UL; i<A.rows(); ++i )
1289 ConstIterator element( A.begin(i) );
1290 const ConstIterator end( A.end(i) );
1292 for( ; element!=end; ++element )
1293 (~C)(i,j) -= element->value() * B(element->index(),j);
1314 template<
typename MT3
1317 static inline typename EnableIf< UseSMPAssignKernel<MT3,MT4,MT5> >::Type
1318 selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1386 template<
typename T1
1388 inline const SMatDMatMultExpr<T1,T2>
1394 throw std::invalid_argument(
"Matrix sizes do not match" );
1411 template<
typename MT1,
typename MT2,
typename VT >
1412 struct DMatDVecMultExprTrait< SMatDMatMultExpr<MT1,MT2>, VT >
1416 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1417 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1418 IsDenseVector<VT>::value && IsColumnVector<VT>::value
1419 ,
typename SMatDVecMultExprTrait< MT1, typename DMatDVecMultExprTrait<MT2,VT>::Type >::Type
1420 , INVALID_TYPE >::Type Type;
1429 template<
typename MT1,
typename MT2,
typename VT >
1430 struct DMatSVecMultExprTrait< SMatDMatMultExpr<MT1,MT2>, VT >
1434 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1435 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1436 IsSparseVector<VT>::value && IsColumnVector<VT>::value
1437 ,
typename SMatDVecMultExprTrait< MT1, typename DMatSVecMultExprTrait<MT2,VT>::Type >::Type
1438 , INVALID_TYPE >::Type Type;
1447 template<
typename VT,
typename MT1,
typename MT2 >
1448 struct TDVecDMatMultExprTrait< VT, SMatDMatMultExpr<MT1,MT2> >
1452 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1453 IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1454 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value
1455 ,
typename TDVecDMatMultExprTrait< typename TDVecSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1456 , INVALID_TYPE >::Type Type;
1465 template<
typename VT,
typename MT1,
typename MT2 >
1466 struct TSVecDMatMultExprTrait< VT, SMatDMatMultExpr<MT1,MT2> >
1470 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1471 IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1472 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value
1473 ,
typename TSVecDMatMultExprTrait< typename TSVecSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1474 , INVALID_TYPE >::Type Type;
1483 template<
typename MT1,
typename MT2,
bool AF >
1484 struct SubmatrixExprTrait< SMatDMatMultExpr<MT1,MT2>, AF >
1488 typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT1,AF>::Type
1489 ,
typename SubmatrixExprTrait<const MT2,AF>::Type >::Type Type;
1498 template<
typename MT1,
typename MT2 >
1499 struct RowExprTrait< SMatDMatMultExpr<MT1,MT2> >
1503 typedef typename MultExprTrait< typename RowExprTrait<const MT1>::Type, MT2 >::Type Type;
1512 template<
typename MT1,
typename MT2 >
1513 struct ColumnExprTrait< SMatDMatMultExpr<MT1,MT2> >
1517 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:204
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: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
LeftOperand leftOperand() const
Returns the left-hand side sparse matrix operand.
Definition: SMatDMatMultExpr.h:316
Header file for the IsSparseMatrix type trait.
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:197
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: SMatDMatMultExpr.h:370
#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.
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 TDVecSMatMultExprTrait class template.
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:87
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:200
SelectType< IsExpression< MT2 >::value, const MT2, const MT2 & >::Type RightOperand
Composite type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:207
const ResultType CompositeType
Data type for composite expression templates.
Definition: SMatDMatMultExpr.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:104
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
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SMatDMatMultExpr.h:350
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:115
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the DisableIf class template.
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:2388
Header file for the dense matrix SMP implementation.
Header file for the DenseMatrix base class.
MT2::ResultType RT2
Result type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:114
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
Header file for the DMatDVecMultExprTrait class template.
RightOperand rightOperand() const
Returns the right-hand side dense matrix operand.
Definition: SMatDMatMultExpr.h:326
#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:195
SelectType< evaluateLeft, const RT1, CT1 >::Type LT
Type for the assignment of the left-hand side sparse matrix operand.
Definition: SMatDMatMultExpr.h:210
RightOperand rhs_
Right-hand side dense matrix of the multiplication expression.
Definition: SMatDMatMultExpr.h:378
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2382
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: SMatDMatMultExpr.h:360
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:199
Header file for the IsDenseMatrix type trait.
Header file for the EnableIf class template.
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatDMatMultExpr.h:198
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
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatDMatMultExpr.h:196
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:377
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:338
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:213
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
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:239
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatDMatMultExpr.h:296
const size_t SMP_SMATDMATMULT_THRESHOLD
SMP row-major sparse matrix/row-major dense matrix multiplication threshold.This threshold represents...
Definition: Thresholds.h:537
MT1::ResultType RT1
Result type of the left-hand side sparse matrix expression.
Definition: SMatDMatMultExpr.h:113
Header file for the RemoveReference type trait.
MT2::CompositeType CT2
Composite type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:118
SMatDMatMultExpr< MT1, MT2 > This
Type of this SMatDMatMultExpr instance.
Definition: SMatDMatMultExpr.h:194
#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:116
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:233
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:2379
MT1::CompositeType CT1
Composite type of the left-hand side sparse matrix expression.
Definition: SMatDMatMultExpr.h:117
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.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatDMatMultExpr.h:248
Header file for the TSVecDMatMultExprTrait class template.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatDMatMultExpr.h:197
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:306
Header file for the IsResizable type trait.
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
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 FunctionTrace class.