35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
115 template<
typename MT
118 class SMatScalarMultExpr :
public SparseMatrix< SMatScalarMultExpr<MT,ST,SO>, SO >
119 ,
private MatScalarMultExpr
120 ,
private Computation
153 template<
typename MT2 >
156 enum :
bool { value = useAssign };
169 template<
typename MT2 >
170 struct UseSMPAssign {
171 enum :
bool { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
327 enum :
bool { smpAssignable =
false };
364 inline ReturnType
at(
size_t i,
size_t j )
const {
402 inline size_t rows() const noexcept {
503 template<
typename T >
504 inline bool canAlias(
const T* alias )
const noexcept {
505 return matrix_.canAlias( alias );
515 template<
typename T >
516 inline bool isAliased(
const T* alias )
const noexcept {
517 return matrix_.isAliased( alias );
541 template<
typename MT2
551 assign( ~lhs, rhs.matrix_ );
552 (~lhs) *= rhs.scalar_;
571 template<
typename MT2
581 assign( ~lhs, rhs.matrix_ );
582 (~lhs) *= rhs.scalar_;
601 template<
typename MT2
603 friend inline EnableIf_< UseAssign<MT2> >
614 const ResultType tmp(
serial( rhs ) );
615 addAssign( ~lhs, tmp );
638 template<
typename MT2
640 friend inline EnableIf_< UseAssign<MT2> >
651 const ResultType tmp(
serial( rhs ) );
652 subAssign( ~lhs, tmp );
691 template<
typename MT2
693 friend inline EnableIf_< UseSMPAssign<MT2> >
704 const ResultType tmp( rhs );
728 template<
typename MT2
730 friend inline EnableIf_< UseSMPAssign<MT2> >
741 const ResultType tmp( rhs );
796 template<
typename MT
798 inline const SMatScalarMultExpr<MT,UnderlyingBuiltin_<MT>,SO>
838 template<
typename T1
841 inline const EnableIf_< IsNumeric<T2>, MultExprTrait_<T1,T2> >
872 template<
typename T1
875 inline const EnableIf_< IsNumeric<T1>, MultExprTrait_<T1,T2> >
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 EnableIf_< IsNumeric<ST2>
945 , MultExprTrait_< SMatScalarMultExpr<MT,ST1,SO>, ST2 > >
946 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
950 return mat.leftOperand() * ( mat.rightOperand() * scalar );
969 template<
typename ST1
973 inline const EnableIf_< IsNumeric<ST1>
974 , MultExprTrait_< ST1, SMatScalarMultExpr<MT,ST2,SO> > >
975 operator*( ST1 scalar,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
979 return mat.leftOperand() * ( scalar * mat.rightOperand() );
998 template<
typename MT
1002 inline const EnableIf_< And< IsNumeric<ST2>, Or< IsInvertible<ST1>, IsInvertible<ST2> > >
1003 , DivExprTrait_< SMatScalarMultExpr<MT,ST1,SO>, ST2 > >
1004 operator/(
const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
1008 return mat.leftOperand() * ( mat.rightOperand() / scalar );
1028 template<
typename MT
1032 inline const MultExprTrait_< SMatScalarMultExpr<MT,ST,SO>, VT >
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 MultExprTrait_< VT, SMatScalarMultExpr<MT,ST,SO> >
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 MultExprTrait_< SMatScalarMultExpr<MT,ST1,SO>, DVecScalarMultExpr<VT,ST2,false> >
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 MultExprTrait_< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >
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 MultExprTrait_< SMatScalarMultExpr<MT,ST,SO>, VT >
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 MultExprTrait_< VT, SMatScalarMultExpr<MT,ST,SO> >
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 MultExprTrait_< SMatScalarMultExpr<MT,ST1,SO>, SVecScalarMultExpr<VT,ST2,false> >
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 MultExprTrait_< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >
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 MultExprTrait_< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >
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 MultExprTrait_< MT1, SMatScalarMultExpr<MT2,ST,SO2> >
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 MultExprTrait_< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >
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 MultExprTrait_< MT1, SMatScalarMultExpr<MT2,ST,SO2> >
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 MultExprTrait_< SMatScalarMultExpr<MT1,ST1,SO1>, SMatScalarMultExpr<MT2,ST2,SO2> >
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 >
1471 template<
typename MT,
typename ST,
bool SO >
1489 template<
typename MT,
typename ST,
bool SO >
1507 template<
typename MT,
typename ST,
bool SO >
1525 template<
typename MT,
typename ST,
bool SO >
1543 template<
typename MT,
typename ST,
bool SO >
1561 template<
typename MT,
typename ST1,
typename ST2 >
1566 using Type = If_< And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT>
1567 , IsNumeric<ST1>, IsNumeric<ST2> >
1568 , SMatScalarMultExprTrait_< MT, MultTrait_<ST1,ST2> >
1586 template<
typename MT,
typename ST1,
typename ST2 >
1591 using Type = If_< And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT>
1592 , IsNumeric<ST1>, IsNumeric<ST2> >
1593 , TSMatScalarMultExprTrait_< MT, MultTrait_<ST1,ST2> >
1611 template<
typename MT,
typename ST1,
typename ST2 >
1616 using ScalarType = DivTrait_<ST1,ST2>;
1621 using Type = If_< And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT>
1622 , IsNumeric<ST1>, IsNumeric<ST2> >
1623 , If_< IsInvertible<ScalarType>
1624 , SMatScalarMultExprTrait_<MT,ScalarType>
1625 , SMatScalarDivExprTrait_<MT,ScalarType> >
1643 template<
typename MT,
typename ST1,
typename ST2 >
1648 using ScalarType = DivTrait_<ST1,ST2>;
1653 using Type = If_< And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT>
1654 , IsNumeric<ST1>, IsNumeric<ST2> >
1655 , If_< IsInvertible<ScalarType>
1656 , TSMatScalarMultExprTrait_<MT,ScalarType>
1657 , TSMatScalarDivExprTrait_<MT,ScalarType> >
1675 template<
typename MT,
typename ST,
typename VT >
1680 using Type = If_< And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT>
1681 , IsDenseVector<VT>, IsColumnVector<VT>
1683 , DVecScalarMultExprTrait_< SMatDVecMultExprTrait_<MT,VT>, ST >
1693 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1694 struct SMatDVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,false>, DVecScalarMultExpr<VT,ST2,false> >
1698 using Type = If_< And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT>
1699 , IsDenseVector<VT>, IsColumnVector<VT>
1700 , IsNumeric<ST1>, IsNumeric<ST2> >
1701 , DVecScalarMultExprTrait_< SMatDVecMultExprTrait_<MT,VT>, MultTrait_<ST1,ST2> >
1719 template<
typename MT,
typename ST,
typename VT >
1724 using Type = If_< And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT>
1725 , IsDenseVector<VT>, IsColumnVector<VT>
1727 , DVecScalarMultExprTrait_< TSMatDVecMultExprTrait_<MT,VT>, ST >
1737 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1738 struct TSMatDVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,true>, DVecScalarMultExpr<VT,ST2,false> >
1742 using Type = If_< And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT>
1743 , IsDenseVector<VT>, IsColumnVector<VT>
1744 , IsNumeric<ST1>, IsNumeric<ST2> >
1745 , DVecScalarMultExprTrait_< TSMatDVecMultExprTrait_<MT,VT>, MultTrait_<ST1,ST2> >
1763 template<
typename VT,
typename MT,
typename ST >
1768 using Type = If_< And< IsDenseVector<VT>, IsRowVector<VT>
1769 , IsSparseMatrix<MT>, IsRowMajorMatrix<MT>
1771 , TDVecScalarMultExprTrait_< TDVecSMatMultExprTrait_<VT,MT>, ST >
1781 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1782 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,false> >
1786 using Type = If_< And< IsDenseVector<VT>, IsRowVector<VT>
1787 , IsSparseMatrix<MT>, IsRowMajorMatrix<MT>
1788 , IsNumeric<ST1>, IsNumeric<ST2> >
1789 , TDVecScalarMultExprTrait_< TDVecSMatMultExprTrait_<VT,MT>, MultTrait_<ST1,ST2> >
1807 template<
typename VT,
typename MT,
typename ST >
1812 using Type = If_< And< IsDenseVector<VT>, IsRowVector<VT>
1813 , IsSparseMatrix<MT>, IsColumnMajorMatrix<MT>
1815 , TDVecScalarMultExprTrait_< TDVecTSMatMultExprTrait_<VT,MT>, ST >
1825 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1826 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,true> >
1830 using Type = If_< And< IsDenseVector<VT>, IsRowVector<VT>
1831 , IsSparseMatrix<MT>, IsColumnMajorMatrix<MT>
1832 , IsNumeric<ST1>, IsNumeric<ST2> >
1833 , TDVecScalarMultExprTrait_< TDVecTSMatMultExprTrait_<VT,MT>, MultTrait_<ST1,ST2> >
1851 template<
typename MT,
typename ST,
typename VT >
1856 using Type = If_< And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT>
1857 , IsSparseVector<VT>, IsColumnVector<VT>
1859 , SVecScalarMultExprTrait_< SMatSVecMultExprTrait_<MT,VT>, ST >
1869 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1870 struct SMatSVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,false>, SVecScalarMultExpr<VT,ST2,false> >
1874 using Type = If_< And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT>
1875 , IsSparseVector<VT>, IsColumnVector<VT>
1876 , IsNumeric<ST1>, IsNumeric<ST2> >
1877 , SVecScalarMultExprTrait_< SMatSVecMultExprTrait_<MT,VT>, MultTrait_<ST1,ST2> >
1895 template<
typename MT,
typename ST,
typename VT >
1900 using Type = If_< And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT>
1901 , IsSparseVector<VT>, IsColumnVector<VT>
1903 , SVecScalarMultExprTrait_< TSMatSVecMultExprTrait_<MT,VT>, ST >
1913 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1914 struct TSMatSVecMultExprTrait<
SMatScalarMultExpr<MT,ST1,true>, SVecScalarMultExpr<VT,ST2,false> >
1918 using Type = If_< And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT>
1919 , IsSparseVector<VT>, IsColumnVector<VT>
1920 , IsNumeric<ST1>, IsNumeric<ST2> >
1921 , SVecScalarMultExprTrait_< TSMatSVecMultExprTrait_<MT,VT>, MultTrait_<ST1,ST2> >
1939 template<
typename VT,
typename MT,
typename ST >
1944 using Type = If_< And< IsSparseVector<VT>, IsRowVector<VT>
1945 , IsSparseMatrix<MT>, IsRowMajorMatrix<MT>
1947 , TSVecScalarMultExprTrait_< TSVecSMatMultExprTrait_<VT,MT>, ST >
1957 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1958 struct TSVecSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,false> >
1962 using Type = If_< And< IsSparseVector<VT>, IsRowVector<VT>
1963 , IsSparseMatrix<MT>, IsRowMajorMatrix<MT>
1964 , IsNumeric<ST1>, IsNumeric<ST2> >
1965 , TSVecScalarMultExprTrait_< TSVecSMatMultExprTrait_<VT,MT>, MultTrait_<ST1,ST2> >
1983 template<
typename VT,
typename MT,
typename ST >
1988 using Type = If_< And< IsSparseVector<VT>, IsRowVector<VT>
1989 , IsSparseMatrix<MT>, IsColumnMajorMatrix<MT>
1991 , TSVecScalarMultExprTrait_< TSVecTSMatMultExprTrait_<VT,MT>, ST >
2001 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
2002 struct TSVecTSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>,
SMatScalarMultExpr<MT,ST2,true> >
2006 using Type = If_< And< IsSparseVector<VT>, IsRowVector<VT>
2007 , IsSparseMatrix<MT>, IsColumnMajorMatrix<MT>
2008 , IsNumeric<ST1>, IsNumeric<ST2> >
2009 , TSVecScalarMultExprTrait_< TSVecTSMatMultExprTrait_<VT,MT>, MultTrait_<ST1,ST2> >
2027 template<
typename MT1,
typename MT2,
typename ST >
2032 using Type = If_< And< IsDenseMatrix<MT1>, IsRowMajorMatrix<MT1>
2033 , IsSparseMatrix<MT2>, IsRowMajorMatrix<MT2>
2035 , DMatScalarMultExprTrait_< DMatSMatMultExprTrait_<MT1,MT2>, ST >
2053 template<
typename MT1,
typename MT2,
typename ST >
2058 using Type = If_< And< IsDenseMatrix<MT1>, IsRowMajorMatrix<MT1>
2059 , IsSparseMatrix<MT2>, IsColumnMajorMatrix<MT2>
2061 , DMatScalarMultExprTrait_< DMatTSMatMultExprTrait_<MT1,MT2>, ST >
2079 template<
typename MT1,
typename MT2,
typename ST >
2084 using Type = If_< And< IsDenseMatrix<MT1>, IsColumnMajorMatrix<MT1>
2085 , IsSparseMatrix<MT2>, IsRowMajorMatrix<MT2>
2087 , TDMatScalarMultExprTrait_< TDMatSMatMultExprTrait_<MT1,MT2>, ST >
2105 template<
typename MT1,
typename MT2,
typename ST >
2110 using Type = If_< And< IsDenseMatrix<MT1>, IsColumnMajorMatrix<MT1>
2111 , IsSparseMatrix<MT2>, IsColumnMajorMatrix<MT2>
2113 , TDMatScalarMultExprTrait_< TDMatTSMatMultExprTrait_<MT1,MT2>, ST >
2131 template<
typename MT1,
typename ST,
typename MT2 >
2136 using Type = If_< And< IsSparseMatrix<MT1>, IsRowMajorMatrix<MT1>
2137 , IsDenseMatrix<MT2>, IsRowMajorMatrix<MT2>
2139 , DMatScalarMultExprTrait_< SMatDMatMultExprTrait_<MT1,MT2>, ST >
2157 template<
typename MT1,
typename ST,
typename MT2 >
2162 using Type = If_< And< IsSparseMatrix<MT1>, IsRowMajorMatrix<MT1>
2163 , IsDenseMatrix<MT2>, IsColumnMajorMatrix<MT2>
2165 , DMatScalarMultExprTrait_< SMatTDMatMultExprTrait_<MT1,MT2>, ST >
2183 template<
typename MT1,
typename ST,
typename MT2 >
2188 using Type = If_< And< IsSparseMatrix<MT1>, IsColumnMajorMatrix<MT1>
2189 , IsDenseMatrix<MT2>, IsRowMajorMatrix<MT2>
2191 , TDMatScalarMultExprTrait_< TSMatDMatMultExprTrait_<MT1,MT2>, ST >
2209 template<
typename MT1,
typename ST,
typename MT2 >
2214 using Type = If_< And< IsSparseMatrix<MT1>, IsColumnMajorMatrix<MT1>
2215 , IsDenseMatrix<MT2>, IsColumnMajorMatrix<MT2>
2217 , TDMatScalarMultExprTrait_< TSMatTDMatMultExprTrait_<MT1,MT2>, ST >
2235 template<
typename MT1,
typename ST,
typename MT2 >
2240 using Type = If_< And< IsSparseMatrix<MT1>, IsRowMajorMatrix<MT1>
2241 , IsSparseMatrix<MT2>, IsRowMajorMatrix<MT2>
2243 , SMatScalarMultExprTrait_< SMatSMatMultExprTrait_<MT1,MT2>, ST >
2253 template<
typename MT1,
typename MT2,
typename ST >
2258 using Type = If_< And< IsSparseMatrix<MT1>, IsRowMajorMatrix<MT1>
2259 , IsSparseMatrix<MT2>, IsRowMajorMatrix<MT2>
2261 , SMatScalarMultExprTrait_< SMatSMatMultExprTrait_<MT1,MT2>, ST >
2271 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2276 using Type = If_< And< IsSparseMatrix<MT1>, IsRowMajorMatrix<MT1>
2277 , IsSparseMatrix<MT2>, IsRowMajorMatrix<MT2>
2278 , IsNumeric<ST1>, IsNumeric<ST2> >
2279 , SMatScalarMultExprTrait_< SMatSMatMultExprTrait_<MT1,MT2>, MultTrait_<ST1,ST2> >
2297 template<
typename MT1,
typename ST,
typename MT2 >
2302 using Type = If_< And< IsSparseMatrix<MT1>, IsRowMajorMatrix<MT1>
2303 , IsSparseMatrix<MT2>, IsColumnMajorMatrix<MT2>
2305 , SMatScalarMultExprTrait_< SMatTSMatMultExprTrait_<MT1,MT2>, ST >
2315 template<
typename MT1,
typename MT2,
typename ST >
2320 using Type = If_< And< IsSparseMatrix<MT1>, IsRowMajorMatrix<MT1>
2321 , IsSparseMatrix<MT2>, IsColumnMajorMatrix<MT2>
2323 , SMatScalarMultExprTrait_< SMatTSMatMultExprTrait_<MT1,MT2>, ST >
2333 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2338 using Type = If_< And< IsSparseMatrix<MT1>, IsRowMajorMatrix<MT1>
2339 , IsSparseMatrix<MT2>, IsColumnMajorMatrix<MT2>
2340 , IsNumeric<ST1>, IsNumeric<ST2> >
2341 , SMatScalarMultExprTrait_< SMatTSMatMultExprTrait_<MT1,MT2>, MultTrait_<ST1,ST2> >
2359 template<
typename MT1,
typename ST,
typename MT2 >
2364 using Type = If_< And< IsSparseMatrix<MT1>, IsColumnMajorMatrix<MT1>
2365 , IsSparseMatrix<MT2>, IsRowMajorMatrix<MT2>
2367 , TSMatScalarMultExprTrait_< TSMatSMatMultExprTrait_<MT1,MT2>, ST >
2377 template<
typename MT1,
typename MT2,
typename ST >
2382 using Type = If_< And< IsSparseMatrix<MT1>, IsColumnMajorMatrix<MT1>
2383 , IsSparseMatrix<MT2>, IsRowMajorMatrix<MT2>
2385 , TSMatScalarMultExprTrait_< TSMatSMatMultExprTrait_<MT1,MT2>, ST >
2395 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2400 using Type = If_< And< IsSparseMatrix<MT1>, IsColumnMajorMatrix<MT1>
2401 , IsSparseMatrix<MT2>, IsRowMajorMatrix<MT2>
2402 , IsNumeric<ST1>, IsNumeric<ST2> >
2403 , TSMatScalarMultExprTrait_< TSMatSMatMultExprTrait_<MT1,MT2>, MultTrait_<ST1,ST2> >
2421 template<
typename MT1,
typename ST,
typename MT2 >
2426 using Type = If_< And< IsSparseMatrix<MT1>, IsColumnMajorMatrix<MT1>
2427 , IsSparseMatrix<MT2>, IsColumnMajorMatrix<MT2>
2429 , TSMatScalarMultExprTrait_< TSMatTSMatMultExprTrait_<MT1,MT2>, ST >
2439 template<
typename MT1,
typename MT2,
typename ST >
2444 using Type = If_< And< IsSparseMatrix<MT1>, IsColumnMajorMatrix<MT1>
2445 , IsSparseMatrix<MT2>, IsColumnMajorMatrix<MT2>
2447 , TSMatScalarMultExprTrait_< TSMatTSMatMultExprTrait_<MT1,MT2>, ST >
2457 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2462 using Type = If_< And< IsSparseMatrix<MT1>, IsColumnMajorMatrix<MT1>
2463 , IsSparseMatrix<MT2>, IsColumnMajorMatrix<MT2>
2464 , IsNumeric<ST1>, IsNumeric<ST2> >
2465 , TSMatScalarMultExprTrait_< TSMatTSMatMultExprTrait_<MT1,MT2>, MultTrait_<ST1,ST2> >
2483 template<
typename MT,
typename ST,
bool SO,
bool AF >
2488 using Type = MultExprTrait_< SubmatrixExprTrait_<const MT,AF>, ST >;
2505 template<
typename MT,
typename ST,
bool SO >
2510 using Type = MultExprTrait_< RowExprTrait_<const MT>, ST >;
2527 template<
typename MT,
typename ST,
bool SO >
2532 using Type = MultExprTrait_< ColumnExprTrait_<const MT>, ST >;
Pointer difference type of the Blaze library.
Header file for auxiliary alias declarations.
Constraint on the data type.
ReturnType_< MT > RN
Return type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:125
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:70
Header file for the Rows type trait.
MultExprTrait_< RN, ST > ExprReturnType
Expression return type for the subscript operator.
Definition: SMatScalarMultExpr.h:139
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:7800
Header file for basic type definitions.
PointerType pointer
Pointer return type.
Definition: SMatScalarMultExpr.h:219
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:524
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatScalarMultExpr.h:392
EnableIf_< IsDenseMatrix< MT1 > > 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
ConstIterator_< RemoveReference_< LeftOperand > > IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:208
Header file for the IsSparseMatrix type trait.
Header file for the serial shim.
#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:63
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:320
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SMatScalarMultExpr.h:445
Header file for the ColumnExprTrait class template.
ValueType & ReferenceType
Reference return type.
Definition: SMatScalarMultExpr.h:213
Header file for the IsColumnMajorMatrix type trait.
MultTrait_< RT, ST > ResultType
Result type for expression template evaluations.
Definition: SMatScalarMultExpr.h:179
Header file for the IsRowVector type trait.
Header file for the And class template.
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SMatScalarMultExpr.h:181
size_t index() const
Access to the current index of the sparse element.
Definition: SMatScalarMultExpr.h:279
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:245
Header file for the Computation base class.
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:731
Header file for the RequiresEvaluation type trait.
LeftOperand matrix_
Left-hand side sparse matrix of the multiplication expression.
Definition: SMatScalarMultExpr.h:523
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatScalarMultExpr.h:422
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
EnableIf_< IsDenseMatrix< MT1 > > 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
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SMatScalarMultExpr.h:471
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatScalarMultExpr.h:210
typename UnderlyingBuiltin< T >::Type UnderlyingBuiltin_
Auxiliary alias declaration for the UnderlyingBuiltin type trait.The UnderlyingBuiltin_ alias declara...
Definition: UnderlyingBuiltin.h:133
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:109
Constraint on the data type.
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
Header file for the SparseMatrix base class.
Header file for the DivExprTrait class template.
Constraint on the data type.
typename MultExprTrait< T1, T2 >::Type MultExprTrait_
Auxiliary alias declaration for the MultExprTrait class template.The MultExprTrait_ alias declaration...
Definition: MultExprTrait.h:344
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:72
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
ResultType_< MT > RT
Result type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:124
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatScalarMultExpr.h:381
const EnableIf_< IsNumeric< T2 >, DivExprTrait_< T1, T2 > > operator/(const DenseMatrix< T1, SO > &mat, T2 scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:966
Header file for the ValueIndexPair class.
SMatScalarMultExpr(const MT &matrix, ST scalar) noexcept
Constructor for the SMatScalarMultExpr class.
Definition: SMatScalarMultExpr.h:336
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:205
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
Header file for the If class template.
ReferenceType reference
Reference return type.
Definition: SMatScalarMultExpr.h:220
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:458
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatScalarMultExpr.h:238
Header file for the UnderlyingBuiltin type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatScalarMultExpr.h:312
Header file for the Or class template.
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the Columns type trait.
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: SMatScalarMultExpr.h:185
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatScalarMultExpr.h:412
IteratorCategory iterator_category
The iterator category.
Definition: SMatScalarMultExpr.h:217
#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:71
Header file for the IsLower type trait.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SMatScalarMultExpr.h:194
ElementType_< ResultType > ElementType
Resulting element type.
Definition: SMatScalarMultExpr.h:182
#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:60
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatScalarMultExpr.h:349
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:301
Constraints on the storage order of matrix types.
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse matrix operand.
Definition: SMatScalarMultExpr.h:482
Header file for the exception macros of the math module.
Constraint on the data type.
Header file for the RowExprTrait class template.
Expression object for sparse matrix-scalar multiplications.The SMatScalarMult class represents the co...
Definition: Forward.h:96
Header file for all forward declarations for expression class templates.
Header file for the IsDenseMatrix type trait.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatScalarMultExpr.h:214
ValueType * PointerType
Pointer return type.
Definition: SMatScalarMultExpr.h:212
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatScalarMultExpr.h:516
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:364
Header file for the IsSparseVector type trait.
Header file for the SubmatrixExprTrait class template.
Header file for the MatScalarMultExpr base class.
Header file for run time assertion macros.
Utility type for generic codes.
ConstIterator(IteratorType matrix, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SMatScalarMultExpr.h:227
Header file for the division trait.
SMatScalarMultExpr< MT, ST, SO > This
Type of this SMatScalarMultExpr instance.
Definition: SMatScalarMultExpr.h:178
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:160
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:290
#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:61
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatScalarMultExpr.h:402
IfTrue_< useAssign, const ResultType, const SMatScalarMultExpr & > CompositeType
Data type for composite expression templates.
Definition: SMatScalarMultExpr.h:188
#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:81
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
Iterator over the elements of the sparse matrix/scalar multiplication expression. ...
Definition: SMatScalarMultExpr.h:200
DifferenceType difference_type
Difference between two iterators.
Definition: SMatScalarMultExpr.h:221
Header file for the RemoveReference type trait.
Header file for the IsInvertible type trait.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarMultExpr.h:249
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
Element ValueType
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:211
Header file for the IsDenseVector type trait.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatScalarMultExpr.h:504
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: SMatScalarMultExpr.h:492
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatScalarMultExpr.h:269
IteratorType matrix_
Iterator over the elements of the left-hand side sparse matrix expression.
Definition: SMatScalarMultExpr.h:319
If_< IsExpression< MT >, const MT, const MT & > LeftOperand
Composite data type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:191
CompositeType_< MT > CT
Composite type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:126
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.
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatScalarMultExpr.h:180
Header file for the IsComputation type trait class.
#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
Header file for the IntegralConstant class template.
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatScalarMultExpr.h:433
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
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:259
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:218
#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:61
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.