35 #ifndef _BLAZE_MATH_EXPRESSIONS_TDMATSMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TDMATSMATMULTEXPR_H_
125 template<
typename MT1
127 class TDMatSMatMultExpr :
public DenseMatrix< TDMatSMatMultExpr<MT1,MT2>, true >
128 ,
private MatMatMultExpr
129 ,
private Computation
158 template<
typename T1,
typename T2,
typename T3 >
159 struct CanExploitSymmetry {
160 enum { value = IsSymmetric<T3>::value };
171 template<
typename T1,
typename T2,
typename T3 >
172 struct IsEvaluationRequired {
173 enum { value = ( evaluateLeft || evaluateRight ) &&
174 !CanExploitSymmetry<T1,T2,T3>::value };
185 template<
typename T1,
typename T2,
typename T3 >
186 struct UseOptimizedKernel {
188 !IsDiagonal<T2>::value &&
189 !IsResizable<typename T1::ElementType>::value &&
190 !( IsColumnMajorMatrix<T1>::value && IsResizable<ET2>::value ) };
200 template<
typename T1,
typename T2,
typename T3 >
201 struct UseDefaultKernel {
202 enum { value = !UseOptimizedKernel<T1,T2,T3>::value };
232 enum { vectorizable = 0 };
235 enum { smpAssignable = !evaluateLeft && MT1::smpAssignable &&
236 !evaluateRight && MT2::smpAssignable };
279 :(
lhs_.columns() ) ) );
281 if(
lhs_.columns() == 0UL ||
285 ElementType tmp(
lhs_(i,kbegin) *
rhs_(kbegin,j) );
286 for(
size_t k=kbegin+1UL; k<kend; ++k ) {
302 inline ReturnType
at(
size_t i,
size_t j )
const {
303 if( i >=
lhs_.rows() ) {
306 if( j >=
rhs_.columns() ) {
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 lhs_.isAligned();
393 return (
columns() > SMP_TDMATSMATMULT_THRESHOLD );
416 template<
typename MT
426 LT A(
serial( rhs.lhs_ ) );
427 RT B(
serial( rhs.rhs_ ) );
436 TDMatSMatMultExpr::selectAssignKernel( ~lhs, A, B );
452 template<
typename MT3
455 static inline void selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
457 if( C.rows() * C.columns() < TDMATSMATMULT_THRESHOLD )
458 selectSmallAssignKernel( C, A, B );
460 selectLargeAssignKernel( C, A, B );
480 template<
typename MT3
483 static inline void selectDefaultAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
489 for(
size_t j=0UL; j<B.rows(); ++j )
491 ConstIterator element( B.begin(j) );
492 const ConstIterator
end( B.end(j) );
494 if( IsDiagonal<MT4>::value )
496 for( ; element!=
end; ++element ) {
497 C(j,element->index()) = A(j,j) * element->value();
502 const size_t ibegin( ( IsLower<MT4>::value )
503 ?( IsStrictlyLower<MT4>::value ? j+1UL : j )
505 const size_t iend( ( IsUpper<MT4>::value )
506 ?( IsStrictlyUpper<MT4>::value ? j : j+1UL )
510 for( ; element!=
end; ++element ) {
511 for(
size_t i=ibegin; i<iend; ++i ) {
513 C(i,element->index()) = A(i,j) * element->value();
515 C(i,element->index()) += A(i,j) * element->value();
538 template<
typename MT3
541 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
542 selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
544 selectDefaultAssignKernel( C, A, B );
564 template<
typename MT3
567 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
568 selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
576 for(
size_t j=0UL; j<B.rows(); ++j )
578 ConstIterator element( B.begin(j) );
579 const ConstIterator
end( B.end(j) );
581 const size_t nonzeros( B.nonZeros(j) );
582 const size_t kpos( nonzeros &
size_t(-4) );
585 const size_t ibegin( ( IsLower<MT4>::value )
586 ?( IsStrictlyLower<MT4>::value ? j+1UL : j )
588 const size_t iend( ( IsUpper<MT4>::value )
589 ?( IsStrictlyUpper<MT4>::value ? j : j+1UL )
593 const size_t inum( iend - ibegin );
594 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
597 for(
size_t k=0UL; k<kpos; k+=4UL )
599 const size_t j1( element->index() );
600 const ET2 v1( element->value() );
602 const size_t j2( element->index() );
603 const ET2 v2( element->value() );
605 const size_t j3( element->index() );
606 const ET2 v3( element->value() );
608 const size_t j4( element->index() );
609 const ET2 v4( element->value() );
614 for( i=ibegin; i<ipos; i+=4UL ) {
615 C(i ,j1) += A(i ,j) * v1;
616 C(i+1UL,j1) += A(i+1UL,j) * v1;
617 C(i+2UL,j1) += A(i+2UL,j) * v1;
618 C(i+3UL,j1) += A(i+3UL,j) * v1;
619 C(i ,j2) += A(i ,j) * v2;
620 C(i+1UL,j2) += A(i+1UL,j) * v2;
621 C(i+2UL,j2) += A(i+2UL,j) * v2;
622 C(i+3UL,j2) += A(i+3UL,j) * v2;
623 C(i ,j3) += A(i ,j) * v3;
624 C(i+1UL,j3) += A(i+1UL,j) * v3;
625 C(i+2UL,j3) += A(i+2UL,j) * v3;
626 C(i+3UL,j3) += A(i+3UL,j) * v3;
627 C(i ,j4) += A(i ,j) * v4;
628 C(i+1UL,j4) += A(i+1UL,j) * v4;
629 C(i+2UL,j4) += A(i+2UL,j) * v4;
630 C(i+3UL,j4) += A(i+3UL,j) * v4;
632 for( ; i<iend; ++i ) {
633 C(i,j1) += A(i,j) * v1;
634 C(i,j2) += A(i,j) * v2;
635 C(i,j3) += A(i,j) * v3;
636 C(i,j4) += A(i,j) * v4;
640 for( ; element!=
end; ++element )
642 const size_t j1( element->index() );
643 const ET2 v1( element->value() );
645 for( i=ibegin; i<ipos; i+=4UL ) {
646 C(i ,j1) += A(i ,j) * v1;
647 C(i+1UL,j1) += A(i+1UL,j) * v1;
648 C(i+2UL,j1) += A(i+2UL,j) * v1;
649 C(i+3UL,j1) += A(i+3UL,j) * v1;
651 for( ; i<iend; ++i ) {
652 C(i,j1) += A(i,j) * v1;
674 template<
typename MT3
677 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
678 selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
680 selectDefaultAssignKernel( C, A, B );
700 template<
typename MT3
703 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
704 selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
709 assign( C, A * tmp );
727 template<
typename MT
729 friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
734 typedef typename SelectType< SO, ResultType, OppositeType >::Type TmpType;
746 const TmpType tmp(
serial( rhs ) );
767 template<
typename MT
769 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
779 assign( ~lhs, rhs.lhs_ *
trans( rhs.rhs_ ) );
797 template<
typename MT
799 friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
807 LT A(
serial( rhs.lhs_ ) );
808 RT B(
serial( rhs.rhs_ ) );
817 TDMatSMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
833 template<
typename MT3
836 static inline void selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
838 if( C.rows() * C.columns() < TDMATSMATMULT_THRESHOLD )
839 selectSmallAddAssignKernel( C, A, B );
841 selectLargeAddAssignKernel( C, A, B );
861 template<
typename MT3
864 static inline void selectDefaultAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
870 for(
size_t j=0UL; j<B.rows(); ++j )
872 ConstIterator element( B.begin(j) );
873 const ConstIterator
end( B.end(j) );
875 if( IsDiagonal<MT4>::value )
877 for( ; element!=
end; ++element ) {
878 C(j,element->index()) += A(j,j) * element->value();
883 const size_t ibegin( ( IsLower<MT4>::value )
884 ?( IsStrictlyLower<MT4>::value ? j+1UL : j )
886 const size_t iend( ( IsUpper<MT4>::value )
887 ?( IsStrictlyUpper<MT4>::value ? j : j+1UL )
891 const size_t inum( iend - ibegin );
892 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
895 for( ; element!=
end; ++element ) {
896 for( i=ibegin; i<ipos; i+=4UL ) {
897 C(i ,element->index()) += A(i ,j) * element->value();
898 C(i+1UL,element->index()) += A(i+1UL,j) * element->value();
899 C(i+2UL,element->index()) += A(i+2UL,j) * element->value();
900 C(i+3UL,element->index()) += A(i+3UL,j) * element->value();
902 for( ; i<iend; ++i ) {
903 C(i,element->index()) += A(i,j) * element->value();
926 template<
typename MT3
929 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
930 selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
932 selectDefaultAddAssignKernel( C, A, B );
952 template<
typename MT3
955 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
956 selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
962 for(
size_t j=0UL; j<B.rows(); ++j )
964 ConstIterator element( B.begin(j) );
965 const ConstIterator
end( B.end(j) );
967 const size_t nonzeros( B.nonZeros(j) );
968 const size_t kpos( nonzeros &
size_t(-4) );
971 const size_t ibegin( ( IsLower<MT4>::value )
972 ?( IsStrictlyLower<MT4>::value ? j+1UL : j )
974 const size_t iend( ( IsUpper<MT4>::value )
975 ?( IsStrictlyUpper<MT4>::value ? j : j+1UL )
979 const size_t inum( iend - ibegin );
980 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
983 for(
size_t k=0UL; k<kpos; k+=4UL )
985 const size_t j1( element->index() );
986 const ET2 v1( element->value() );
988 const size_t j2( element->index() );
989 const ET2 v2( element->value() );
991 const size_t j3( element->index() );
992 const ET2 v3( element->value() );
994 const size_t j4( element->index() );
995 const ET2 v4( element->value() );
1000 for( i=ibegin; i<ipos; i+=4UL ) {
1001 C(i ,j1) += A(i ,j) * v1;
1002 C(i+1UL,j1) += A(i+1UL,j) * v1;
1003 C(i+2UL,j1) += A(i+2UL,j) * v1;
1004 C(i+3UL,j1) += A(i+3UL,j) * v1;
1005 C(i ,j2) += A(i ,j) * v2;
1006 C(i+1UL,j2) += A(i+1UL,j) * v2;
1007 C(i+2UL,j2) += A(i+2UL,j) * v2;
1008 C(i+3UL,j2) += A(i+3UL,j) * v2;
1009 C(i ,j3) += A(i ,j) * v3;
1010 C(i+1UL,j3) += A(i+1UL,j) * v3;
1011 C(i+2UL,j3) += A(i+2UL,j) * v3;
1012 C(i+3UL,j3) += A(i+3UL,j) * v3;
1013 C(i ,j4) += A(i ,j) * v4;
1014 C(i+1UL,j4) += A(i+1UL,j) * v4;
1015 C(i+2UL,j4) += A(i+2UL,j) * v4;
1016 C(i+3UL,j4) += A(i+3UL,j) * v4;
1018 for( ; i<iend; ++i ) {
1019 C(i,j1) += A(i,j) * v1;
1020 C(i,j2) += A(i,j) * v2;
1021 C(i,j3) += A(i,j) * v3;
1022 C(i,j4) += A(i,j) * v4;
1026 for( ; element!=
end; ++element )
1028 const size_t j1( element->index() );
1029 const ET2 v1( element->value() );
1031 for( i=ibegin; i<ipos; i+=4UL ) {
1032 C(i ,j1) += A(i ,j) * v1;
1033 C(i+1UL,j1) += A(i+1UL,j) * v1;
1034 C(i+2UL,j1) += A(i+2UL,j) * v1;
1035 C(i+3UL,j1) += A(i+3UL,j) * v1;
1037 for( ; i<iend; ++i ) {
1038 C(i,j1) += A(i,j) * v1;
1060 template<
typename MT3
1063 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
1064 selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1066 selectDefaultAddAssignKernel( C, A, B );
1086 template<
typename MT3
1089 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
1090 selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1095 addAssign( C, A * tmp );
1115 template<
typename MT
1117 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1125 addAssign( ~lhs, rhs.lhs_ *
trans( rhs.rhs_ ) );
1147 template<
typename MT
1149 friend inline typename DisableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1157 LT A(
serial( rhs.lhs_ ) );
1158 RT B(
serial( rhs.rhs_ ) );
1167 TDMatSMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1183 template<
typename MT3
1186 static inline void selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1188 if( C.rows() * C.columns() < TDMATSMATMULT_THRESHOLD )
1189 selectSmallSubAssignKernel( C, A, B );
1191 selectLargeSubAssignKernel( C, A, B );
1211 template<
typename MT3
1214 static inline void selectDefaultSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1220 for(
size_t j=0UL; j<B.rows(); ++j )
1222 ConstIterator element( B.begin(j) );
1223 const ConstIterator
end( B.end(j) );
1225 if( IsDiagonal<MT4>::value )
1227 for( ; element!=
end; ++element ) {
1228 C(j,element->index()) -= A(j,j) * element->value();
1233 const size_t ibegin( ( IsLower<MT4>::value )
1234 ?( IsStrictlyLower<MT4>::value ? j+1UL : j )
1236 const size_t iend( ( IsUpper<MT4>::value )
1237 ?( IsStrictlyUpper<MT4>::value ? j : j+1UL )
1241 const size_t inum( iend - ibegin );
1242 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
1245 for( ; element!=
end; ++element ) {
1246 for( i=ibegin; i<ipos; i+=4UL ) {
1247 C(i ,element->index()) -= A(i ,j) * element->value();
1248 C(i+1UL,element->index()) -= A(i+1UL,j) * element->value();
1249 C(i+2UL,element->index()) -= A(i+2UL,j) * element->value();
1250 C(i+3UL,element->index()) -= A(i+3UL,j) * element->value();
1252 for( ; i<iend; ++i ) {
1253 C(i,element->index()) -= A(i,j) * element->value();
1276 template<
typename MT3
1279 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
1280 selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1282 selectDefaultSubAssignKernel( C, A, B );
1302 template<
typename MT3
1305 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
1306 selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1312 for(
size_t j=0UL; j<B.rows(); ++j )
1314 ConstIterator element( B.begin(j) );
1315 const ConstIterator
end( B.end(j) );
1317 const size_t nonzeros( B.nonZeros(j) );
1318 const size_t kpos( nonzeros &
size_t(-4) );
1321 const size_t ibegin( ( IsLower<MT4>::value )
1322 ?( IsStrictlyLower<MT4>::value ? j+1UL : j )
1324 const size_t iend( ( IsUpper<MT4>::value )
1325 ?( IsStrictlyUpper<MT4>::value ? j : j+1UL )
1329 const size_t inum( iend - ibegin );
1330 const size_t ipos( ibegin + ( inum &
size_t(-4) ) );
1333 for(
size_t k=0UL; k<kpos; k+=4UL )
1335 const size_t j1( element->index() );
1336 const ET2 v1( element->value() );
1338 const size_t j2( element->index() );
1339 const ET2 v2( element->value() );
1341 const size_t j3( element->index() );
1342 const ET2 v3( element->value() );
1344 const size_t j4( element->index() );
1345 const ET2 v4( element->value() );
1350 for( i=ibegin; i<ipos; i+=4UL ) {
1351 C(i ,j1) -= A(i ,j) * v1;
1352 C(i+1UL,j1) -= A(i+1UL,j) * v1;
1353 C(i+2UL,j1) -= A(i+2UL,j) * v1;
1354 C(i+3UL,j1) -= A(i+3UL,j) * v1;
1355 C(i ,j2) -= A(i ,j) * v2;
1356 C(i+1UL,j2) -= A(i+1UL,j) * v2;
1357 C(i+2UL,j2) -= A(i+2UL,j) * v2;
1358 C(i+3UL,j2) -= A(i+3UL,j) * v2;
1359 C(i ,j3) -= A(i ,j) * v3;
1360 C(i+1UL,j3) -= A(i+1UL,j) * v3;
1361 C(i+2UL,j3) -= A(i+2UL,j) * v3;
1362 C(i+3UL,j3) -= A(i+3UL,j) * v3;
1363 C(i ,j4) -= A(i ,j) * v4;
1364 C(i+1UL,j4) -= A(i+1UL,j) * v4;
1365 C(i+2UL,j4) -= A(i+2UL,j) * v4;
1366 C(i+3UL,j4) -= A(i+3UL,j) * v4;
1368 for( ; i<iend; ++i ) {
1369 C(i,j1) -= A(i,j) * v1;
1370 C(i,j2) -= A(i,j) * v2;
1371 C(i,j3) -= A(i,j) * v3;
1372 C(i,j4) -= A(i,j) * v4;
1376 for( ; element!=
end; ++element )
1378 const size_t j1( element->index() );
1379 const ET2 v1( element->value() );
1381 for( i=ibegin; i<ipos; i+=4UL ) {
1382 C(i ,j1) -= A(i ,j) * v1;
1383 C(i+1UL,j1) -= A(i+1UL,j) * v1;
1384 C(i+2UL,j1) -= A(i+2UL,j) * v1;
1385 C(i+3UL,j1) -= A(i+3UL,j) * v1;
1387 for( ; i<iend; ++i ) {
1388 C(i,j1) -= A(i,j) * v1;
1410 template<
typename MT3
1413 static inline typename EnableIf< UseDefaultKernel<MT3,MT4,MT5> >::Type
1414 selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1416 selectDefaultSubAssignKernel( C, A, B );
1436 template<
typename MT3
1439 static inline typename EnableIf< UseOptimizedKernel<MT3,MT4,MT5> >::Type
1440 selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1445 subAssign( C, A * tmp );
1465 template<
typename MT
1467 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1477 subAssign( ~lhs, rhs.lhs_ *
trans( rhs.rhs_ ) );
1510 template<
typename MT
1512 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1551 template<
typename MT
1553 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1558 typedef typename SelectType< SO, ResultType, OppositeType >::Type TmpType;
1570 const TmpType tmp( rhs );
1591 template<
typename MT
1593 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1622 template<
typename MT
1624 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1662 template<
typename MT
1664 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1699 template<
typename MT
1701 friend inline typename EnableIf< IsEvaluationRequired<MT,MT1,MT2> >::Type
1739 template<
typename MT
1741 friend inline typename EnableIf< CanExploitSymmetry<MT,MT1,MT2> >::Type
1819 template<
typename T1
1821 inline const TDMatSMatMultExpr<T1,T2>
1845 template<
typename MT1,
typename MT2 >
1862 template<
typename MT1,
typename MT2 >
1879 template<
typename MT1,
typename MT2 >
1880 struct IsAligned<
TDMatSMatMultExpr<MT1,MT2> > :
public IsTrue< IsAligned<MT1>::value >
1896 template<
typename MT1,
typename MT2 >
1898 :
public IsTrue< And< IsLower<MT1>, IsLower<MT2> >::value >
1914 template<
typename MT1,
typename MT2 >
1916 :
public IsTrue< And< IsUniLower<MT1>, IsUniLower<MT2> >::value >
1932 template<
typename MT1,
typename MT2 >
1934 :
public IsTrue< Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
1935 , And< IsStrictlyLower<MT2>, IsLower<MT1> > >::value >
1951 template<
typename MT1,
typename MT2 >
1953 :
public IsTrue< And< IsUpper<MT1>, IsUpper<MT2> >::value >
1969 template<
typename MT1,
typename MT2 >
1971 :
public IsTrue< And< IsUniUpper<MT1>, IsUniUpper<MT2> >::value >
1987 template<
typename MT1,
typename MT2 >
1989 :
public IsTrue< Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
1990 , And< IsStrictlyUpper<MT2>, IsUpper<MT1> > >::value >
2006 template<
typename MT1,
typename MT2,
typename VT >
2011 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2012 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2013 IsDenseVector<VT>::value && IsColumnVector<VT>::value
2014 ,
typename TDMatDVecMultExprTrait< MT1, typename SMatDVecMultExprTrait<MT2,VT>::Type >::Type
2015 , INVALID_TYPE >::Type Type;
2024 template<
typename MT1,
typename MT2,
typename VT >
2029 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2030 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2031 IsSparseVector<VT>::value && IsColumnVector<VT>::value
2032 ,
typename TDMatSVecMultExprTrait< MT1, typename SMatSVecMultExprTrait<MT2,VT>::Type >::Type
2033 , INVALID_TYPE >::Type Type;
2042 template<
typename VT,
typename MT1,
typename MT2 >
2047 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2048 IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2049 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value
2050 ,
typename TDMatDVecMultExprTrait< MT1, typename SMatDVecMultExprTrait<MT2,VT>::Type >::Type
2051 , INVALID_TYPE >::Type Type;
2060 template<
typename VT,
typename MT1,
typename MT2 >
2065 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
2066 IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2067 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value
2068 ,
typename TDVecSMatMultExprTrait< typename TSVecTDMatMultExprTrait<VT,MT1>::Type, MT2 >::Type
2069 , INVALID_TYPE >::Type Type;
2078 template<
typename MT1,
typename MT2,
bool AF >
2083 typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT1,AF>::Type
2084 ,
typename SubmatrixExprTrait<const MT2,AF>::Type >::Type Type;
2093 template<
typename MT1,
typename MT2 >
2098 typedef typename MultExprTrait< typename RowExprTrait<const MT1>::Type, MT2 >::Type Type;
2107 template<
typename MT1,
typename MT2 >
2112 typedef typename MultExprTrait< MT1, typename ColumnExprTrait<const MT2>::Type >::Type Type;
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
SelectType< evaluateLeft, const RT1, CT1 >::Type LT
Type for the assignment of the left-hand side dense matrix operand.
Definition: TDMatSMatMultExpr.h:224
const MT::ElementType max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1729
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
Header file for mathematical functions.
MT1::ResultType RT1
Result type of the left-hand side dense matrix expression.
Definition: TDMatSMatMultExpr.h:133
Header file for the SMatDVecMultExprTrait class template.
const ResultType CompositeType
Data type for composite expression templates.
Definition: TDMatSMatMultExpr.h:215
Header file for the Rows type trait.
Header file for the IsUniUpper 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:7820
Compile time check for triangular matrix types.This type trait tests whether or not the given templat...
Definition: IsTriangular.h:105
Header file for basic type definitions.
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:250
Header file for the IsSparseMatrix type trait.
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
Header file for the IsDiagonal type trait.
#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.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:507
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:259
Header file for the And class template.
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:90
size_t columns() const
Returns the current number of columns of the matrix.
Definition: TDMatSMatMultExpr.h:328
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:721
Header file for the Computation base class.
Header file for the MatMatMultExpr base class.
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:90
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TDMatSMatMultExpr.h:214
Constraints on the storage order of matrix types.
Header file for the RequiresEvaluation type trait.
System settings for performance optimizations.
Expression object for transpose dense matrix-sparse matrix multiplications.The TDMatSMatMultExpr clas...
Definition: Forward.h:141
Header file for the IsUniLower type trait.
LeftOperand leftOperand() const
Returns the left-hand side transpose dense matrix operand.
Definition: TDMatSMatMultExpr.h:338
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2584
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: TDMatSMatMultExpr.h:382
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:117
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:547
Constraint on the data type.
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
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: TDMatSMatMultExpr.h:392
RT2::ElementType ET2
Element type of the right-hand side sparse matrix expression.
Definition: TDMatSMatMultExpr.h:136
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 IsStrictlyUpper type trait.
SelectType< IsExpression< MT2 >::value, const MT2, const MT2 & >::Type RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TDMatSMatMultExpr.h:221
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#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: ColumnMajorMatrix.h:79
Header file for the TSVecTDMatMultExprTrait class template.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
Header file for the Or class template.
Header file for the TDMatSVecMultExprTrait class template.
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
const MT::ElementType min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1682
Header file for the DenseMatrix base class.
Header file for the Columns type trait.
MT2::CompositeType CT2
Composite type of the right-hand side sparse matrix expression.
Definition: TDMatSMatMultExpr.h:138
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
ResultType::ElementType ElementType
Resulting element type.
Definition: TDMatSMatMultExpr.h:213
RightOperand rhs_
Right-hand side sparse matrix of the multiplication expression.
Definition: TDMatSMatMultExpr.h:400
LeftOperand lhs_
Left-hand side dense matrix of the multiplication expression.
Definition: TDMatSMatMultExpr.h:399
Header file for the SMatSVecMultExprTrait class template.
#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
Header file for the IsTriangular type trait.
Constraints on the storage order of matrix types.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: TDMatSMatMultExpr.h:372
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: TDMatSMatMultExpr.h:260
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: TDMatSMatMultExpr.h:211
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.
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: TDMatSMatMultExpr.h:210
TDMatSMatMultExpr(const MT1 &lhs, const MT2 &rhs)
Constructor for the TDMatSMatMultExpr class.
Definition: TDMatSMatMultExpr.h:245
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
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
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: TDMatSMatMultExpr.h:302
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: RowMajorMatrix.h:79
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: TDMatSMatMultExpr.h:212
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: TDMatSMatMultExpr.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:138
SelectType< IsExpression< MT1 >::value, const MT1, const MT1 & >::Type LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: TDMatSMatMultExpr.h:218
const bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
Header file for the reset shim.
Header file for the isDefault shim.
Constraint on the data type.
Constraints on the storage order of matrix types.
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:122
Header file for the IsDenseVector type trait.
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
MT2::ResultType RT2
Result type of the right-hand side sparse matrix expression.
Definition: TDMatSMatMultExpr.h:134
RightOperand rightOperand() const
Returns the right-hand side sparse matrix operand.
Definition: TDMatSMatMultExpr.h:348
Header file for the IsRowMajorMatrix type trait.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: TDMatSMatMultExpr.h:318
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:944
TDMatSMatMultExpr< MT1, MT2 > This
Type of this TDMatSMatMultExpr instance.
Definition: TDMatSMatMultExpr.h:209
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
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
Header file for the IsTrue value trait.
MT1::CompositeType CT1
Composite type of the left-hand side dense matrix expression.
Definition: TDMatSMatMultExpr.h:137
RT1::ElementType ET1
Element type of the left-hand side dense matrix expression.
Definition: TDMatSMatMultExpr.h:135
SelectType< evaluateRight, const RT2, CT2 >::Type RT
Type for the assignment of the right-hand side sparse matrix operand.
Definition: TDMatSMatMultExpr.h:227
Header file for the IsUpper type trait.
Header file for exception macros.
Header file for the IsColumnVector type trait.
Constraint on the data type.
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
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 FunctionTrace class.