35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
110 template<
typename MT
113 class SMatScalarMultExpr :
public SparseMatrix< SMatScalarMultExpr<MT,ST,SO>, SO >
114 ,
private MatScalarMultExpr
115 ,
private Computation
148 template<
typename MT2 >
151 enum { value = useAssign };
164 template<
typename MT2 >
165 struct UseSMPAssign {
166 enum { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
322 enum { smpAssignable = 0 };
479 template<
typename T >
481 return matrix_.canAlias( alias );
491 template<
typename T >
493 return matrix_.isAliased( alias );
517 template<
typename MT2
527 assign( ~lhs, rhs.matrix_ );
528 (~lhs) *= rhs.scalar_;
547 template<
typename MT2
557 assign( ~lhs, rhs.matrix_ );
558 (~lhs) *= rhs.scalar_;
577 template<
typename MT2
579 friend inline typename EnableIf< UseAssign<MT2> >::Type
590 const ResultType tmp(
serial( rhs ) );
614 template<
typename MT2
616 friend inline typename EnableIf< UseAssign<MT2> >::Type
627 const ResultType tmp(
serial( rhs ) );
667 template<
typename MT2
669 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
680 const ResultType tmp( rhs );
704 template<
typename MT2
706 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
717 const ResultType tmp( rhs );
772 template<
typename MT
774 inline const SMatScalarMultExpr<MT,typename BaseElementType<MT>::Type,SO>
814 template<
typename T1
817 inline const typename EnableIf< IsNumeric<T2>,
typename MultExprTrait<T1,T2>::Type >::Type
823 return Type( ~mat, scalar );
849 template<
typename T1
852 inline const typename EnableIf< IsNumeric<T1>,
typename MultExprTrait<T1,T2>::Type >::Type
858 return Type( ~mat, scalar );
883 template<
typename VT
886 inline const SMatScalarMultExpr<VT,ST,TF>
887 operator-(
const SMatScalarMultExpr<VT,ST,TF>& sm )
891 return SMatScalarMultExpr<VT,ST,TF>( sm.leftOperand(), -sm.rightOperand() );
918 template<
typename MT
922 inline const typename EnableIf< IsNumeric<ST2>
923 ,
typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
924 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
928 return mat.leftOperand() * ( mat.rightOperand() * scalar );
947 template<
typename ST1
951 inline const typename EnableIf< IsNumeric<ST1>
952 ,
typename MultExprTrait< ST1, SMatScalarMultExpr<MT,ST2,SO> >::Type >::Type
953 operator*( ST1 scalar,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
957 return mat.leftOperand() * ( scalar * mat.rightOperand() );
976 template<
typename MT
980 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
981 ,
typename DivExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
982 operator/(
const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
986 return mat.leftOperand() * ( mat.rightOperand() / scalar );
1006 template<
typename MT
1010 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
1011 operator*(
const SMatScalarMultExpr<MT,ST,SO>& mat,
const DenseVector<VT,false>& vec )
1015 return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1035 template<
typename VT
1039 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1040 operator*(
const DenseVector<VT,true>& vec,
const SMatScalarMultExpr<MT,ST,SO>& mat )
1044 return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1066 template<
typename MT
1071 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, DVecScalarMultExpr<VT,ST2,false> >::Type
1072 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat,
const DVecScalarMultExpr<VT,ST2,false>& vec )
1076 return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1098 template<
typename VT
1103 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1104 operator*(
const DVecScalarMultExpr<VT,ST1,true>& vec,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
1108 return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1128 template<
typename MT
1132 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
1133 operator*(
const SMatScalarMultExpr<MT,ST,SO>& mat,
const SparseVector<VT,false>& vec )
1137 return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1157 template<
typename VT
1161 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1162 operator*(
const SparseVector<VT,true>& vec,
const SMatScalarMultExpr<MT,ST,SO>& mat )
1166 return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1188 template<
typename MT
1193 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, SVecScalarMultExpr<VT,ST2,false> >::Type
1194 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat,
const SVecScalarMultExpr<VT,ST2,false>& vec )
1198 return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1220 template<
typename VT
1225 inline const typename MultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1226 operator*(
const SVecScalarMultExpr<VT,ST1,true>& vec,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
1230 return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1250 template<
typename MT1
1255 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1256 operator*(
const SMatScalarMultExpr<MT1,ST,SO1>& lhs,
const DenseMatrix<MT2,SO2>& rhs )
1260 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1280 template<
typename MT1
1285 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1286 operator*(
const DenseMatrix<MT1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1290 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1310 template<
typename MT1
1315 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1316 operator*(
const SMatScalarMultExpr<MT1,ST,SO1>& lhs,
const SparseMatrix<MT2,SO2>& rhs )
1320 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1340 template<
typename MT1
1345 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1346 operator*(
const SparseMatrix<MT1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1350 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1370 template<
typename MT1
1376 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST1,SO1>, SMatScalarMultExpr<MT2,ST2,SO2> >::Type
1377 operator*(
const SMatScalarMultExpr<MT1,ST1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST2,SO2>& rhs )
1381 return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1397 template<
typename MT,
typename ST,
bool SO >
1414 template<
typename MT,
typename ST,
bool SO >
1431 template<
typename MT,
typename ST,
bool SO >
1432 struct IsSymmetric<
SMatScalarMultExpr<MT,ST,SO> > :
public IsTrue< IsSymmetric<MT>::value >
1448 template<
typename MT,
typename ST,
bool SO >
1465 template<
typename MT,
typename ST,
bool SO >
1466 struct IsStrictlyLower<
SMatScalarMultExpr<MT,ST,SO> > :
public IsTrue< IsStrictlyLower<MT>::value >
1482 template<
typename MT,
typename ST,
bool SO >
1499 template<
typename MT,
typename ST,
bool SO >
1500 struct IsStrictlyUpper<
SMatScalarMultExpr<MT,ST,SO> > :
public IsTrue< IsStrictlyUpper<MT>::value >
1516 template<
typename MT,
typename ST1,
typename ST2 >
1521 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1522 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1523 ,
typename SMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1524 , INVALID_TYPE >::Type Type;
1541 template<
typename MT,
typename ST1,
typename ST2 >
1546 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1547 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1548 ,
typename TSMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1549 , INVALID_TYPE >::Type Type;
1566 template<
typename MT,
typename ST1,
typename ST2 >
1571 enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1575 typedef typename SMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1576 typedef typename SMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1581 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1582 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1583 ,
typename SelectType<condition,T1,T2>::Type
1584 , INVALID_TYPE >::Type Type;
1601 template<
typename MT,
typename ST1,
typename ST2 >
1606 enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1610 typedef typename TSMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1611 typedef typename TSMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1616 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1617 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1618 ,
typename SelectType<condition,T1,T2>::Type
1619 , INVALID_TYPE >::Type Type;
1636 template<
typename MT,
typename ST,
typename VT >
1641 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1642 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1643 IsNumeric<ST>::value
1644 ,
typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1645 , INVALID_TYPE >::Type Type;
1654 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1655 struct SMatDVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,false>, DVecScalarMultExpr<VT,ST2,false> >
1659 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1660 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1661 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1662 ,
typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1663 , INVALID_TYPE >::Type Type;
1680 template<
typename MT,
typename ST,
typename VT >
1685 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1686 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1687 IsNumeric<ST>::value
1688 ,
typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1689 , INVALID_TYPE >::Type Type;
1698 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1699 struct TSMatDVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,true>, DVecScalarMultExpr<VT,ST2,false> >
1703 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1704 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1705 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1706 ,
typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1707 , INVALID_TYPE >::Type Type;
1724 template<
typename VT,
typename MT,
typename ST >
1729 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1730 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1731 IsNumeric<ST>::value
1732 ,
typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1733 , INVALID_TYPE >::Type Type;
1742 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1743 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,false> >
1747 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1748 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1749 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1750 ,
typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1751 , INVALID_TYPE >::Type Type;
1768 template<
typename VT,
typename MT,
typename ST >
1773 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1774 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1775 IsNumeric<ST>::value
1776 ,
typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1777 , INVALID_TYPE >::Type Type;
1786 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1787 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,true> >
1791 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1792 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1793 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1794 ,
typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1795 , INVALID_TYPE >::Type Type;
1812 template<
typename MT,
typename ST,
typename VT >
1817 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1818 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1819 IsNumeric<ST>::value
1820 ,
typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1821 , INVALID_TYPE >::Type Type;
1830 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1831 struct SMatSVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,false>, SVecScalarMultExpr<VT,ST2,false> >
1835 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1836 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1837 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1838 ,
typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1839 , INVALID_TYPE >::Type Type;
1856 template<
typename MT,
typename ST,
typename VT >
1861 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1862 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1863 IsNumeric<ST>::value
1864 ,
typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1865 , INVALID_TYPE >::Type Type;
1874 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1875 struct TSMatSVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,true>, SVecScalarMultExpr<VT,ST2,false> >
1879 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1880 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1881 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1882 ,
typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1883 , INVALID_TYPE >::Type Type;
1900 template<
typename VT,
typename MT,
typename ST >
1905 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1906 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1907 IsNumeric<ST>::value
1908 ,
typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1909 , INVALID_TYPE >::Type Type;
1918 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1919 struct TSVecSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,false> >
1923 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1924 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1925 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1926 ,
typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1927 , INVALID_TYPE >::Type Type;
1944 template<
typename VT,
typename MT,
typename ST >
1949 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1950 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1951 IsNumeric<ST>::value
1952 ,
typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1953 , INVALID_TYPE >::Type Type;
1962 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1963 struct TSVecTSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,true> >
1967 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1968 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1969 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1970 ,
typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1971 , INVALID_TYPE >::Type Type;
1988 template<
typename MT1,
typename MT2,
typename ST >
1993 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1994 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1995 IsNumeric<ST>::value
1996 ,
typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1997 , INVALID_TYPE >::Type Type;
2014 template<
typename MT1,
typename MT2,
typename ST >
2019 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2020 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2021 IsNumeric<ST>::value
2022 ,
typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2023 , INVALID_TYPE >::Type Type;
2040 template<
typename MT1,
typename MT2,
typename ST >
2045 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2046 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2047 IsNumeric<ST>::value
2048 ,
typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2049 , INVALID_TYPE >::Type Type;
2066 template<
typename MT1,
typename MT2,
typename ST >
2071 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2072 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2073 IsNumeric<ST>::value
2074 ,
typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2075 , INVALID_TYPE >::Type Type;
2092 template<
typename MT1,
typename ST,
typename MT2 >
2097 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2098 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2099 IsNumeric<ST>::value
2100 ,
typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2101 , INVALID_TYPE >::Type Type;
2118 template<
typename MT1,
typename ST,
typename MT2 >
2123 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2124 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2125 IsNumeric<ST>::value
2126 ,
typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2127 , INVALID_TYPE >::Type Type;
2144 template<
typename MT1,
typename ST,
typename MT2 >
2149 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2150 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2151 IsNumeric<ST>::value
2152 ,
typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2153 , INVALID_TYPE >::Type Type;
2170 template<
typename MT1,
typename ST,
typename MT2 >
2175 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2176 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2177 IsNumeric<ST>::value
2178 ,
typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2179 , INVALID_TYPE >::Type Type;
2196 template<
typename MT1,
typename ST,
typename MT2 >
2201 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2202 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2203 IsNumeric<ST>::value
2204 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2205 , INVALID_TYPE >::Type Type;
2214 template<
typename MT1,
typename MT2,
typename ST >
2219 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2220 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2221 IsNumeric<ST>::value
2222 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2223 , INVALID_TYPE >::Type Type;
2232 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2237 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2238 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2239 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2240 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2241 , INVALID_TYPE >::Type Type;
2258 template<
typename MT1,
typename ST,
typename MT2 >
2263 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2264 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2265 IsNumeric<ST>::value
2266 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2267 , INVALID_TYPE >::Type Type;
2276 template<
typename MT1,
typename MT2,
typename ST >
2281 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2282 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2283 IsNumeric<ST>::value
2284 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2285 , INVALID_TYPE >::Type Type;
2294 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2299 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2300 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2301 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2302 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2303 , INVALID_TYPE >::Type Type;
2320 template<
typename MT1,
typename ST,
typename MT2 >
2325 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2326 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2327 IsNumeric<ST>::value
2328 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2329 , INVALID_TYPE >::Type Type;
2338 template<
typename MT1,
typename MT2,
typename ST >
2343 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2344 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2345 IsNumeric<ST>::value
2346 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2347 , INVALID_TYPE >::Type Type;
2356 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2361 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2362 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2363 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2364 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2365 , INVALID_TYPE >::Type Type;
2382 template<
typename MT1,
typename ST,
typename MT2 >
2387 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2388 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2389 IsNumeric<ST>::value
2390 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2391 , INVALID_TYPE >::Type Type;
2400 template<
typename MT1,
typename MT2,
typename ST >
2405 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2406 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2407 IsNumeric<ST>::value
2408 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2409 , INVALID_TYPE >::Type Type;
2418 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2423 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2424 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2425 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2426 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2427 , INVALID_TYPE >::Type Type;
2444 template<
typename MT,
typename ST,
bool SO,
bool AF >
2449 typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type, ST >::Type Type;
2466 template<
typename MT,
typename ST,
bool SO >
2471 typedef typename MultExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
2488 template<
typename MT,
typename ST,
bool SO >
2493 typedef typename MultExprTrait< typename ColumnExprTrait<const MT>::Type, ST >::Type Type;
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatScalarMultExpr.h:388
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
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:8247
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:939
Header file for basic type definitions.
PointerType pointer
Pointer return type.
Definition: SMatScalarMultExpr.h:214
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type LeftOperand
Composite data type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:186
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:500
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatScalarMultExpr.h:368
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:209
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:315
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SMatScalarMultExpr.h:421
Header file for the ColumnExprTrait class template.
ValueType & ReferenceType
Reference return type.
Definition: SMatScalarMultExpr.h:208
LeftOperand leftOperand() const
Returns the left-hand side sparse matrix operand.
Definition: SMatScalarMultExpr.h:458
Header file for the IsColumnMajorMatrix type trait.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2507
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:261
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: SMatScalarMultExpr.h:468
size_t index() const
Access to the current index of the sparse element.
Definition: SMatScalarMultExpr.h:274
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:699
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatScalarMultExpr.h:177
Header file for the Computation base class.
Header file for the RequiresEvaluation type trait.
LeftOperand matrix_
Left-hand side sparse matrix of the multiplication expression.
Definition: SMatScalarMultExpr.h:499
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatScalarMultExpr.h:398
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SMatScalarMultExpr.h:134
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SMatScalarMultExpr.h:447
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatScalarMultExpr.h:176
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatScalarMultExpr.h:205
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:107
Constraint on the data type.
Header file for the SparseMatrix base class.
Header file for the DivExprTrait class template.
RemoveReference< LeftOperand >::Type::ConstIterator IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:203
Constraint on the data type.
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SMatScalarMultExpr.h:480
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 This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:263
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatScalarMultExpr.h:357
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.
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:200
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
ReferenceType reference
Reference return type.
Definition: SMatScalarMultExpr.h:215
Header file for the IsFloatingPoint type trait.
ConstIterator lowerBound(size_t i, size_t j) const
Returns an iterator to the first index not less then the given index.
Definition: SMatScalarMultExpr.h:434
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatScalarMultExpr.h:233
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatScalarMultExpr.h:175
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatScalarMultExpr.h:307
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.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SMatScalarMultExpr.h:180
IteratorCategory iterator_category
The iterator category.
Definition: SMatScalarMultExpr.h:212
#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
Header file for the IsLower type trait.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SMatScalarMultExpr.h:189
#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
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatScalarMultExpr.h:344
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:296
Constraints on the storage order of matrix types.
Constraint on the data type.
Header file for the SelectType class template.
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.
MT::CompositeType CT
Composite type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:121
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatScalarMultExpr.h:378
Header file for the serial shim.
Header file for the BaseElementType type trait.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatScalarMultExpr.h:209
ValueType * PointerType
Pointer return type.
Definition: SMatScalarMultExpr.h:207
Header file for the IsNumeric type trait.
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.
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2506
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.
MT::ReturnType RN
Return type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:120
Base template for the MultTrait class.
Definition: MultTrait.h:150
ConstIterator(IteratorType matrix, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SMatScalarMultExpr.h:222
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
Header file for the division trait.
SelectType< useAssign, const ResultType, const SMatScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatScalarMultExpr.h:183
SMatScalarMultExpr< MT, ST, SO > This
Type of this SMatScalarMultExpr instance.
Definition: SMatScalarMultExpr.h:173
const DenseIterator< Type > operator-(const DenseIterator< Type > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:585
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:285
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
#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
MT::ResultType RT
Result type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:119
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:118
Iterator over the elements of the sparse matrix/scalar multiplication expression. ...
Definition: SMatScalarMultExpr.h:195
Evaluation of the base element type of a given data type.Via this type trait it is possible to evalua...
Definition: BaseElementType.h:80
DifferenceType difference_type
Difference between two iterators.
Definition: SMatScalarMultExpr.h:216
Header file for the RemoveReference type trait.
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarMultExpr.h:244
Element ValueType
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:206
Header file for the IsDenseVector type trait.
MultTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: SMatScalarMultExpr.h:174
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatScalarMultExpr.h:264
IteratorType matrix_
Iterator over the elements of the left-hand side sparse matrix expression.
Definition: SMatScalarMultExpr.h:314
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:70
Header file for the IsRowMajorMatrix type trait.
Header file for the IsComputation type trait class.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SMatScalarMultExpr.h:492
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2502
Header file for the IsTrue value trait.
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatScalarMultExpr.h:409
Header file for the IsUpper type trait.
const ConstIterator * operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarMultExpr.h:254
SMatScalarMultExpr(const MT &matrix, ST scalar)
Constructor for the SMatScalarMultExpr class.
Definition: SMatScalarMultExpr.h:331
Header file for the IsColumnVector type trait.
ValueType value_type
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:213
Evaluation of the resulting expression type of a multiplication.Via this type trait it is possible to...
Definition: MultExprTrait.h:137
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:79
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
BLAZE_ALWAYS_INLINE void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:849