35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
101 template<
typename MT
104 class SMatScalarMultExpr :
public SparseMatrix< SMatScalarMultExpr<MT,ST,SO>, SO >
105 ,
private MatScalarMultExpr
106 ,
private Computation
139 template<
typename MT2 >
142 enum { value = useAssign };
155 template<
typename MT2 >
156 struct UseSMPAssign {
157 enum { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
313 enum { smpAssignable = 0 };
431 template<
typename T >
433 return matrix_.canAlias( alias );
443 template<
typename T >
445 return matrix_.isAliased( alias );
469 template<
typename MT2
479 assign( ~lhs, rhs.matrix_ );
480 (~lhs) *= rhs.scalar_;
499 template<
typename MT2
509 assign( ~lhs, rhs.matrix_ );
510 (~lhs) *= rhs.scalar_;
529 template<
typename MT2
531 friend inline typename EnableIf< UseAssign<MT2> >::Type
566 template<
typename MT2
568 friend inline typename EnableIf< UseAssign<MT2> >::Type
619 template<
typename MT2
621 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
656 template<
typename MT2
658 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
724 template<
typename MT
726 inline const SMatScalarMultExpr<MT,typename BaseElementType<MT>::Type,SO>
766 template<
typename T1
769 inline const typename EnableIf< IsNumeric<T2>,
typename MultExprTrait<T1,T2>::Type >::Type
775 return Type( ~mat, scalar );
801 template<
typename T1
804 inline const typename EnableIf< IsNumeric<T1>,
typename MultExprTrait<T1,T2>::Type >::Type
810 return Type( ~mat, scalar );
835 template<
typename VT
838 inline const SMatScalarMultExpr<VT,ST,TF>
839 operator-(
const SMatScalarMultExpr<VT,ST,TF>& sm )
843 return SMatScalarMultExpr<VT,ST,TF>( sm.leftOperand(), -sm.rightOperand() );
870 template<
typename MT
874 inline const typename EnableIf< IsNumeric<ST2>
875 ,
typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
876 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
880 return mat.leftOperand() * ( mat.rightOperand() * scalar );
899 template<
typename ST1
903 inline const typename EnableIf< IsNumeric<ST1>
904 ,
typename MultExprTrait< ST1, SMatScalarMultExpr<MT,ST2,SO> >::Type >::Type
905 operator*( ST1 scalar,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
909 return mat.leftOperand() * ( scalar * mat.rightOperand() );
928 template<
typename MT
932 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
933 ,
typename DivExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
934 operator/(
const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
938 return mat.leftOperand() * ( mat.rightOperand() / scalar );
958 template<
typename MT
962 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
963 operator*(
const SMatScalarMultExpr<MT,ST,SO>& mat,
const DenseVector<VT,false>& vec )
967 return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
987 template<
typename VT
991 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
992 operator*(
const DenseVector<VT,true>& vec,
const SMatScalarMultExpr<MT,ST,SO>& mat )
996 return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1018 template<
typename MT
1023 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, DVecScalarMultExpr<VT,ST2,false> >::Type
1024 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat,
const DVecScalarMultExpr<VT,ST2,false>& vec )
1028 return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1050 template<
typename VT
1055 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1056 operator*(
const DVecScalarMultExpr<VT,ST1,true>& vec,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
1060 return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1080 template<
typename MT
1084 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
1085 operator*(
const SMatScalarMultExpr<MT,ST,SO>& mat,
const SparseVector<VT,false>& vec )
1089 return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1109 template<
typename VT
1113 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1114 operator*(
const SparseVector<VT,true>& vec,
const SMatScalarMultExpr<MT,ST,SO>& mat )
1118 return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1140 template<
typename MT
1145 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, SVecScalarMultExpr<VT,ST2,false> >::Type
1146 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat,
const SVecScalarMultExpr<VT,ST2,false>& vec )
1150 return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1172 template<
typename VT
1177 inline const typename MultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1178 operator*(
const SVecScalarMultExpr<VT,ST1,true>& vec,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
1182 return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1202 template<
typename MT1
1207 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1208 operator*(
const SMatScalarMultExpr<MT1,ST,SO1>& lhs,
const DenseMatrix<MT2,SO2>& rhs )
1212 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1232 template<
typename MT1
1237 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1238 operator*(
const DenseMatrix<MT1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1242 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1262 template<
typename MT1
1267 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1268 operator*(
const SMatScalarMultExpr<MT1,ST,SO1>& lhs,
const SparseMatrix<MT2,SO2>& rhs )
1272 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1292 template<
typename MT1
1297 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1298 operator*(
const SparseMatrix<MT1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1302 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1322 template<
typename MT1
1328 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST1,SO1>, SMatScalarMultExpr<MT2,ST2,SO2> >::Type
1329 operator*(
const SMatScalarMultExpr<MT1,ST1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST2,SO2>& rhs )
1333 return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1349 template<
typename MT,
typename ST1,
typename ST2 >
1354 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1355 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1356 ,
typename SMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1357 , INVALID_TYPE >::Type Type;
1374 template<
typename MT,
typename ST1,
typename ST2 >
1379 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1380 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1381 ,
typename TSMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1382 , INVALID_TYPE >::Type Type;
1399 template<
typename MT,
typename ST1,
typename ST2 >
1404 enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1408 typedef typename SMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1409 typedef typename SMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1414 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1415 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1416 ,
typename SelectType<condition,T1,T2>::Type
1417 , INVALID_TYPE >::Type Type;
1434 template<
typename MT,
typename ST1,
typename ST2 >
1439 enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1443 typedef typename TSMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1444 typedef typename TSMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1449 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1450 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1451 ,
typename SelectType<condition,T1,T2>::Type
1452 , INVALID_TYPE >::Type Type;
1469 template<
typename MT,
typename ST,
typename VT >
1474 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1475 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1476 IsNumeric<ST>::value
1477 ,
typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1478 , INVALID_TYPE >::Type Type;
1487 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1488 struct SMatDVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,false>, DVecScalarMultExpr<VT,ST2,false> >
1492 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1493 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1494 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1495 ,
typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1496 , INVALID_TYPE >::Type Type;
1513 template<
typename MT,
typename ST,
typename VT >
1518 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1519 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1520 IsNumeric<ST>::value
1521 ,
typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1522 , INVALID_TYPE >::Type Type;
1531 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1532 struct TSMatDVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,true>, DVecScalarMultExpr<VT,ST2,false> >
1536 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1537 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1538 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1539 ,
typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1540 , INVALID_TYPE >::Type Type;
1557 template<
typename VT,
typename MT,
typename ST >
1562 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1563 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1564 IsNumeric<ST>::value
1565 ,
typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1566 , INVALID_TYPE >::Type Type;
1575 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1576 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,false> >
1580 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1581 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1582 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1583 ,
typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1584 , INVALID_TYPE >::Type Type;
1601 template<
typename VT,
typename MT,
typename ST >
1606 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1607 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1608 IsNumeric<ST>::value
1609 ,
typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1610 , INVALID_TYPE >::Type Type;
1619 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1620 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,true> >
1624 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1625 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1626 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1627 ,
typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1628 , INVALID_TYPE >::Type Type;
1645 template<
typename MT,
typename ST,
typename VT >
1650 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1651 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1652 IsNumeric<ST>::value
1653 ,
typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1654 , INVALID_TYPE >::Type Type;
1663 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1664 struct SMatSVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,false>, SVecScalarMultExpr<VT,ST2,false> >
1668 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1669 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1670 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1671 ,
typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1672 , INVALID_TYPE >::Type Type;
1689 template<
typename MT,
typename ST,
typename VT >
1694 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1695 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1696 IsNumeric<ST>::value
1697 ,
typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1698 , INVALID_TYPE >::Type Type;
1707 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1708 struct TSMatSVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,true>, SVecScalarMultExpr<VT,ST2,false> >
1712 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1713 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1714 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1715 ,
typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1716 , INVALID_TYPE >::Type Type;
1733 template<
typename VT,
typename MT,
typename ST >
1738 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1739 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1740 IsNumeric<ST>::value
1741 ,
typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1742 , INVALID_TYPE >::Type Type;
1751 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1752 struct TSVecSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,false> >
1756 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1757 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1758 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1759 ,
typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1760 , INVALID_TYPE >::Type Type;
1777 template<
typename VT,
typename MT,
typename ST >
1782 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1783 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1784 IsNumeric<ST>::value
1785 ,
typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1786 , INVALID_TYPE >::Type Type;
1795 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1796 struct TSVecTSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,true> >
1800 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1801 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1802 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1803 ,
typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1804 , INVALID_TYPE >::Type Type;
1821 template<
typename MT1,
typename MT2,
typename ST >
1826 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1827 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1828 IsNumeric<ST>::value
1829 ,
typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1830 , INVALID_TYPE >::Type Type;
1847 template<
typename MT1,
typename MT2,
typename ST >
1852 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1853 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1854 IsNumeric<ST>::value
1855 ,
typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1856 , INVALID_TYPE >::Type Type;
1873 template<
typename MT1,
typename MT2,
typename ST >
1878 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1879 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1880 IsNumeric<ST>::value
1881 ,
typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1882 , INVALID_TYPE >::Type Type;
1899 template<
typename MT1,
typename MT2,
typename ST >
1904 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1905 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1906 IsNumeric<ST>::value
1907 ,
typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1908 , INVALID_TYPE >::Type Type;
1925 template<
typename MT1,
typename ST,
typename MT2 >
1930 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1931 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1932 IsNumeric<ST>::value
1933 ,
typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1934 , INVALID_TYPE >::Type Type;
1951 template<
typename MT1,
typename ST,
typename MT2 >
1956 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1957 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1958 IsNumeric<ST>::value
1959 ,
typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1960 , INVALID_TYPE >::Type Type;
1977 template<
typename MT1,
typename ST,
typename MT2 >
1982 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1983 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1984 IsNumeric<ST>::value
1985 ,
typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1986 , INVALID_TYPE >::Type Type;
2003 template<
typename MT1,
typename ST,
typename MT2 >
2008 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2009 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2010 IsNumeric<ST>::value
2011 ,
typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2012 , INVALID_TYPE >::Type Type;
2029 template<
typename MT1,
typename ST,
typename MT2 >
2034 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2035 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2036 IsNumeric<ST>::value
2037 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2038 , INVALID_TYPE >::Type Type;
2047 template<
typename MT1,
typename MT2,
typename ST >
2052 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2053 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2054 IsNumeric<ST>::value
2055 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2056 , INVALID_TYPE >::Type Type;
2065 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2070 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2071 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2072 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2073 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2074 , INVALID_TYPE >::Type Type;
2091 template<
typename MT1,
typename ST,
typename MT2 >
2096 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2097 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2098 IsNumeric<ST>::value
2099 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2100 , INVALID_TYPE >::Type Type;
2109 template<
typename MT1,
typename MT2,
typename ST >
2114 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2115 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2116 IsNumeric<ST>::value
2117 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2118 , INVALID_TYPE >::Type Type;
2127 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2132 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2133 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2134 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2135 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2136 , INVALID_TYPE >::Type Type;
2153 template<
typename MT1,
typename ST,
typename MT2 >
2158 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2159 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2160 IsNumeric<ST>::value
2161 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2162 , INVALID_TYPE >::Type Type;
2171 template<
typename MT1,
typename MT2,
typename ST >
2176 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2177 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2178 IsNumeric<ST>::value
2179 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2180 , INVALID_TYPE >::Type Type;
2189 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2194 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2195 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2196 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2197 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2198 , INVALID_TYPE >::Type Type;
2215 template<
typename MT1,
typename ST,
typename MT2 >
2220 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2221 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2222 IsNumeric<ST>::value
2223 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2224 , INVALID_TYPE >::Type Type;
2233 template<
typename MT1,
typename MT2,
typename ST >
2238 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2239 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2240 IsNumeric<ST>::value
2241 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2242 , INVALID_TYPE >::Type Type;
2251 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2256 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2257 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2258 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2259 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2260 , INVALID_TYPE >::Type Type;
2277 template<
typename MT,
typename ST,
bool SO,
bool AF >
2282 typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type, ST >::Type Type;
2299 template<
typename MT,
typename ST,
bool SO >
2304 typedef typename MultExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
2321 template<
typename MT,
typename ST,
bool SO >
2326 typedef typename MultExprTrait< typename ColumnExprTrait<const MT>::Type, ST >::Type Type;
Pointer difference type of the Blaze library.
Constraint on the data type.
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:4329
const EnableIf< IsNumeric< T2 >, typename DivExprTrait< T1, T2 >::Type >::Type operator/(const DenseMatrix< T1, SO > &mat, T2 scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:930
PointerType pointer
Pointer return type.
Definition: SMatScalarMultExpr.h:205
IteratorCategory iterator_category
The iterator category.
Definition: SMatScalarMultExpr.h:203
MT::CompositeType CT
Composite type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:112
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:152
Header file for the IsSparseMatrix type trait.
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:242
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:199
Header file for the ColumnExprTrait class template.
Header file for the IsColumnMajorMatrix type trait.
RemoveReference< LeftOperand >::Type::ConstIterator IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:194
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatScalarMultExpr.h:298
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2408
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:251
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatScalarMultExpr.h:200
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatScalarMultExpr.h:379
ValueType value_type
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:204
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:690
Header file for the Computation base class.
IteratorType matrix_
Iterator over the elements of the left-hand side sparse matrix expression.
Definition: SMatScalarMultExpr.h:305
Header file for the RequiresEvaluation type trait.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SMatScalarMultExpr.h:444
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatScalarMultExpr.h:359
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
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatScalarMultExpr.h:196
Constraint on the data type.
SelectType< useAssign, const ResultType, const SMatScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatScalarMultExpr.h:174
Header file for the SparseMatrix base class.
Header file for the DivExprTrait class template.
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SMatScalarMultExpr.h:432
Constraint on the data type.
Header file for the MultExprTrait class template.
void smpAddAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:122
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:253
Header file for the ValueIndexPair class.
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 IsTemporary type trait class.
Header file for the multiplication trait.
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:452
Header file for the IsFloatingPoint type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2412
void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:271
Element ValueType
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:197
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE(A, B)
Data type constraint.In case the two types A and B are not the same (ignoring all cv-qualifiers of bo...
Definition: SameType.h:89
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SMatScalarMultExpr.h:171
#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< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: SMatScalarMultExpr.h:165
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:306
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SMatScalarMultExpr.h:125
Header file for the SelectType class template.
SMatScalarMultExpr(const MT &matrix, ST scalar)
Constructor for the SMatScalarMultExpr class.
Definition: SMatScalarMultExpr.h:322
Header file for the RowExprTrait class template.
Expression object for sparse matrix-scalar multiplications.The SMatScalarMult class represents the co...
Definition: Forward.h:94
Header file for all forward declarations for expression class templates.
Header file for the IsDenseMatrix type trait.
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatScalarMultExpr.h:348
Header file for the EnableIf class template.
SMatScalarMultExpr< MT, ST, SO > This
Type of this SMatScalarMultExpr instance.
Definition: SMatScalarMultExpr.h:164
Header file for the serial shim.
Header file for the BaseElementType type trait.
LeftOperand matrix_
Left-hand side sparse matrix of the multiplication expression.
Definition: SMatScalarMultExpr.h:451
Header file for the IsNumeric type trait.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatScalarMultExpr.h:369
Header file for the IsSparseVector type trait.
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2407
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
Header file for the MatScalarMultExpr base class.
Header file for run time assertion macros.
Utility type for generic codes.
Base template for the MultTrait class.
Definition: MultTrait.h:141
Header file for the division trait.
void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:301
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatScalarMultExpr.h:389
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:287
const DenseIterator< Type > operator-(const DenseIterator< Type > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:585
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:276
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:79
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: SMatScalarMultExpr.h:420
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarMultExpr.h:235
void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:331
Iterator over the elements of the sparse matrix/scalar multiplication expression. ...
Definition: SMatScalarMultExpr.h:186
Evaluation of the base element type of a given data type.Via this type trait it is possible to evalua...
Definition: BaseElementType.h:75
Header file for the RemoveReference type trait.
ValueType * PointerType
Pointer return type.
Definition: SMatScalarMultExpr.h:198
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatScalarMultExpr.h:224
Header file for the IsDenseVector type trait.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatScalarMultExpr.h:335
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatScalarMultExpr.h:168
ReferenceType reference
Reference return type.
Definition: SMatScalarMultExpr.h:206
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:191
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatScalarMultExpr.h:255
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatScalarMultExpr.h:400
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:69
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type LeftOperand
Composite data type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:177
Header file for the IsRowMajorMatrix type trait.
const ConstIterator * operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarMultExpr.h:245
Header file for the IsComputation type trait class.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SMatScalarMultExpr.h:180
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2403
Header file for basic type definitions.
ConstIterator(IteratorType matrix, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SMatScalarMultExpr.h:213
size_t index() const
Access to the current index of the sparse element.
Definition: SMatScalarMultExpr.h:265
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatScalarMultExpr.h:166
Header file for the IsColumnVector type trait.
DifferenceType difference_type
Difference between two iterators.
Definition: SMatScalarMultExpr.h:207
ValueType & ReferenceType
Reference return type.
Definition: SMatScalarMultExpr.h:199
MT::ReturnType RN
Return type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:111
MT::ResultType RT
Result type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:110
Evaluation of the resulting expression type of a multiplication.Via this type trait it is possible to...
Definition: MultExprTrait.h:137
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatScalarMultExpr.h:167
#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
LeftOperand leftOperand() const
Returns the left-hand side sparse matrix operand.
Definition: SMatScalarMultExpr.h:410
#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.