35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
108 template<
typename MT
111 class SMatScalarMultExpr :
public SparseMatrix< SMatScalarMultExpr<MT,ST,SO>, SO >
112 ,
private MatScalarMultExpr
113 ,
private Computation
146 template<
typename MT2 >
149 enum { value = useAssign };
162 template<
typename MT2 >
163 struct UseSMPAssign {
164 enum { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
320 enum { smpAssignable = 0 };
477 template<
typename T >
479 return matrix_.canAlias( alias );
489 template<
typename T >
491 return matrix_.isAliased( alias );
515 template<
typename MT2
525 assign( ~lhs, rhs.matrix_ );
526 (~lhs) *= rhs.scalar_;
545 template<
typename MT2
555 assign( ~lhs, rhs.matrix_ );
556 (~lhs) *= rhs.scalar_;
575 template<
typename MT2
577 friend inline typename EnableIf< UseAssign<MT2> >::Type
612 template<
typename MT2
614 friend inline typename EnableIf< UseAssign<MT2> >::Type
665 template<
typename MT2
667 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
702 template<
typename MT2
704 friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
770 template<
typename MT
772 inline const SMatScalarMultExpr<MT,typename BaseElementType<MT>::Type,SO>
812 template<
typename T1
815 inline const typename EnableIf< IsNumeric<T2>,
typename MultExprTrait<T1,T2>::Type >::Type
821 return Type( ~mat, scalar );
847 template<
typename T1
850 inline const typename EnableIf< IsNumeric<T1>,
typename MultExprTrait<T1,T2>::Type >::Type
856 return Type( ~mat, scalar );
881 template<
typename VT
884 inline const SMatScalarMultExpr<VT,ST,TF>
885 operator-(
const SMatScalarMultExpr<VT,ST,TF>& sm )
889 return SMatScalarMultExpr<VT,ST,TF>( sm.leftOperand(), -sm.rightOperand() );
916 template<
typename MT
920 inline const typename EnableIf< IsNumeric<ST2>
921 ,
typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
922 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
926 return mat.leftOperand() * ( mat.rightOperand() * scalar );
945 template<
typename ST1
949 inline const typename EnableIf< IsNumeric<ST1>
950 ,
typename MultExprTrait< ST1, SMatScalarMultExpr<MT,ST2,SO> >::Type >::Type
951 operator*( ST1 scalar,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
955 return mat.leftOperand() * ( scalar * mat.rightOperand() );
974 template<
typename MT
978 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
979 ,
typename DivExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
980 operator/(
const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
984 return mat.leftOperand() * ( mat.rightOperand() / scalar );
1004 template<
typename MT
1008 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
1009 operator*(
const SMatScalarMultExpr<MT,ST,SO>& mat,
const DenseVector<VT,false>& vec )
1013 return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1033 template<
typename VT
1037 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1038 operator*(
const DenseVector<VT,true>& vec,
const SMatScalarMultExpr<MT,ST,SO>& mat )
1042 return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1064 template<
typename MT
1069 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, DVecScalarMultExpr<VT,ST2,false> >::Type
1070 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat,
const DVecScalarMultExpr<VT,ST2,false>& vec )
1074 return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1096 template<
typename VT
1101 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1102 operator*(
const DVecScalarMultExpr<VT,ST1,true>& vec,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
1106 return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1126 template<
typename MT
1130 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
1131 operator*(
const SMatScalarMultExpr<MT,ST,SO>& mat,
const SparseVector<VT,false>& vec )
1135 return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1155 template<
typename VT
1159 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1160 operator*(
const SparseVector<VT,true>& vec,
const SMatScalarMultExpr<MT,ST,SO>& mat )
1164 return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1186 template<
typename MT
1191 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, SVecScalarMultExpr<VT,ST2,false> >::Type
1192 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat,
const SVecScalarMultExpr<VT,ST2,false>& vec )
1196 return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1218 template<
typename VT
1223 inline const typename MultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1224 operator*(
const SVecScalarMultExpr<VT,ST1,true>& vec,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
1228 return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1248 template<
typename MT1
1253 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1254 operator*(
const SMatScalarMultExpr<MT1,ST,SO1>& lhs,
const DenseMatrix<MT2,SO2>& rhs )
1258 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1278 template<
typename MT1
1283 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1284 operator*(
const DenseMatrix<MT1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1288 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1308 template<
typename MT1
1313 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1314 operator*(
const SMatScalarMultExpr<MT1,ST,SO1>& lhs,
const SparseMatrix<MT2,SO2>& rhs )
1318 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1338 template<
typename MT1
1343 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1344 operator*(
const SparseMatrix<MT1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1348 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1368 template<
typename MT1
1374 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST1,SO1>, SMatScalarMultExpr<MT2,ST2,SO2> >::Type
1375 operator*(
const SMatScalarMultExpr<MT1,ST1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST2,SO2>& rhs )
1379 return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1395 template<
typename MT,
typename ST,
bool SO >
1412 template<
typename MT,
typename ST,
bool SO >
1429 template<
typename MT,
typename ST,
bool SO >
1430 struct IsSymmetric<
SMatScalarMultExpr<MT,ST,SO> > :
public IsTrue< IsSymmetric<MT>::value >
1446 template<
typename MT,
typename ST,
bool SO >
1463 template<
typename MT,
typename ST,
bool SO >
1480 template<
typename MT,
typename ST1,
typename ST2 >
1485 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1486 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1487 ,
typename SMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1488 , INVALID_TYPE >::Type Type;
1505 template<
typename MT,
typename ST1,
typename ST2 >
1510 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1511 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1512 ,
typename TSMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1513 , INVALID_TYPE >::Type Type;
1530 template<
typename MT,
typename ST1,
typename ST2 >
1535 enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1539 typedef typename SMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1540 typedef typename SMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1545 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1546 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1547 ,
typename SelectType<condition,T1,T2>::Type
1548 , INVALID_TYPE >::Type Type;
1565 template<
typename MT,
typename ST1,
typename ST2 >
1570 enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1574 typedef typename TSMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1575 typedef typename TSMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1580 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1581 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1582 ,
typename SelectType<condition,T1,T2>::Type
1583 , INVALID_TYPE >::Type Type;
1600 template<
typename MT,
typename ST,
typename VT >
1605 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1606 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1607 IsNumeric<ST>::value
1608 ,
typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1609 , INVALID_TYPE >::Type Type;
1618 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1619 struct SMatDVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,false>, DVecScalarMultExpr<VT,ST2,false> >
1623 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1624 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1625 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1626 ,
typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1627 , INVALID_TYPE >::Type Type;
1644 template<
typename MT,
typename ST,
typename VT >
1649 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1650 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1651 IsNumeric<ST>::value
1652 ,
typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1653 , INVALID_TYPE >::Type Type;
1662 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1663 struct TSMatDVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,true>, DVecScalarMultExpr<VT,ST2,false> >
1667 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1668 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1669 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1670 ,
typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1671 , INVALID_TYPE >::Type Type;
1688 template<
typename VT,
typename MT,
typename ST >
1693 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1694 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1695 IsNumeric<ST>::value
1696 ,
typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1697 , INVALID_TYPE >::Type Type;
1706 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1707 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,false> >
1711 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1712 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1713 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1714 ,
typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1715 , INVALID_TYPE >::Type Type;
1732 template<
typename VT,
typename MT,
typename ST >
1737 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1738 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1739 IsNumeric<ST>::value
1740 ,
typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1741 , INVALID_TYPE >::Type Type;
1750 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1751 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,true> >
1755 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1756 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1757 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1758 ,
typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1759 , INVALID_TYPE >::Type Type;
1776 template<
typename MT,
typename ST,
typename VT >
1781 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1782 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1783 IsNumeric<ST>::value
1784 ,
typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1785 , INVALID_TYPE >::Type Type;
1794 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1795 struct SMatSVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,false>, SVecScalarMultExpr<VT,ST2,false> >
1799 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1800 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1801 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1802 ,
typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1803 , INVALID_TYPE >::Type Type;
1820 template<
typename MT,
typename ST,
typename VT >
1825 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1826 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1827 IsNumeric<ST>::value
1828 ,
typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1829 , INVALID_TYPE >::Type Type;
1838 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1839 struct TSMatSVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,true>, SVecScalarMultExpr<VT,ST2,false> >
1843 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1844 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1845 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1846 ,
typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1847 , INVALID_TYPE >::Type Type;
1864 template<
typename VT,
typename MT,
typename ST >
1869 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1870 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1871 IsNumeric<ST>::value
1872 ,
typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1873 , INVALID_TYPE >::Type Type;
1882 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1883 struct TSVecSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,false> >
1887 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1888 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1889 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1890 ,
typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1891 , INVALID_TYPE >::Type Type;
1908 template<
typename VT,
typename MT,
typename ST >
1913 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1914 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1915 IsNumeric<ST>::value
1916 ,
typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1917 , INVALID_TYPE >::Type Type;
1926 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1927 struct TSVecTSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,true> >
1931 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1932 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1933 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1934 ,
typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1935 , INVALID_TYPE >::Type Type;
1952 template<
typename MT1,
typename MT2,
typename ST >
1957 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1958 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1959 IsNumeric<ST>::value
1960 ,
typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1961 , INVALID_TYPE >::Type Type;
1978 template<
typename MT1,
typename MT2,
typename ST >
1983 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1984 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1985 IsNumeric<ST>::value
1986 ,
typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1987 , INVALID_TYPE >::Type Type;
2004 template<
typename MT1,
typename MT2,
typename ST >
2009 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2010 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2011 IsNumeric<ST>::value
2012 ,
typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2013 , INVALID_TYPE >::Type Type;
2030 template<
typename MT1,
typename MT2,
typename ST >
2035 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2036 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2037 IsNumeric<ST>::value
2038 ,
typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2039 , INVALID_TYPE >::Type Type;
2056 template<
typename MT1,
typename ST,
typename MT2 >
2061 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2062 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2063 IsNumeric<ST>::value
2064 ,
typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2065 , INVALID_TYPE >::Type Type;
2082 template<
typename MT1,
typename ST,
typename MT2 >
2087 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2088 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2089 IsNumeric<ST>::value
2090 ,
typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2091 , INVALID_TYPE >::Type Type;
2108 template<
typename MT1,
typename ST,
typename MT2 >
2113 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2114 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2115 IsNumeric<ST>::value
2116 ,
typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2117 , INVALID_TYPE >::Type Type;
2134 template<
typename MT1,
typename ST,
typename MT2 >
2139 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2140 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2141 IsNumeric<ST>::value
2142 ,
typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2143 , INVALID_TYPE >::Type Type;
2160 template<
typename MT1,
typename ST,
typename MT2 >
2165 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2166 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2167 IsNumeric<ST>::value
2168 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2169 , INVALID_TYPE >::Type Type;
2178 template<
typename MT1,
typename MT2,
typename ST >
2183 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2184 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2185 IsNumeric<ST>::value
2186 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2187 , INVALID_TYPE >::Type Type;
2196 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2201 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2202 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2203 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2204 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2205 , INVALID_TYPE >::Type Type;
2222 template<
typename MT1,
typename ST,
typename MT2 >
2227 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2228 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2229 IsNumeric<ST>::value
2230 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2231 , INVALID_TYPE >::Type Type;
2240 template<
typename MT1,
typename MT2,
typename ST >
2245 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2246 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2247 IsNumeric<ST>::value
2248 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2249 , INVALID_TYPE >::Type Type;
2258 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2263 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2264 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2265 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2266 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2267 , INVALID_TYPE >::Type Type;
2284 template<
typename MT1,
typename ST,
typename MT2 >
2289 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2290 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2291 IsNumeric<ST>::value
2292 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2293 , INVALID_TYPE >::Type Type;
2302 template<
typename MT1,
typename MT2,
typename ST >
2307 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2308 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2309 IsNumeric<ST>::value
2310 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2311 , INVALID_TYPE >::Type Type;
2320 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2325 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2326 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2327 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2328 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2329 , INVALID_TYPE >::Type Type;
2346 template<
typename MT1,
typename ST,
typename MT2 >
2351 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2352 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2353 IsNumeric<ST>::value
2354 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2355 , INVALID_TYPE >::Type Type;
2364 template<
typename MT1,
typename MT2,
typename ST >
2369 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2370 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2371 IsNumeric<ST>::value
2372 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2373 , INVALID_TYPE >::Type Type;
2382 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2387 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2388 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2389 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2390 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2391 , INVALID_TYPE >::Type Type;
2408 template<
typename MT,
typename ST,
bool SO,
bool AF >
2413 typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type, ST >::Type Type;
2430 template<
typename MT,
typename ST,
bool SO >
2435 typedef typename MultExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
2452 template<
typename MT,
typename ST,
bool SO >
2457 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
Header file for the Rows type trait.
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:4838
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:936
PointerType pointer
Pointer return type.
Definition: SMatScalarMultExpr.h:212
IteratorCategory iterator_category
The iterator category.
Definition: SMatScalarMultExpr.h:210
MT::CompositeType CT
Composite type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:119
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:205
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:201
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatScalarMultExpr.h:305
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2478
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:257
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatScalarMultExpr.h:207
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatScalarMultExpr.h:386
ValueType value_type
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:211
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:695
Header file for the Computation base class.
IteratorType matrix_
Iterator over the elements of the left-hand side sparse matrix expression.
Definition: SMatScalarMultExpr.h:312
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:490
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatScalarMultExpr.h:366
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:203
Constraint on the data type.
SelectType< useAssign, const ResultType, const SMatScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatScalarMultExpr.h:181
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:478
Constraint on the data type.
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:259
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.
Header file for the IsSymmetric type trait.
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:498
Header file for the IsFloatingPoint type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
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.
Element ValueType
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:204
#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.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SMatScalarMultExpr.h:178
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:432
#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:172
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:313
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SMatScalarMultExpr.h:132
Constraint on the data type.
Header file for the SelectType class template.
SMatScalarMultExpr(const MT &matrix, ST scalar)
Constructor for the SMatScalarMultExpr class.
Definition: SMatScalarMultExpr.h:329
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:355
Header file for the EnableIf class template.
SMatScalarMultExpr< MT, ST, SO > This
Type of this SMatScalarMultExpr instance.
Definition: SMatScalarMultExpr.h:171
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:497
Header file for the IsNumeric type trait.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatScalarMultExpr.h:376
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:2477
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:142
BLAZE_ALWAYS_INLINE void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:742
Header file for the division trait.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatScalarMultExpr.h:396
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:294
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:283
#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:466
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarMultExpr.h:242
#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:193
Evaluation of the base element type of a given data type.Via this type trait it is possible to evalua...
Definition: BaseElementType.h:80
Header file for the RemoveReference type trait.
ValueType * PointerType
Pointer return type.
Definition: SMatScalarMultExpr.h:205
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatScalarMultExpr.h:231
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:342
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatScalarMultExpr.h:175
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SMatScalarMultExpr.h:445
ReferenceType reference
Reference return type.
Definition: SMatScalarMultExpr.h:213
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:198
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatScalarMultExpr.h:262
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatScalarMultExpr.h:407
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:70
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type LeftOperand
Composite data type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:184
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:252
Header file for the IsComputation type trait class.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SMatScalarMultExpr.h:187
#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:2473
Header file for the IsTrue value trait.
Header file for basic type definitions.
ConstIterator(IteratorType matrix, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SMatScalarMultExpr.h:220
Header file for the IsUpper type trait.
size_t index() const
Access to the current index of the sparse element.
Definition: SMatScalarMultExpr.h:272
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatScalarMultExpr.h:173
Header file for the IsColumnVector type trait.
DifferenceType difference_type
Difference between two iterators.
Definition: SMatScalarMultExpr.h:214
ValueType & ReferenceType
Reference return type.
Definition: SMatScalarMultExpr.h:206
MT::ReturnType RN
Return type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:118
MT::ResultType RT
Result type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:117
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:174
#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
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SMatScalarMultExpr.h:419
LeftOperand leftOperand() const
Returns the left-hand side sparse matrix operand.
Definition: SMatScalarMultExpr.h:456
#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