35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
113 template<
typename MT
116 class SMatScalarMultExpr :
public SparseMatrix< SMatScalarMultExpr<MT,ST,SO>, SO >
117 ,
private MatScalarMultExpr
118 ,
private Computation
151 template<
typename MT2 >
154 enum { value = useAssign };
167 template<
typename MT2 >
168 struct UseSMPAssign {
169 enum { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
325 enum { smpAssignable = 0 };
362 inline ReturnType
at(
size_t i,
size_t j )
const {
501 template<
typename T >
503 return matrix_.canAlias( alias );
513 template<
typename T >
515 return matrix_.isAliased( alias );
539 template<
typename MT2
549 assign( ~lhs, rhs.matrix_ );
550 (~lhs) *= rhs.scalar_;
569 template<
typename MT2
579 assign( ~lhs, rhs.matrix_ );
580 (~lhs) *= rhs.scalar_;
599 template<
typename MT2
601 friend inline typename EnableIf< UseAssign<MT2> >::Type
612 const ResultType tmp(
serial( rhs ) );
613 addAssign( ~lhs, tmp );
636 template<
typename MT2
638 friend inline typename EnableIf< UseAssign<MT2> >::Type
649 const ResultType tmp(
serial( rhs ) );
650 subAssign( ~lhs, tmp );
689 template<
typename MT2
691 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
702 const ResultType tmp( rhs );
726 template<
typename MT2
728 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
739 const ResultType tmp( rhs );
794 template<
typename MT
796 inline const SMatScalarMultExpr<MT,typename UnderlyingBuiltin<MT>::Type,SO>
836 template<
typename T1
839 inline const typename EnableIf< IsNumeric<T2>,
typename MultExprTrait<T1,T2>::Type >::Type
845 return Type( ~mat, scalar );
871 template<
typename T1
874 inline const typename EnableIf< IsNumeric<T1>,
typename MultExprTrait<T1,T2>::Type >::Type
880 return Type( ~mat, scalar );
905 template<
typename VT
908 inline const SMatScalarMultExpr<VT,ST,TF>
909 operator-(
const SMatScalarMultExpr<VT,ST,TF>& sm )
913 return SMatScalarMultExpr<VT,ST,TF>( sm.leftOperand(), -sm.rightOperand() );
940 template<
typename MT
944 inline const typename EnableIf< IsNumeric<ST2>
945 ,
typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
946 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
950 return mat.leftOperand() * ( mat.rightOperand() * scalar );
969 template<
typename ST1
973 inline const typename EnableIf< IsNumeric<ST1>
974 ,
typename MultExprTrait< ST1, SMatScalarMultExpr<MT,ST2,SO> >::Type >::Type
975 operator*( ST1 scalar,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
979 return mat.leftOperand() * ( scalar * mat.rightOperand() );
998 template<
typename MT
1002 inline const typename EnableIf< And< IsNumeric<ST2>, IsInvertible< typename DivTrait<ST1,ST2>::Type > >
1003 ,
typename DivExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
1004 operator/(
const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
1008 return mat.leftOperand() * ( mat.rightOperand() / scalar );
1028 template<
typename MT
1032 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
1033 operator*(
const SMatScalarMultExpr<MT,ST,SO>& mat,
const DenseVector<VT,false>& vec )
1037 return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1057 template<
typename VT
1061 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1062 operator*(
const DenseVector<VT,true>& vec,
const SMatScalarMultExpr<MT,ST,SO>& mat )
1066 return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1088 template<
typename MT
1093 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, DVecScalarMultExpr<VT,ST2,false> >::Type
1094 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat,
const DVecScalarMultExpr<VT,ST2,false>& vec )
1098 return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1120 template<
typename VT
1125 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1126 operator*(
const DVecScalarMultExpr<VT,ST1,true>& vec,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
1130 return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1150 template<
typename MT
1154 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
1155 operator*(
const SMatScalarMultExpr<MT,ST,SO>& mat,
const SparseVector<VT,false>& vec )
1159 return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1179 template<
typename VT
1183 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1184 operator*(
const SparseVector<VT,true>& vec,
const SMatScalarMultExpr<MT,ST,SO>& mat )
1188 return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1210 template<
typename MT
1215 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, SVecScalarMultExpr<VT,ST2,false> >::Type
1216 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat,
const SVecScalarMultExpr<VT,ST2,false>& vec )
1220 return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1242 template<
typename VT
1247 inline const typename MultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1248 operator*(
const SVecScalarMultExpr<VT,ST1,true>& vec,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
1252 return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1272 template<
typename MT1
1277 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1278 operator*(
const SMatScalarMultExpr<MT1,ST,SO1>& lhs,
const DenseMatrix<MT2,SO2>& rhs )
1282 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1302 template<
typename MT1
1307 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1308 operator*(
const DenseMatrix<MT1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1312 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1332 template<
typename MT1
1337 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1338 operator*(
const SMatScalarMultExpr<MT1,ST,SO1>& lhs,
const SparseMatrix<MT2,SO2>& rhs )
1342 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1362 template<
typename MT1
1367 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1368 operator*(
const SparseMatrix<MT1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1372 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1392 template<
typename MT1
1398 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST1,SO1>, SMatScalarMultExpr<MT2,ST2,SO2> >::Type
1399 operator*(
const SMatScalarMultExpr<MT1,ST1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST2,SO2>& rhs )
1403 return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1419 template<
typename MT,
typename ST,
bool SO >
1436 template<
typename MT,
typename ST,
bool SO >
1453 template<
typename MT,
typename ST,
bool SO >
1454 struct IsSymmetric<
SMatScalarMultExpr<MT,ST,SO> > :
public IsTrue< IsSymmetric<MT>::value >
1470 template<
typename MT,
typename ST,
bool SO >
1471 struct IsHermitian<
SMatScalarMultExpr<MT,ST,SO> > :
public IsTrue< IsHermitian<MT>::value >
1487 template<
typename MT,
typename ST,
bool SO >
1504 template<
typename MT,
typename ST,
bool SO >
1505 struct IsStrictlyLower<
SMatScalarMultExpr<MT,ST,SO> > :
public IsTrue< IsStrictlyLower<MT>::value >
1521 template<
typename MT,
typename ST,
bool SO >
1538 template<
typename MT,
typename ST,
bool SO >
1539 struct IsStrictlyUpper<
SMatScalarMultExpr<MT,ST,SO> > :
public IsTrue< IsStrictlyUpper<MT>::value >
1555 template<
typename MT,
typename ST1,
typename ST2 >
1560 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1561 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1562 ,
typename SMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1563 , INVALID_TYPE >::Type Type;
1580 template<
typename MT,
typename ST1,
typename ST2 >
1585 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1586 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1587 ,
typename TSMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1588 , INVALID_TYPE >::Type Type;
1605 template<
typename MT,
typename ST1,
typename ST2 >
1610 typedef typename DivTrait<ST1,ST2>::Type ScalarType;
1614 enum { condition = IsInvertible<ScalarType>::value };
1618 typedef typename SMatScalarMultExprTrait<MT,ScalarType>::Type T1;
1619 typedef typename SMatScalarDivExprTrait<MT,ScalarType>::Type T2;
1624 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1625 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1626 ,
typename SelectType<condition,T1,T2>::Type
1627 , INVALID_TYPE >::Type Type;
1644 template<
typename MT,
typename ST1,
typename ST2 >
1649 typedef typename DivTrait<ST1,ST2>::Type ScalarType;
1653 enum { condition = IsInvertible<ScalarType>::value };
1657 typedef typename TSMatScalarMultExprTrait<MT,ScalarType>::Type T1;
1658 typedef typename TSMatScalarDivExprTrait<MT,ScalarType>::Type T2;
1663 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1664 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1665 ,
typename SelectType<condition,T1,T2>::Type
1666 , INVALID_TYPE >::Type Type;
1683 template<
typename MT,
typename ST,
typename VT >
1688 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1689 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1690 IsNumeric<ST>::value
1691 ,
typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1692 , INVALID_TYPE >::Type Type;
1701 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1702 struct SMatDVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,false>, DVecScalarMultExpr<VT,ST2,false> >
1706 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1707 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1708 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1709 ,
typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1710 , INVALID_TYPE >::Type Type;
1727 template<
typename MT,
typename ST,
typename VT >
1732 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1733 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1734 IsNumeric<ST>::value
1735 ,
typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1736 , INVALID_TYPE >::Type Type;
1745 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1746 struct TSMatDVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,true>, DVecScalarMultExpr<VT,ST2,false> >
1750 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1751 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1752 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1753 ,
typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1754 , INVALID_TYPE >::Type Type;
1771 template<
typename VT,
typename MT,
typename ST >
1776 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1777 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1778 IsNumeric<ST>::value
1779 ,
typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1780 , INVALID_TYPE >::Type Type;
1789 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1790 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,false> >
1794 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1795 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1796 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1797 ,
typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1798 , INVALID_TYPE >::Type Type;
1815 template<
typename VT,
typename MT,
typename ST >
1820 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1821 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1822 IsNumeric<ST>::value
1823 ,
typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1824 , INVALID_TYPE >::Type Type;
1833 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1834 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,true> >
1838 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1839 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1840 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1841 ,
typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1842 , INVALID_TYPE >::Type Type;
1859 template<
typename MT,
typename ST,
typename VT >
1864 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1865 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1866 IsNumeric<ST>::value
1867 ,
typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1868 , INVALID_TYPE >::Type Type;
1877 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1878 struct SMatSVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,false>, SVecScalarMultExpr<VT,ST2,false> >
1882 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1883 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1884 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1885 ,
typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1886 , INVALID_TYPE >::Type Type;
1903 template<
typename MT,
typename ST,
typename VT >
1908 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1909 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1910 IsNumeric<ST>::value
1911 ,
typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1912 , INVALID_TYPE >::Type Type;
1921 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1922 struct TSMatSVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,true>, SVecScalarMultExpr<VT,ST2,false> >
1926 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1927 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1928 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1929 ,
typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1930 , INVALID_TYPE >::Type Type;
1947 template<
typename VT,
typename MT,
typename ST >
1952 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1953 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1954 IsNumeric<ST>::value
1955 ,
typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1956 , INVALID_TYPE >::Type Type;
1965 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1966 struct TSVecSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,false> >
1970 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1971 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1972 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1973 ,
typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1974 , INVALID_TYPE >::Type Type;
1991 template<
typename VT,
typename MT,
typename ST >
1996 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1997 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1998 IsNumeric<ST>::value
1999 ,
typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
2000 , INVALID_TYPE >::Type Type;
2009 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
2010 struct TSVecTSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,true> >
2014 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
2015 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2016 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2017 ,
typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2018 , INVALID_TYPE >::Type Type;
2035 template<
typename MT1,
typename MT2,
typename ST >
2040 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2041 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2042 IsNumeric<ST>::value
2043 ,
typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2044 , INVALID_TYPE >::Type Type;
2061 template<
typename MT1,
typename MT2,
typename ST >
2066 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2067 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2068 IsNumeric<ST>::value
2069 ,
typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2070 , INVALID_TYPE >::Type Type;
2087 template<
typename MT1,
typename MT2,
typename ST >
2092 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2093 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2094 IsNumeric<ST>::value
2095 ,
typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2096 , INVALID_TYPE >::Type Type;
2113 template<
typename MT1,
typename MT2,
typename ST >
2118 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2119 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2120 IsNumeric<ST>::value
2121 ,
typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2122 , INVALID_TYPE >::Type Type;
2139 template<
typename MT1,
typename ST,
typename MT2 >
2144 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2145 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2146 IsNumeric<ST>::value
2147 ,
typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2148 , INVALID_TYPE >::Type Type;
2165 template<
typename MT1,
typename ST,
typename MT2 >
2170 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2171 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2172 IsNumeric<ST>::value
2173 ,
typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2174 , INVALID_TYPE >::Type Type;
2191 template<
typename MT1,
typename ST,
typename MT2 >
2196 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2197 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2198 IsNumeric<ST>::value
2199 ,
typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2200 , INVALID_TYPE >::Type Type;
2217 template<
typename MT1,
typename ST,
typename MT2 >
2222 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2223 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2224 IsNumeric<ST>::value
2225 ,
typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2226 , INVALID_TYPE >::Type Type;
2243 template<
typename MT1,
typename ST,
typename MT2 >
2248 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2249 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2250 IsNumeric<ST>::value
2251 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2252 , INVALID_TYPE >::Type Type;
2261 template<
typename MT1,
typename MT2,
typename ST >
2266 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2267 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2268 IsNumeric<ST>::value
2269 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2270 , INVALID_TYPE >::Type Type;
2279 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2284 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2285 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2286 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2287 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2288 , INVALID_TYPE >::Type Type;
2305 template<
typename MT1,
typename ST,
typename MT2 >
2310 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2311 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2312 IsNumeric<ST>::value
2313 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2314 , INVALID_TYPE >::Type Type;
2323 template<
typename MT1,
typename MT2,
typename ST >
2328 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2329 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2330 IsNumeric<ST>::value
2331 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2332 , INVALID_TYPE >::Type Type;
2341 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2346 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2347 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2348 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2349 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2350 , INVALID_TYPE >::Type Type;
2367 template<
typename MT1,
typename ST,
typename MT2 >
2372 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2373 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2374 IsNumeric<ST>::value
2375 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2376 , INVALID_TYPE >::Type Type;
2385 template<
typename MT1,
typename MT2,
typename ST >
2390 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2391 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2392 IsNumeric<ST>::value
2393 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2394 , INVALID_TYPE >::Type Type;
2403 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2408 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2409 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2410 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2411 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2412 , INVALID_TYPE >::Type Type;
2429 template<
typename MT1,
typename ST,
typename MT2 >
2434 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2435 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2436 IsNumeric<ST>::value
2437 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2438 , INVALID_TYPE >::Type Type;
2447 template<
typename MT1,
typename MT2,
typename ST >
2452 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2453 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2454 IsNumeric<ST>::value
2455 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2456 , INVALID_TYPE >::Type Type;
2465 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2470 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2471 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2472 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2473 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2474 , INVALID_TYPE >::Type Type;
2491 template<
typename MT,
typename ST,
bool SO,
bool AF >
2496 typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type, ST >::Type Type;
2513 template<
typename MT,
typename ST,
bool SO >
2518 typedef typename MultExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
2535 template<
typename MT,
typename ST,
bool SO >
2540 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:410
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:7820
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:962
Header file for basic type definitions.
PointerType pointer
Pointer return type.
Definition: SMatScalarMultExpr.h:217
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type LeftOperand
Composite data type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:189
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:522
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatScalarMultExpr.h:390
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:81
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:318
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SMatScalarMultExpr.h:443
Header file for the ColumnExprTrait class template.
ValueType & ReferenceType
Reference return type.
Definition: SMatScalarMultExpr.h:211
LeftOperand leftOperand() const
Returns the left-hand side sparse matrix operand.
Definition: SMatScalarMultExpr.h:480
Header file for the IsColumnMajorMatrix type trait.
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.
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: SMatScalarMultExpr.h:490
size_t index() const
Access to the current index of the sparse element.
Definition: SMatScalarMultExpr.h:277
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
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatScalarMultExpr.h:180
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:521
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatScalarMultExpr.h:420
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SMatScalarMultExpr.h:137
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SMatScalarMultExpr.h:469
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatScalarMultExpr.h:179
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatScalarMultExpr.h:208
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
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:206
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:502
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:261
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatScalarMultExpr.h:379
Evaluation of the underlying builtin element type of a given data type.Via this type trait it is poss...
Definition: UnderlyingBuiltin.h:80
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:203
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:218
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:456
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatScalarMultExpr.h:236
Header file for the UnderlyingBuiltin type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatScalarMultExpr.h:178
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatScalarMultExpr.h:310
#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
Header file for the Columns type trait.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SMatScalarMultExpr.h:183
IteratorCategory iterator_category
The iterator category.
Definition: SMatScalarMultExpr.h:215
#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:192
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:642
#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:347
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:299
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:104
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:124
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:400
Header file for the serial shim.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatScalarMultExpr.h:212
ValueType * PointerType
Pointer return type.
Definition: SMatScalarMultExpr.h:210
Header file for the IsNumeric type trait.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatScalarMultExpr.h:362
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:2587
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:123
Base template for the MultTrait class.
Definition: MultTrait.h:138
ConstIterator(IteratorType matrix, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SMatScalarMultExpr.h:225
Header file for the division trait.
SelectType< useAssign, const ResultType, const SMatScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatScalarMultExpr.h:186
SMatScalarMultExpr< MT, ST, SO > This
Type of this SMatScalarMultExpr instance.
Definition: SMatScalarMultExpr.h:176
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:288
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:122
#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:198
DifferenceType difference_type
Difference between two iterators.
Definition: SMatScalarMultExpr.h:219
Header file for the RemoveReference type trait.
Header file for the IsInvertible type trait.
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarMultExpr.h:247
Element ValueType
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:209
Header file for the IsDenseVector type trait.
MultTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: SMatScalarMultExpr.h:177
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatScalarMultExpr.h:267
IteratorType matrix_
Iterator over the elements of the left-hand side sparse matrix expression.
Definition: SMatScalarMultExpr.h:317
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:514
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:2583
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:431
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:257
Header file for exception macros.
SMatScalarMultExpr(const MT &matrix, ST scalar)
Constructor for the SMatScalarMultExpr class.
Definition: SMatScalarMultExpr.h:334
Header file for the IsColumnVector type trait.
Header file for the IsHermitian type trait.
ValueType value_type
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:216
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.