35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATDMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATDMATMULTEXPR_H_
111 template<
typename MT1
113 class SMatDMatMultExpr :
public DenseMatrix< SMatDMatMultExpr<MT1,MT2>, false >
114 ,
private MatMatMultExpr
115 ,
private Computation
145 template<
typename T1,
typename T2,
typename T3 >
146 struct CanExploitSymmetry {
147 enum { value = IsColumnMajorMatrix<T1>::value &&
148 ( IsSymmetric<T2>::value || IsSymmetric<T3>::value ) };
159 template<
typename T1,
typename T2,
typename T3 >
160 struct IsEvaluationRequired {
161 enum { value = ( evaluateLeft || evaluateRight ) &&
162 !CanExploitSymmetry<T1,T2,T3>::value };
172 template<
typename T1,
typename T2,
typename T3 >
173 struct UseVectorizedKernel {
174 enum { value = T1::vectorizable && T3::vectorizable &&
175 IsRowMajorMatrix<T1>::value &&
176 IsSame<typename T1::ElementType,typename T2::ElementType>::value &&
177 IsSame<typename T1::ElementType,typename T3::ElementType>::value &&
178 IntrinsicTrait<typename T1::ElementType>::addition &&
179 IntrinsicTrait<typename T1::ElementType>::subtraction &&
180 IntrinsicTrait<typename T1::ElementType>::multiplication };
191 template<
typename T1,
typename T2,
typename T3 >
192 struct UseOptimizedKernel {
193 enum { value = !UseVectorizedKernel<T1,T2,T3>::value &&
194 !IsResizable<typename T1::ElementType>::value &&
195 !IsResizable<ET1>::value };
205 template<
typename T1,
typename T2,
typename T3 >
206 struct UseDefaultKernel {
207 enum { value = !UseVectorizedKernel<T1,T2,T3>::value &&
208 !UseOptimizedKernel<T1,T2,T3>::value };
239 enum { vectorizable = MT2::vectorizable &&
245 enum { smpAssignable = !evaluateLeft && MT1::smpAssignable &&
246 !evaluateRight && MT2::smpAssignable };
279 if(
lhs_.columns() == 0 )
287 const ConstIterator
end( A.end(i) );
288 ConstIterator element( A.begin(i) );
295 tmp = element->value() *
rhs_(element->index(),j);
297 for( ; element!=
end; ++element )
298 tmp += element->value() *
rhs_(element->index(),j);
304 for(
size_t k=1; k<
lhs_.columns(); ++k ) {
329 return rhs_.columns();
359 template<
typename T >
361 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
371 template<
typename T >
373 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
383 return rhs_.isAligned();
416 template<
typename MT
436 SMatDMatMultExpr::selectAssignKernel( ~lhs, A, B );
455 template<
typename MT3
463 for(
size_t i=0UL; i<A.rows(); ++i )
465 const ConstIterator
end( A.end(i) );
467 for(
size_t j=0UL; j<B.columns(); ++j )
469 ConstIterator element( A.begin(i) );
471 if( element !=
end ) {
472 (~C)(i,j) = element->value() * B(element->index(),j);
474 for( ; element!=
end; ++element ) {
475 (~C)(i,j) += element->value() * B(element->index(),j);
501 template<
typename MT3
504 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
505 selectAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
509 const size_t jend( B.columns() & size_t(-4) );
514 for(
size_t i=0UL; i<A.rows(); ++i )
516 const ConstIterator
end( A.end(i) );
517 ConstIterator element( A.begin(i) );
519 const size_t kend( A.nonZeros(i) & size_t(-4) );
521 for(
size_t k=0UL; k<kend; k+=4UL ) {
522 const size_t i1( element->index() );
523 const ET1 v1( element->value() );
525 const size_t i2( element->index() );
526 const ET1 v2( element->value() );
528 const size_t i3( element->index() );
529 const ET1 v3( element->value() );
531 const size_t i4( element->index() );
532 const ET1 v4( element->value() );
535 for(
size_t j=0UL; j<jend; j+=4UL ) {
536 (~C)(i,j ) += v1 * B(i1,j ) + v2 * B(i2,j ) + v3 * B(i3,j ) + v4 * B(i4,j );
537 (~C)(i,j+1UL) += v1 * B(i1,j+1UL) + v2 * B(i2,j+1UL) + v3 * B(i3,j+1UL) + v4 * B(i4,j+1UL);
538 (~C)(i,j+2UL) += v1 * B(i1,j+2UL) + v2 * B(i2,j+2UL) + v3 * B(i3,j+2UL) + v4 * B(i4,j+2UL);
539 (~C)(i,j+3UL) += v1 * B(i1,j+3UL) + v2 * B(i2,j+3UL) + v3 * B(i3,j+3UL) + v4 * B(i4,j+3UL);
541 for(
size_t j=jend; j<B.columns(); ++j ) {
542 (~C)(i,j) += v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
546 for( ; element!=
end; ++element ) {
547 for(
size_t j=0UL; j<jend; j+=4UL ) {
548 (~C)(i,j ) += element->value() * B(element->index(),j );
549 (~C)(i,j+1UL) += element->value() * B(element->index(),j+1UL);
550 (~C)(i,j+2UL) += element->value() * B(element->index(),j+2UL);
551 (~C)(i,j+3UL) += element->value() * B(element->index(),j+3UL);
553 for(
size_t j=jend; j<B.columns(); ++j ) {
554 (~C)(i,j) += element->value() * B(element->index(),j);
576 template<
typename MT3
579 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
580 selectAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
582 typedef IntrinsicTrait<ElementType> IT;
585 const size_t N( B.columns() );
589 for(
size_t i=0UL; i<A.rows(); ++i )
591 const ConstIterator
end( A.end(i) );
592 ConstIterator element( A.begin(i) );
594 const size_t kend( A.nonZeros(i) & size_t(-4) );
596 for(
size_t k=0UL; k<kend; k+=4UL ) {
597 const size_t i1( element->index() );
600 const size_t i2( element->index() );
603 const size_t i3( element->index() );
606 const size_t i4( element->index() );
610 for(
size_t j=0UL; j<N; j+=
IT::size ) {
611 (~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) );
615 for( ; element!=
end; ++element ) {
616 const size_t i1( element->index() );
619 for(
size_t j=0UL; j<N; j+=
IT::size ) {
620 (~C).
store( i, j, (~C).load(i,j) + v1 * B.load(i1,j) );
642 template<
typename MT3
645 static inline void selectAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
649 const size_t jend( B.columns() & size_t(-4) );
652 for(
size_t j=0UL; j<jend; j+=4UL ) {
653 for(
size_t i=0UL; i<A.rows(); ++i )
655 ConstIterator element( A.begin(i) );
656 const ConstIterator
end( A.end(i) );
658 if( element ==
end ) {
660 reset( (~C)(i,j+1UL) );
661 reset( (~C)(i,j+2UL) );
662 reset( (~C)(i,j+3UL) );
666 (~C)(i,j ) = element->value() * B(element->index(),j );
667 (~C)(i,j+1UL) = element->value() * B(element->index(),j+1UL);
668 (~C)(i,j+2UL) = element->value() * B(element->index(),j+2UL);
669 (~C)(i,j+3UL) = element->value() * B(element->index(),j+3UL);
671 for( ; element!=
end; ++element ) {
672 (~C)(i,j ) += element->value() * B(element->index(),j );
673 (~C)(i,j+1UL) += element->value() * B(element->index(),j+1UL);
674 (~C)(i,j+2UL) += element->value() * B(element->index(),j+2UL);
675 (~C)(i,j+3UL) += element->value() * B(element->index(),j+3UL);
680 for(
size_t j=jend; j<B.columns(); ++j ) {
681 for(
size_t i=0UL; i<A.rows(); ++i )
683 ConstIterator element( A.begin(i) );
684 const ConstIterator
end( A.end(i) );
686 if( element ==
end ) {
691 (~C)(i,j) = element->value() * B(element->index(),j);
693 for( ; element!=
end; ++element )
694 (~C)(i,j) += element->value() * B(element->index(),j);
714 template<
typename MT
720 typedef typename SelectType< SO, OppositeType, ResultType >::Type TmpType;
732 const TmpType tmp(
serial( rhs ) );
753 template<
typename MT >
754 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
764 if( IsSymmetric<MT1>::value )
785 template<
typename MT
804 SMatDMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
823 template<
typename MT3
826 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
827 selectAddAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
831 for(
size_t i=0UL; i<A.rows(); ++i )
833 const ConstIterator
end( A.end(i) );
835 for(
size_t j=0UL; j<B.columns(); ++j )
837 ConstIterator element( A.begin(i) );
839 for( ; element!=
end; ++element ) {
840 (~C)(i,j) += element->value() * B(element->index(),j);
862 template<
typename MT3
865 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
866 selectAddAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
870 const size_t jend( B.columns() & size_t(-4) );
873 for(
size_t i=0UL; i<A.rows(); ++i )
875 const ConstIterator
end( A.end(i) );
876 ConstIterator element( A.begin(i) );
878 const size_t kend( A.nonZeros(i) & size_t(-4) );
880 for(
size_t k=0UL; k<kend; k+=4UL ) {
881 const size_t i1( element->index() );
882 const ET1 v1( element->value() );
884 const size_t i2( element->index() );
885 const ET1 v2( element->value() );
887 const size_t i3( element->index() );
888 const ET1 v3( element->value() );
890 const size_t i4( element->index() );
891 const ET1 v4( element->value() );
894 for(
size_t j=0UL; j<jend; j+=4UL ) {
895 (~C)(i,j ) += v1 * B(i1,j ) + v2 * B(i2,j ) + v3 * B(i3,j ) + v4 * B(i4,j );
896 (~C)(i,j+1UL) += v1 * B(i1,j+1UL) + v2 * B(i2,j+1UL) + v3 * B(i3,j+1UL) + v4 * B(i4,j+1UL);
897 (~C)(i,j+2UL) += v1 * B(i1,j+2UL) + v2 * B(i2,j+2UL) + v3 * B(i3,j+2UL) + v4 * B(i4,j+2UL);
898 (~C)(i,j+3UL) += v1 * B(i1,j+3UL) + v2 * B(i2,j+3UL) + v3 * B(i3,j+3UL) + v4 * B(i4,j+3UL);
900 for(
size_t j=jend; j<B.columns(); ++j ) {
901 (~C)(i,j) += v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
905 for( ; element!=
end; ++element ) {
906 for(
size_t j=0UL; j<jend; j+=4UL ) {
907 (~C)(i,j ) += element->value() * B(element->index(),j );
908 (~C)(i,j+1UL) += element->value() * B(element->index(),j+1UL);
909 (~C)(i,j+2UL) += element->value() * B(element->index(),j+2UL);
910 (~C)(i,j+3UL) += element->value() * B(element->index(),j+3UL);
912 for(
size_t j=jend; j<B.columns(); ++j ) {
913 (~C)(i,j) += element->value() * B(element->index(),j);
935 template<
typename MT3
938 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
939 selectAddAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
941 typedef IntrinsicTrait<ElementType> IT;
944 const size_t N( B.columns() );
946 for(
size_t i=0UL; i<A.rows(); ++i )
948 const ConstIterator
end( A.end(i) );
949 ConstIterator element( A.begin(i) );
951 const size_t kend( A.nonZeros(i) & size_t(-4) );
953 for(
size_t k=0UL; k<kend; k+=4UL ) {
954 const size_t i1( element->index() );
957 const size_t i2( element->index() );
960 const size_t i3( element->index() );
963 const size_t i4( element->index() );
967 for(
size_t j=0UL; j<N; j+=
IT::size ) {
968 (~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) );
972 for( ; element!=
end; ++element ) {
973 const size_t i1( element->index() );
976 for(
size_t j=0UL; j<N; j+=
IT::size ) {
977 (~C).
store( i, j, (~C).load(i,j) + v1 * B.load(i1,j) );
999 template<
typename MT3
1002 static inline void selectAddAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
1006 const size_t jend( B.columns() & size_t(-4) );
1007 BLAZE_INTERNAL_ASSERT( ( B.columns() - ( B.columns() % 4UL ) ) == jend,
"Invalid end calculation" );
1009 for(
size_t j=0UL; j<jend; j+=4UL ) {
1010 for(
size_t i=0UL; i<A.rows(); ++i )
1012 ConstIterator element( A.begin(i) );
1013 const ConstIterator
end( A.end(i) );
1015 for( ; element!=
end; ++element ) {
1016 (~C)(i,j ) += element->value() * B(element->index(),j );
1017 (~C)(i,j+1UL) += element->value() * B(element->index(),j+1UL);
1018 (~C)(i,j+2UL) += element->value() * B(element->index(),j+2UL);
1019 (~C)(i,j+3UL) += element->value() * B(element->index(),j+3UL);
1024 for(
size_t j=jend; j<B.columns(); ++j ) {
1025 for(
size_t i=0UL; i<A.rows(); ++i )
1027 ConstIterator element( A.begin(i) );
1028 const ConstIterator
end( A.end(i) );
1030 for( ; element!=
end; ++element )
1031 (~C)(i,j) += element->value() * B(element->index(),j);
1053 template<
typename MT >
1054 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1064 if( IsSymmetric<MT1>::value )
1089 template<
typename MT
1108 SMatDMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1127 template<
typename MT3
1130 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
1131 selectSubAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
1135 for(
size_t i=0UL; i<A.rows(); ++i )
1137 const ConstIterator
end( A.end(i) );
1139 for(
size_t j=0UL; j<B.columns(); ++j )
1141 ConstIterator element( A.begin(i) );
1143 for( ; element!=
end; ++element ) {
1144 (~C)(i,j) -= element->value() * B(element->index(),j);
1166 template<
typename MT3
1169 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
1170 selectSubAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
1174 const size_t jend( B.columns() & size_t(-4) );
1175 BLAZE_INTERNAL_ASSERT( ( B.columns() - ( B.columns() % 4UL ) ) == jend,
"Invalid end calculation" );
1177 for(
size_t i=0UL; i<A.rows(); ++i )
1179 const ConstIterator
end( A.end(i) );
1180 ConstIterator element( A.begin(i) );
1182 const size_t kend( A.nonZeros(i) & size_t(-4) );
1184 for(
size_t k=0UL; k<kend; k+=4UL ) {
1185 const size_t i1( element->index() );
1186 const ET1 v1( element->value() );
1188 const size_t i2( element->index() );
1189 const ET1 v2( element->value() );
1191 const size_t i3( element->index() );
1192 const ET1 v3( element->value() );
1194 const size_t i4( element->index() );
1195 const ET1 v4( element->value() );
1198 for(
size_t j=0UL; j<jend; j+=4UL ) {
1199 (~C)(i,j ) -= v1 * B(i1,j ) + v2 * B(i2,j ) + v3 * B(i3,j ) + v4 * B(i4,j );
1200 (~C)(i,j+1UL) -= v1 * B(i1,j+1UL) + v2 * B(i2,j+1UL) + v3 * B(i3,j+1UL) + v4 * B(i4,j+1UL);
1201 (~C)(i,j+2UL) -= v1 * B(i1,j+2UL) + v2 * B(i2,j+2UL) + v3 * B(i3,j+2UL) + v4 * B(i4,j+2UL);
1202 (~C)(i,j+3UL) -= v1 * B(i1,j+3UL) + v2 * B(i2,j+3UL) + v3 * B(i3,j+3UL) + v4 * B(i4,j+3UL);
1204 for(
size_t j=jend; j<B.columns(); ++j ) {
1205 (~C)(i,j) -= v1 * B(i1,j) + v2 * B(i2,j) + v3 * B(i3,j) + v4 * B(i4,j);
1209 for( ; element!=
end; ++element ) {
1210 for(
size_t j=0UL; j<jend; j+=4UL ) {
1211 (~C)(i,j ) -= element->value() * B(element->index(),j );
1212 (~C)(i,j+1UL) -= element->value() * B(element->index(),j+1UL);
1213 (~C)(i,j+2UL) -= element->value() * B(element->index(),j+2UL);
1214 (~C)(i,j+3UL) -= element->value() * B(element->index(),j+3UL);
1216 for(
size_t j=jend; j<B.columns(); ++j ) {
1217 (~C)(i,j) -= element->value() * B(element->index(),j);
1239 template<
typename MT3
1242 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
1243 selectSubAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
1245 typedef IntrinsicTrait<ElementType> IT;
1248 const size_t N( B.columns() );
1250 for(
size_t i=0UL; i<A.rows(); ++i )
1252 const ConstIterator
end( A.end(i) );
1253 ConstIterator element( A.begin(i) );
1255 const size_t kend( A.nonZeros(i) & size_t(-4) );
1257 for(
size_t k=0UL; k<kend; k+=4UL ) {
1258 const size_t i1( element->index() );
1261 const size_t i2( element->index() );
1264 const size_t i3( element->index() );
1267 const size_t i4( element->index() );
1271 for(
size_t j=0UL; j<N; j+=
IT::size ) {
1272 (~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) );
1276 for( ; element!=
end; ++element ) {
1277 const size_t i1( element->index() );
1280 for(
size_t j=0UL; j<N; j+=
IT::size ) {
1281 (~C).
store( i, j, (~C).load(i,j) - v1 * B.load(i1,j) );
1303 template<
typename MT3
1306 static inline void selectSubAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
1310 const size_t jend( B.columns() & size_t(-4) );
1311 BLAZE_INTERNAL_ASSERT( ( B.columns() - ( B.columns() % 4UL ) ) == jend,
"Invalid end calculation" );
1313 for(
size_t j=0UL; j<jend; j+=4UL ) {
1314 for(
size_t i=0UL; i<A.rows(); ++i )
1316 ConstIterator element( A.begin(i) );
1317 const ConstIterator
end( A.end(i) );
1319 for( ; element!=
end; ++element ) {
1320 (~C)(i,j ) -= element->value() * B(element->index(),j );
1321 (~C)(i,j+1UL) -= element->value() * B(element->index(),j+1UL);
1322 (~C)(i,j+2UL) -= element->value() * B(element->index(),j+2UL);
1323 (~C)(i,j+3UL) -= element->value() * B(element->index(),j+3UL);
1328 for(
size_t j=jend; j<B.columns(); ++j ) {
1329 for(
size_t i=0UL; i<A.rows(); ++i )
1331 ConstIterator element( A.begin(i) );
1332 const ConstIterator
end( A.end(i) );
1334 for( ; element!=
end; ++element )
1335 (~C)(i,j) -= element->value() * B(element->index(),j);
1357 template<
typename MT >
1358 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1368 if( IsSymmetric<MT1>::value )
1403 template<
typename MT
1405 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1443 template<
typename MT
1445 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1450 typedef typename SelectType< SO, OppositeType, ResultType >::Type TmpType;
1462 const TmpType tmp( rhs );
1483 template<
typename MT >
1484 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1494 if( IsSymmetric<MT1>::value )
1518 template<
typename MT
1520 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1558 template<
typename MT >
1559 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1569 if( IsSymmetric<MT1>::value )
1597 template<
typename MT
1599 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1637 template<
typename MT >
1638 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1648 if( IsSymmetric<MT1>::value )
1718 template<
typename T1
1720 inline const SMatDMatMultExpr<T1,T2>
1726 throw std::invalid_argument(
"Matrix sizes do not match" );
1743 template<
typename MT1,
typename MT2 >
1761 template<
typename MT1,
typename MT2 >
1763 :
public Columns<MT2>
1779 template<
typename MT1,
typename MT2 >
1781 :
public IsTrue< IsLower<MT1>::value && IsLower<MT2>::value >
1797 template<
typename MT1,
typename MT2 >
1799 :
public IsTrue< IsUpper<MT1>::value && IsUpper<MT2>::value >
1815 template<
typename MT1,
typename MT2,
typename VT >
1820 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1821 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1822 IsDenseVector<VT>::value && IsColumnVector<VT>::value
1823 ,
typename SMatDVecMultExprTrait< MT1, typename DMatDVecMultExprTrait<MT2,VT>::Type >::Type
1824 , INVALID_TYPE >::Type Type;
1833 template<
typename MT1,
typename MT2,
typename VT >
1838 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1839 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1840 IsSparseVector<VT>::value && IsColumnVector<VT>::value
1841 ,
typename SMatDVecMultExprTrait< MT1, typename DMatSVecMultExprTrait<MT2,VT>::Type >::Type
1842 , INVALID_TYPE >::Type Type;
1851 template<
typename VT,
typename MT1,
typename MT2 >
1856 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1857 IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1858 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value
1859 ,
typename TDVecDMatMultExprTrait< typename TDVecSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1860 , INVALID_TYPE >::Type Type;
1869 template<
typename VT,
typename MT1,
typename MT2 >
1874 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1875 IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1876 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value
1877 ,
typename TSVecDMatMultExprTrait< typename TSVecSMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1878 , INVALID_TYPE >::Type Type;
1887 template<
typename MT1,
typename MT2,
bool AF >
1892 typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT1,AF>::Type
1893 ,
typename SubmatrixExprTrait<const MT2,AF>::Type >::Type Type;
1902 template<
typename MT1,
typename MT2 >
1907 typedef typename MultExprTrait< typename RowExprTrait<const MT1>::Type, MT2 >::Type Type;
1916 template<
typename MT1,
typename MT2 >
1921 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:225
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.
Header file for the Rows type trait.
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:4838
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:258
LeftOperand leftOperand() const
Returns the left-hand side sparse matrix operand.
Definition: SMatDMatMultExpr.h:338
Header file for the IsSparseMatrix type trait.
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: SMatDMatMultExpr.h:392
#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:2478
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:257
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:695
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:221
SelectType< IsExpression< MT2 >::value, const MT2, const MT2 & >::Type RightOperand
Composite type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:228
const ResultType CompositeType
Data type for composite expression templates.
Definition: SMatDMatMultExpr.h:222
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.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SMatDMatMultExpr.h:372
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:121
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the DisableIf class template.
Header file for the multiplication trait.
Header file for the IsSymmetric type 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:2482
Header file for the DenseMatrix base class.
MT2::ResultType RT2
Result type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:120
BLAZE_ALWAYS_INLINE 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:635
Header file for the Columns type trait.
Header file for the DMatDVecMultExprTrait class template.
Header file for the IsLower type trait.
RightOperand rightOperand() const
Returns the right-hand side dense matrix operand.
Definition: SMatDMatMultExpr.h:348
#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:216
SelectType< evaluateLeft, const RT1, CT1 >::Type LT
Type for the assignment of the left-hand side sparse matrix operand.
Definition: SMatDMatMultExpr.h:231
RightOperand rhs_
Right-hand side dense matrix of the multiplication expression.
Definition: SMatDMatMultExpr.h:400
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: SMatDMatMultExpr.h:382
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:220
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.
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATMATMULTEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid matrix/matrix ...
Definition: MatMatMultExpr.h:165
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatDMatMultExpr.h:219
BLAZE_ALWAYS_INLINE 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:211
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatDMatMultExpr.h:217
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the IsSparseVector type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:116
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:399
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:749
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SMatDMatMultExpr.h:360
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
Utility type for generic codes.
Base template for the MultTrait class.
Definition: MultTrait.h:142
SelectType< evaluateRight, const RT2, CT2 >::Type RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: SMatDMatMultExpr.h:234
BLAZE_ALWAYS_INLINE 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:742
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.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatDMatMultExpr.h:318
MT1::ResultType RT1
Result type of the left-hand side sparse matrix expression.
Definition: SMatDMatMultExpr.h:119
BLAZE_ALWAYS_INLINE void reset(const NonNumericProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: NonNumericProxy.h:833
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
MT2::CompositeType CT2
Composite type of the right-hand side dense matrix expression.
Definition: SMatDMatMultExpr.h:124
SMatDMatMultExpr< MT1, MT2 > This
Type of this SMatDMatMultExpr instance.
Definition: SMatDMatMultExpr.h:215
#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:122
Header file for the IsRowMajorMatrix type trait.
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:932
Header file for the IsComputation type trait class.
SMatDMatMultExpr(const MT1 &lhs, const MT2 &rhs)
Constructor for the SMatDMatMultExpr class.
Definition: SMatDMatMultExpr.h:255
Header file for the TDVecDMatMultExprTrait class template.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
#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:2473
Header file for the IsTrue value trait.
MT1::CompositeType CT1
Composite type of the left-hand side sparse matrix expression.
Definition: SMatDMatMultExpr.h:123
Header file for basic type definitions.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatDMatMultExpr.h:270
Header file for the TSVecDMatMultExprTrait class template.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatDMatMultExpr.h:218
Header file for the IsUpper type trait.
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:328
Constraint on the data type.
BLAZE_ALWAYS_INLINE 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:225
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
#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.
BLAZE_ALWAYS_INLINE 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:849