35 #ifndef _BLAZE_MATH_EXPRESSIONS_TDMATTSMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TDMATTSMATMULTEXPR_H_
113 template<
typename MT1
115 class TDMatTSMatMultExpr :
public DenseMatrix< TDMatTSMatMultExpr<MT1,MT2>, true >
116 ,
private MatMatMultExpr
117 ,
private Computation
147 template<
typename T1,
typename T2,
typename T3 >
148 struct CanExploitSymmetry {
149 enum { value = IsRowMajorMatrix<T1>::value &&
150 ( IsSymmetric<T2>::value || IsSymmetric<T3>::value ) };
161 template<
typename T1,
typename T2,
typename T3 >
162 struct IsEvaluationRequired {
163 enum { value = ( evaluateLeft || evaluateRight ) &&
164 !CanExploitSymmetry<T1,T2,T3>::value };
174 template<
typename T1,
typename T2,
typename T3 >
175 struct UseVectorizedKernel {
176 enum { value = T1::vectorizable && T2::vectorizable &&
177 IsColumnMajorMatrix<T1>::value &&
178 IsSame<typename T1::ElementType,typename T2::ElementType>::value &&
179 IsSame<typename T1::ElementType,typename T3::ElementType>::value &&
180 IntrinsicTrait<typename T1::ElementType>::addition &&
181 IntrinsicTrait<typename T1::ElementType>::subtraction &&
182 IntrinsicTrait<typename T1::ElementType>::multiplication };
193 template<
typename T1,
typename T2,
typename T3 >
194 struct UseOptimizedKernel {
195 enum { value = !UseVectorizedKernel<T1,T2,T3>::value &&
196 !IsResizable<typename T1::ElementType>::value &&
197 !IsResizable<ET1>::value };
207 template<
typename T1,
typename T2,
typename T3 >
208 struct UseDefaultKernel {
209 enum { value = !UseVectorizedKernel<T1,T2,T3>::value &&
210 !UseOptimizedKernel<T1,T2,T3>::value };
241 enum { vectorizable = MT1::vectorizable &&
247 enum { smpAssignable = !evaluateLeft && MT1::smpAssignable &&
248 !evaluateRight && MT2::smpAssignable };
281 if(
lhs_.columns() == 0UL )
289 const ConstIterator
end( B.end(j) );
290 ConstIterator element( B.begin(j) );
297 tmp =
lhs_(i,element->index()) * element->value();
299 for( ; element!=
end; ++element )
300 tmp +=
lhs_(i,element->index()) * element->value();
306 for(
size_t k=1UL; k<
lhs_.columns(); ++k ) {
331 return rhs_.columns();
361 template<
typename T >
363 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
373 template<
typename T >
375 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
385 return lhs_.isAligned();
418 template<
typename MT
438 TDMatTSMatMultExpr::selectAssignKernel( ~lhs, A, B );
457 template<
typename MT3
464 const size_t iend( A.rows() &
size_t(-4) );
467 for(
size_t i=0UL; i<iend; i+=4UL ) {
468 for(
size_t j=0UL; j<B.columns(); ++j )
470 ConstIterator element( B.begin(j) );
471 const ConstIterator
end( B.end(j) );
473 if( element ==
end ) {
475 reset( (~C)(i+1UL,j) );
476 reset( (~C)(i+2UL,j) );
477 reset( (~C)(i+3UL,j) );
481 (~C)(i ,j) = A(i ,element->index()) * element->value();
482 (~C)(i+1UL,j) = A(i+1UL,element->index()) * element->value();
483 (~C)(i+2UL,j) = A(i+2UL,element->index()) * element->value();
484 (~C)(i+3UL,j) = A(i+3UL,element->index()) * element->value();
486 for( ; element!=
end; ++element ) {
487 (~C)(i ,j) += A(i ,element->index()) * element->value();
488 (~C)(i+1UL,j) += A(i+1UL,element->index()) * element->value();
489 (~C)(i+2UL,j) += A(i+2UL,element->index()) * element->value();
490 (~C)(i+3UL,j) += A(i+3UL,element->index()) * element->value();
495 for(
size_t i=iend; i<A.rows(); ++i ) {
496 for(
size_t j=0UL; j<B.columns(); ++j )
498 ConstIterator element( B.begin(j) );
499 const ConstIterator
end( B.end(j) );
501 if( element ==
end ) {
506 (~C)(i,j) = A(i,element->index()) * element->value();
508 for( ; element!=
end; ++element )
509 (~C)(i,j) += A(i,element->index()) * element->value();
530 template<
typename MT3
533 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
534 selectAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
538 for(
size_t j=0UL; j<B.columns(); ++j ) {
539 for(
size_t i=0UL; i<(~C).
rows(); ++i ) {
542 ConstIterator element( B.begin(j) );
543 const ConstIterator
end( B.end(j) );
544 for( ; element!=
end; ++element ) {
545 for(
size_t i=0UL; i<A.rows(); ++i ) {
547 (~C)(i,j) = A(i,element->index()) * element->value();
549 (~C)(i,j) += A(i,element->index()) * element->value();
571 template<
typename MT3
574 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
575 selectAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
579 const size_t iend( A.rows() & size_t(-4) );
584 for(
size_t j=0UL; j<B.columns(); ++j )
586 const ConstIterator
end( B.end(j) );
587 ConstIterator element( B.begin(j) );
589 const size_t kend( B.nonZeros(j) & size_t(-4) );
591 for(
size_t k=0UL; k<kend; k+=4UL ) {
592 const size_t j1( element->index() );
593 const ET2 v1( element->value() );
595 const size_t j2( element->index() );
596 const ET2 v2( element->value() );
598 const size_t j3( element->index() );
599 const ET2 v3( element->value() );
601 const size_t j4( element->index() );
602 const ET2 v4( element->value() );
605 for(
size_t i=0UL; i<iend; i+=4UL ) {
606 (~C)(i ,j) += A(i ,j1) * v1 + A(i ,j2) * v2 + A(i ,j3) * v3 + A(i ,j4) * v4;
607 (~C)(i+1UL,j) += A(i+1UL,j1) * v1 + A(i+1UL,j2) * v2 + A(i+1UL,j3) * v3 + A(i+1UL,j4) * v4;
608 (~C)(i+2UL,j) += A(i+2UL,j1) * v1 + A(i+2UL,j2) * v2 + A(i+2UL,j3) * v3 + A(i+2UL,j4) * v4;
609 (~C)(i+3UL,j) += A(i+3UL,j1) * v1 + A(i+3UL,j2) * v2 + A(i+3UL,j3) * v3 + A(i+3UL,j4) * v4;
611 for(
size_t i=iend; i<A.rows(); ++i ) {
612 (~C)(i,j) += A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
616 for( ; element!=
end; ++element ) {
617 for(
size_t i=0UL; i<iend; i+=4UL ) {
618 (~C)(i ,j) += A(i ,element->index()) * element->value();
619 (~C)(i+1UL,j) += A(i+1UL,element->index()) * element->value();
620 (~C)(i+2UL,j) += A(i+2UL,element->index()) * element->value();
621 (~C)(i+3UL,j) += A(i+3UL,element->index()) * element->value();
623 for(
size_t i=iend; i<A.rows(); ++i ) {
624 (~C)(i,j) += A(i,element->index()) * element->value();
646 template<
typename MT3
649 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
650 selectAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
652 typedef IntrinsicTrait<ElementType> IT;
655 const size_t M( A.rows() );
659 for(
size_t j=0UL; j<B.columns(); ++j )
661 const ConstIterator
end( B.end(j) );
662 ConstIterator element( B.begin(j) );
664 const size_t kend( B.nonZeros(j) & size_t(-4) );
666 for(
size_t k=0UL; k<kend; k+=4UL ) {
667 const size_t j1( element->index() );
670 const size_t j2( element->index() );
673 const size_t j3( element->index() );
676 const size_t j4( element->index() );
680 for(
size_t i=0UL; i<M; i+=
IT::size ) {
681 (~C).
store( i, j, (~C).load(i,j) + A.load(i,j1) * v1 + A.load(i,j2) * v2 + A.load(i,j3) * v3 + A.load(i,j4) * v4 );
685 for( ; element!=
end; ++element ) {
686 const size_t j1( element->index() );
689 for(
size_t i=0UL; i<M; i+=
IT::size ) {
690 (~C).
store( i, j, (~C).load(i,j) + A.load(i,j1) * v1 );
711 template<
typename MT
713 friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
718 typedef typename SelectType< SO, ResultType, OppositeType >::Type TmpType;
730 const TmpType tmp(
serial( rhs ) );
751 template<
typename MT >
752 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
762 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
764 else if( IsSymmetric<MT1>::value )
785 template<
typename MT
787 friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
805 TDMatTSMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
824 template<
typename MT3
827 static inline void selectAddAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
831 const size_t iend( A.rows() & size_t(-4) );
834 for(
size_t i=0UL; i<iend; i+=4UL ) {
835 for(
size_t j=0UL; j<B.columns(); ++j )
837 ConstIterator element( B.begin(j) );
838 const ConstIterator
end( B.end(j) );
840 for( ; element!=
end; ++element ) {
841 (~C)(i ,j) += A(i ,element->index()) * element->value();
842 (~C)(i+1UL,j) += A(i+1UL,element->index()) * element->value();
843 (~C)(i+2UL,j) += A(i+2UL,element->index()) * element->value();
844 (~C)(i+3UL,j) += A(i+3UL,element->index()) * element->value();
849 for(
size_t i=iend; i<A.rows(); ++i ) {
850 for(
size_t j=0UL; j<B.columns(); ++j )
852 ConstIterator element( B.begin(j) );
853 const ConstIterator
end( B.end(j) );
855 for( ; element!=
end; ++element )
856 (~C)(i,j) += A(i,element->index()) * element->value();
877 template<
typename MT3
880 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
881 selectAddAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
885 for(
size_t j=0UL; j<B.columns(); ++j ) {
886 ConstIterator element( B.begin(j) );
887 const ConstIterator
end( B.end(j) );
888 for( ; element!=
end; ++element ) {
889 for(
size_t i=0UL; i<A.rows(); ++i ) {
891 (~C)(i,j) = A(i,element->index()) * element->value();
893 (~C)(i,j) += A(i,element->index()) * element->value();
915 template<
typename MT3
918 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
919 selectAddAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
923 const size_t iend( A.rows() & size_t(-4) );
926 for(
size_t j=0UL; j<B.columns(); ++j )
928 const ConstIterator
end( B.end(j) );
929 ConstIterator element( B.begin(j) );
931 const size_t kend( B.nonZeros(j) & size_t(-4) );
933 for(
size_t k=0UL; k<kend; k+=4UL ) {
934 const size_t j1( element->index() );
935 const ET2 v1( element->value() );
937 const size_t j2( element->index() );
938 const ET2 v2( element->value() );
940 const size_t j3( element->index() );
941 const ET2 v3( element->value() );
943 const size_t j4( element->index() );
944 const ET2 v4( element->value() );
947 for(
size_t i=0UL; i<iend; i+=4UL ) {
948 (~C)(i ,j) += A(i ,j1) * v1 + A(i ,j2) * v2 + A(i ,j3) * v3 + A(i ,j4) * v4;
949 (~C)(i+1UL,j) += A(i+1UL,j1) * v1 + A(i+1UL,j2) * v2 + A(i+1UL,j3) * v3 + A(i+1UL,j4) * v4;
950 (~C)(i+2UL,j) += A(i+2UL,j1) * v1 + A(i+2UL,j2) * v2 + A(i+2UL,j3) * v3 + A(i+2UL,j4) * v4;
951 (~C)(i+3UL,j) += A(i+3UL,j1) * v1 + A(i+3UL,j2) * v2 + A(i+3UL,j3) * v3 + A(i+3UL,j4) * v4;
953 for(
size_t i=iend; i<A.rows(); ++i ) {
954 (~C)(i,j) += A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
958 for( ; element!=
end; ++element ) {
959 for(
size_t i=0UL; i<iend; i+=4UL ) {
960 (~C)(i ,j) += A(i ,element->index()) * element->value();
961 (~C)(i+1UL,j) += A(i+1UL,element->index()) * element->value();
962 (~C)(i+2UL,j) += A(i+2UL,element->index()) * element->value();
963 (~C)(i+3UL,j) += A(i+3UL,element->index()) * element->value();
965 for(
size_t i=iend; i<A.rows(); ++i ) {
966 (~C)(i,j) += A(i,element->index()) * element->value();
988 template<
typename MT3
991 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
992 selectAddAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
994 typedef IntrinsicTrait<ElementType> IT;
997 const size_t M( A.rows() );
999 for(
size_t j=0UL; j<B.columns(); ++j )
1001 const ConstIterator
end( B.end(j) );
1002 ConstIterator element( B.begin(j) );
1004 const size_t kend( B.nonZeros(j) & size_t(-4) );
1006 for(
size_t k=0UL; k<kend; k+=4UL ) {
1007 const size_t j1( element->index() );
1010 const size_t j2( element->index() );
1013 const size_t j3( element->index() );
1016 const size_t j4( element->index() );
1020 for(
size_t i=0UL; i<M; i+=
IT::size ) {
1021 (~C).
store( i, j, (~C).load(i,j) + A.load(i,j1) * v1 + A.load(i,j2) * v2 + A.load(i,j3) * v3 + A.load(i,j4) * v4 );
1025 for( ; element!=
end; ++element ) {
1026 const size_t j1( element->index() );
1029 for(
size_t i=0UL; i<M; i+=
IT::size ) {
1030 (~C).
store( i, j, (~C).load(i,j) + A.load(i,j1) * v1 );
1053 template<
typename MT >
1054 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1064 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
1066 else if( IsSymmetric<MT1>::value )
1091 template<
typename MT
1110 TDMatTSMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1129 template<
typename MT3
1132 static inline void selectSubAssignKernel( DenseMatrix<MT3,false>& C,
const MT4& A,
const MT5& B )
1136 const size_t iend( A.rows() & size_t(-4) );
1139 for(
size_t i=0UL; i<iend; i+=4UL ) {
1140 for(
size_t j=0UL; j<B.columns(); ++j )
1142 ConstIterator element( B.begin(j) );
1143 const ConstIterator
end( B.end(j) );
1145 for( ; element!=
end; ++element ) {
1146 (~C)(i ,j) -= A(i ,element->index()) * element->value();
1147 (~C)(i+1UL,j) -= A(i+1UL,element->index()) * element->value();
1148 (~C)(i+2UL,j) -= A(i+2UL,element->index()) * element->value();
1149 (~C)(i+3UL,j) -= A(i+3UL,element->index()) * element->value();
1154 for(
size_t i=iend; i<A.rows(); ++i ) {
1155 for(
size_t j=0UL; j<B.columns(); ++j )
1157 ConstIterator element( B.begin(j) );
1158 const ConstIterator
end( B.end(j) );
1160 for( ; element!=
end; ++element )
1161 (~C)(i,j) -= A(i,element->index()) * element->value();
1182 template<
typename MT3
1185 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
1186 selectSubAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
1190 for(
size_t j=0UL; j<B.columns(); ++j ) {
1191 ConstIterator element( B.begin(j) );
1192 const ConstIterator
end( B.end(j) );
1193 for( ; element!=
end; ++element ) {
1194 for(
size_t i=0UL; i<A.rows(); ++i ) {
1196 (~C)(i,j) = -A(i,element->index()) * element->value();
1198 (~C)(i,j) -= A(i,element->index()) * element->value();
1220 template<
typename MT3
1223 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
1224 selectSubAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
1228 const size_t iend( A.rows() & size_t(-4) );
1231 for(
size_t j=0UL; j<B.columns(); ++j )
1233 const ConstIterator
end( B.end(j) );
1234 ConstIterator element( B.begin(j) );
1236 const size_t kend( B.nonZeros(j) & size_t(-4) );
1238 for(
size_t k=0UL; k<kend; k+=4UL ) {
1239 const size_t j1( element->index() );
1240 const ET2 v1( element->value() );
1242 const size_t j2( element->index() );
1243 const ET2 v2( element->value() );
1245 const size_t j3( element->index() );
1246 const ET2 v3( element->value() );
1248 const size_t j4( element->index() );
1249 const ET2 v4( element->value() );
1252 for(
size_t i=0UL; i<iend; i+=4UL ) {
1253 (~C)(i ,j) -= A(i ,j1) * v1 + A(i ,j2) * v2 + A(i ,j3) * v3 + A(i ,j4) * v4;
1254 (~C)(i+1UL,j) -= A(i+1UL,j1) * v1 + A(i+1UL,j2) * v2 + A(i+1UL,j3) * v3 + A(i+1UL,j4) * v4;
1255 (~C)(i+2UL,j) -= A(i+2UL,j1) * v1 + A(i+2UL,j2) * v2 + A(i+2UL,j3) * v3 + A(i+2UL,j4) * v4;
1256 (~C)(i+3UL,j) -= A(i+3UL,j1) * v1 + A(i+3UL,j2) * v2 + A(i+3UL,j3) * v3 + A(i+3UL,j4) * v4;
1258 for(
size_t i=iend; i<A.rows(); ++i ) {
1259 (~C)(i,j) -= A(i,j1) * v1 + A(i,j2) * v2 + A(i,j3) * v3 + A(i,j4) * v4;
1263 for( ; element!=
end; ++element ) {
1264 for(
size_t i=0UL; i<iend; i+=4UL ) {
1265 (~C)(i ,j) -= A(i ,element->index()) * element->value();
1266 (~C)(i+1UL,j) -= A(i+1UL,element->index()) * element->value();
1267 (~C)(i+2UL,j) -= A(i+2UL,element->index()) * element->value();
1268 (~C)(i+3UL,j) -= A(i+3UL,element->index()) * element->value();
1270 for(
size_t i=iend; i<A.rows(); ++i ) {
1271 (~C)(i,j) -= A(i,element->index()) * element->value();
1293 template<
typename MT3
1296 static inline typename EnableIf< UseVectorizedKernel<MT3,MT4,MT5> >::Type
1297 selectSubAssignKernel( DenseMatrix<MT3,true>& C,
const MT4& A,
const MT5& B )
1299 typedef IntrinsicTrait<ElementType> IT;
1302 const size_t M( A.rows() );
1304 for(
size_t j=0UL; j<B.columns(); ++j )
1306 const ConstIterator
end( B.end(j) );
1307 ConstIterator element( B.begin(j) );
1309 const size_t kend( B.nonZeros(j) & size_t(-4) );
1311 for(
size_t k=0UL; k<kend; k+=4UL ) {
1312 const size_t j1( element->index() );
1315 const size_t j2( element->index() );
1318 const size_t j3( element->index() );
1321 const size_t j4( element->index() );
1325 for(
size_t i=0UL; i<M; i+=
IT::size ) {
1326 (~C).
store( i, j, (~C).load(i,j) - A.load(i,j1) * v1 - A.load(i,j2) * v2 - A.load(i,j3) * v3 - A.load(i,j4) * v4 );
1330 for( ; element!=
end; ++element ) {
1331 const size_t j1( element->index() );
1334 for(
size_t i=0UL; i<M; i+=
IT::size ) {
1335 (~C).
store( i, j, (~C).load(i,j) - A.load(i,j1) * v1 );
1359 template<
typename MT >
1360 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1370 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
1372 else if( IsSymmetric<MT1>::value )
1408 template<
typename MT
1410 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1449 template<
typename MT
1451 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1456 typedef typename SelectType< SO, ResultType, OppositeType >::Type TmpType;
1468 const TmpType tmp( rhs );
1489 template<
typename MT >
1490 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1500 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
1502 else if( IsSymmetric<MT1>::value )
1526 template<
typename MT
1528 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1567 template<
typename MT >
1568 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1578 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
1580 else if( IsSymmetric<MT1>::value )
1608 template<
typename MT
1610 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1649 template<
typename MT >
1650 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1660 if( IsSymmetric<MT1>::value && IsSymmetric<MT2>::value )
1662 else if( IsSymmetric<MT1>::value )
1732 template<
typename T1
1734 inline const TDMatTSMatMultExpr<T1,T2>
1740 throw std::invalid_argument(
"Matrix sizes do not match" );
1757 template<
typename MT1,
typename MT2 >
1775 template<
typename MT1,
typename MT2 >
1777 :
public Columns<MT2>
1793 template<
typename MT1,
typename MT2 >
1795 :
public IsTrue< IsLower<MT1>::value && IsLower<MT2>::value >
1811 template<
typename MT1,
typename MT2 >
1813 :
public IsTrue< IsUpper<MT1>::value && IsUpper<MT2>::value >
1829 template<
typename MT1,
typename MT2,
typename VT >
1834 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1835 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1836 IsDenseVector<VT>::value && IsColumnVector<VT>::value
1837 ,
typename TDMatDVecMultExprTrait< MT1, typename TSMatDVecMultExprTrait<MT2,VT>::Type >::Type
1838 , INVALID_TYPE >::Type Type;
1847 template<
typename MT1,
typename MT2,
typename VT >
1852 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1853 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1854 IsSparseVector<VT>::value && IsColumnVector<VT>::value
1855 ,
typename TDMatDVecMultExprTrait< MT1, typename TSMatDVecMultExprTrait<MT2,VT>::Type >::Type
1856 , INVALID_TYPE >::Type Type;
1865 template<
typename VT,
typename MT1,
typename MT2 >
1870 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1871 IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1872 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value
1873 ,
typename TDVecTSMatMultExprTrait< typename TDVecTDMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1874 , INVALID_TYPE >::Type Type;
1883 template<
typename VT,
typename MT1,
typename MT2 >
1888 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1889 IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1890 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value
1891 ,
typename TDVecTSMatMultExprTrait< typename TSVecTDMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
1892 , INVALID_TYPE >::Type Type;
1901 template<
typename MT1,
typename MT2,
bool AF >
1906 typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT1,AF>::Type
1907 ,
typename SubmatrixExprTrait<const MT2,AF>::Type >::Type Type;
1916 template<
typename MT1,
typename MT2 >
1921 typedef typename MultExprTrait< typename RowExprTrait<const MT1>::Type, MT2 >::Type Type;
1930 template<
typename MT1,
typename MT2 >
1935 typedef typename MultExprTrait< MT1, typename ColumnExprTrait<const MT2>::Type >::Type Type;
RT1::ElementType ET1
Element type of the left-hand side dense matrix expression.
Definition: TDMatTSMatMultExpr.h:123
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
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
Expression object for transpose dense matrix-transpose sparse matrix multiplications.The TDMatTSMatMultExpr class represents the compile time expression for multiplications between a column-major dense matrix and a column-major sparse matrix.
Definition: Forward.h:132
Header file for the IsSparseMatrix type trait.
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:79
Header file for the ColumnExprTrait class template.
Header file for the IsColumnMajorMatrix type trait.
const ResultType CompositeType
Data type for composite expression templates.
Definition: TDMatTSMatMultExpr.h:224
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
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.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:158
Header file for the RequiresEvaluation type trait.
SelectType< IsExpression< MT1 >::value, const MT1, const MT1 & >::Type LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: TDMatTSMatMultExpr.h:227
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:107
size_t rows() const
Returns the current number of rows of the matrix.
Definition: TDMatTSMatMultExpr.h:320
Constraint on the data type.
TDMatTSMatMultExpr(const MT1 &lhs, const MT2 &rhs)
Constructor for the TDMatTSMatMultExpr class.
Definition: TDMatTSMatMultExpr.h:257
Constraint on the data type.
Constraint on the data type.
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const size_t SMP_TDMATTSMATMULT_THRESHOLD
SMP column-major dense matrix/column-major sparse matrix multiplication threshold.This threshold specifies when a column-major dense matrix/column-major sparse matrix multiplication can be executed in parallel. In case the number of rows/columns of the target matrix is larger or equal to this threshold, the operation is executed in parallel. If the number of rows/columns is below this threshold the operation is executed single-threaded.
Definition: Thresholds.h:995
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: TDMatTSMatMultExpr.h:222
MT2::CompositeType CT2
Composite type of the right-hand side sparse matrix expression.
Definition: TDMatTSMatMultExpr.h:126
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the DisableIf class template.
MT1::CompositeType CT1
Composite type of the left-hand side dense matrix expression.
Definition: TDMatTSMatMultExpr.h:125
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
Header file for the TSVecTDMatMultExprTrait class template.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: TDMatTSMatMultExpr.h:272
Header file for the TDMatSVecMultExprTrait class template.
Header file for the TDVecTSMatMultExprTrait class template.
Header file for the DenseMatrix base class.
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 TSMatDVecMultExprTrait class template.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: TDMatTSMatMultExpr.h:394
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: TDMatTSMatMultExpr.h:384
Header file for the IsLower type trait.
LeftOperand leftOperand() const
Returns the left-hand side transpose dense matrix operand.
Definition: TDMatTSMatMultExpr.h:340
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:78
RightOperand rightOperand() const
Returns the right-hand side transpose sparse matrix operand.
Definition: TDMatTSMatMultExpr.h:350
Constraints on the storage order of matrix types.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Header file for the IsDenseMatrix type trait.
ResultType::ElementType ElementType
Resulting element type.
Definition: TDMatTSMatMultExpr.h:221
Header file for the EnableIf class template.
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
LeftOperand lhs_
Left-hand side dense matrix of the multiplication expression.
Definition: TDMatTSMatMultExpr.h:401
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
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
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
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
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
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TDMatTSMatMultExpr.h:223
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: TDMatTSMatMultExpr.h:220
Header file for the reset shim.
Header file for the isDefault shim.
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: TDMatTSMatMultExpr.h:362
BLAZE_ALWAYS_INLINE bool isDefault(const NonNumericProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: NonNumericProxy.h:874
MT1::ResultType RT1
Result type of the left-hand side dense matrix expression.
Definition: TDMatTSMatMultExpr.h:121
BLAZE_ALWAYS_INLINE void reset(const NonNumericProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: NonNumericProxy.h:833
RT2::ElementType ET2
Element type of the right-hand side sparse matrix expression.
Definition: TDMatTSMatMultExpr.h:124
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: TDMatTSMatMultExpr.h:219
Header file for the RemoveReference type trait.
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.In case either of the two given data types T1 or T2 is not a matrix type ...
Definition: StorageOrder.h:283
Header file for the IsDenseVector type trait.
Header file for all intrinsic functionality.
SelectType< evaluateRight, const RT2, CT2 >::Type RT
Type for the assignment of the right-hand side sparse matrix operand.
Definition: TDMatTSMatMultExpr.h:236
TDMatTSMatMultExpr< MT1, MT2 > This
Type of this TDMatTSMatMultExpr instance.
Definition: TDMatTSMatMultExpr.h:217
MT2::ResultType RT2
Result type of the right-hand side sparse matrix expression.
Definition: TDMatTSMatMultExpr.h:122
SelectType< evaluateLeft, const RT1, CT1 >::Type LT
Type for the assignment of the left-hand side dense matrix operand.
Definition: TDMatTSMatMultExpr.h:233
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.
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
Header file for the TDMatDVecMultExprTrait class template.
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: TDMatTSMatMultExpr.h:374
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
Header file for the IsTrue value trait.
Header file for basic type definitions.
SelectType< IsExpression< MT2 >::value, const MT2, const MT2 & >::Type RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TDMatTSMatMultExpr.h:230
Header file for the IsUpper type trait.
RightOperand rhs_
Right-hand side sparse matrix of the multiplication expression.
Definition: TDMatTSMatMultExpr.h:402
Header file for the IsColumnVector type trait.
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.
Size type of the Blaze library.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the TDVecTDMatMultExprTrait class template.
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:79
Header file for the IsExpression type trait class.
Header file for the TSMatSVecMultExprTrait class template.
Header file for the FunctionTrace class.
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: TDMatTSMatMultExpr.h:218
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
size_t columns() const
Returns the current number of columns of the matrix.
Definition: TDMatTSMatMultExpr.h:330