35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
100 template<
typename MT
103 class SMatScalarMultExpr :
public SparseMatrix< SMatScalarMultExpr<MT,ST,SO>, SO >
104 ,
private MatScalarMultExpr
105 ,
private Computation
138 template<
typename MT2 >
141 enum { value = useAssign };
410 template<
typename T >
412 return matrix_.canAlias( alias );
422 template<
typename T >
424 return matrix_.isAliased( alias );
448 template<
typename MT2
458 assign( ~lhs, rhs.matrix_ );
459 (~lhs) *= rhs.scalar_;
478 template<
typename MT2
488 assign( ~lhs, rhs.matrix_ );
489 (~lhs) *= rhs.scalar_;
508 template<
typename MT2
510 friend inline typename EnableIf< UseAssign<MT2> >::Type
545 template<
typename MT2
547 friend inline typename EnableIf< UseAssign<MT2> >::Type
613 template<
typename MT
615 inline const SMatScalarMultExpr<MT,typename BaseElementType<MT>::Type,SO>
655 template<
typename T1
658 inline const typename EnableIf< IsNumeric<T2>,
typename MultExprTrait<T1,T2>::Type >::Type
664 return Type( ~mat, scalar );
690 template<
typename T1
693 inline const typename EnableIf< IsNumeric<T1>,
typename MultExprTrait<T1,T2>::Type >::Type
699 return Type( ~mat, scalar );
724 template<
typename VT
727 inline const SMatScalarMultExpr<VT,ST,TF>
728 operator-(
const SMatScalarMultExpr<VT,ST,TF>& sm )
732 return SMatScalarMultExpr<VT,ST,TF>( sm.leftOperand(), -sm.rightOperand() );
759 template<
typename MT
763 inline const typename EnableIf< IsNumeric<ST2>
764 ,
typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
765 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
769 return mat.leftOperand() * ( mat.rightOperand() * scalar );
788 template<
typename ST1
792 inline const typename EnableIf< IsNumeric<ST1>
793 ,
typename MultExprTrait< ST1, SMatScalarMultExpr<MT,ST2,SO> >::Type >::Type
794 operator*( ST1 scalar,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
798 return mat.leftOperand() * ( scalar * mat.rightOperand() );
817 template<
typename MT
821 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
822 ,
typename DivExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
823 operator/(
const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
827 return mat.leftOperand() * ( mat.rightOperand() / scalar );
847 template<
typename MT
851 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
852 operator*(
const SMatScalarMultExpr<MT,ST,SO>& mat,
const DenseVector<VT,false>& vec )
856 return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
876 template<
typename VT
880 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
881 operator*(
const DenseVector<VT,true>& vec,
const SMatScalarMultExpr<MT,ST,SO>& mat )
885 return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
907 template<
typename MT
912 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, DVecScalarMultExpr<VT,ST2,false> >::Type
913 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat,
const DVecScalarMultExpr<VT,ST2,false>& vec )
917 return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
939 template<
typename VT
944 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
945 operator*(
const DVecScalarMultExpr<VT,ST1,true>& vec,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
949 return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
969 template<
typename MT
973 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
974 operator*(
const SMatScalarMultExpr<MT,ST,SO>& mat,
const SparseVector<VT,false>& vec )
978 return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
998 template<
typename VT
1002 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1003 operator*(
const SparseVector<VT,true>& vec,
const SMatScalarMultExpr<MT,ST,SO>& mat )
1007 return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1029 template<
typename MT
1034 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, SVecScalarMultExpr<VT,ST2,false> >::Type
1035 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat,
const SVecScalarMultExpr<VT,ST2,false>& vec )
1039 return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1061 template<
typename VT
1066 inline const typename MultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1067 operator*(
const SVecScalarMultExpr<VT,ST1,true>& vec,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
1071 return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1091 template<
typename MT1
1096 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1097 operator*(
const SMatScalarMultExpr<MT1,ST,SO1>& lhs,
const DenseMatrix<MT2,SO2>& rhs )
1101 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1121 template<
typename MT1
1126 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1127 operator*(
const DenseMatrix<MT1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1131 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1151 template<
typename MT1
1156 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1157 operator*(
const SMatScalarMultExpr<MT1,ST,SO1>& lhs,
const SparseMatrix<MT2,SO2>& rhs )
1161 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1181 template<
typename MT1
1186 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1187 operator*(
const SparseMatrix<MT1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1191 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1211 template<
typename MT1
1217 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST1,SO1>, SMatScalarMultExpr<MT2,ST2,SO2> >::Type
1218 operator*(
const SMatScalarMultExpr<MT1,ST1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST2,SO2>& rhs )
1222 return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1238 template<
typename MT,
typename ST1,
typename ST2 >
1239 struct SMatScalarMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, ST2 >
1243 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1244 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1245 ,
typename SMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1246 , INVALID_TYPE >::Type Type;
1263 template<
typename MT,
typename ST1,
typename ST2 >
1264 struct TSMatScalarMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, ST2 >
1268 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1269 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1270 ,
typename TSMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1271 , INVALID_TYPE >::Type Type;
1288 template<
typename MT,
typename ST1,
typename ST2 >
1289 struct SMatScalarDivExprTrait< SMatScalarMultExpr<MT,ST1,false>, ST2 >
1293 enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1297 typedef typename SMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1298 typedef typename SMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1303 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1304 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1305 ,
typename SelectType<condition,T1,T2>::Type
1306 , INVALID_TYPE >::Type Type;
1323 template<
typename MT,
typename ST1,
typename ST2 >
1324 struct TSMatScalarDivExprTrait< SMatScalarMultExpr<MT,ST1,true>, ST2 >
1328 enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1332 typedef typename TSMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1333 typedef typename TSMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1338 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1339 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1340 ,
typename SelectType<condition,T1,T2>::Type
1341 , INVALID_TYPE >::Type Type;
1358 template<
typename MT,
typename ST,
typename VT >
1359 struct SMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST,false>, VT >
1363 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1364 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1365 IsNumeric<ST>::value
1366 ,
typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1367 , INVALID_TYPE >::Type Type;
1376 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1377 struct SMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, DVecScalarMultExpr<VT,ST2,false> >
1381 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1382 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1383 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1384 ,
typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1385 , INVALID_TYPE >::Type Type;
1402 template<
typename MT,
typename ST,
typename VT >
1403 struct TSMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST,true>, VT >
1407 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1408 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1409 IsNumeric<ST>::value
1410 ,
typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1411 , INVALID_TYPE >::Type Type;
1420 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1421 struct TSMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, DVecScalarMultExpr<VT,ST2,false> >
1425 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1426 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1427 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1428 ,
typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1429 , INVALID_TYPE >::Type Type;
1446 template<
typename VT,
typename MT,
typename ST >
1447 struct TDVecSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,false> >
1451 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1452 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1453 IsNumeric<ST>::value
1454 ,
typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1455 , INVALID_TYPE >::Type Type;
1464 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1465 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,false> >
1469 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1470 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1471 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1472 ,
typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1473 , INVALID_TYPE >::Type Type;
1490 template<
typename VT,
typename MT,
typename ST >
1491 struct TDVecTSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,true> >
1495 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1496 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1497 IsNumeric<ST>::value
1498 ,
typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1499 , INVALID_TYPE >::Type Type;
1508 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1509 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,true> >
1513 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1514 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1515 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1516 ,
typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1517 , INVALID_TYPE >::Type Type;
1534 template<
typename MT,
typename ST,
typename VT >
1535 struct SMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST,false>, VT >
1539 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1540 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1541 IsNumeric<ST>::value
1542 ,
typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1543 , INVALID_TYPE >::Type Type;
1552 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1553 struct SMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, SVecScalarMultExpr<VT,ST2,false> >
1557 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1558 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1559 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1560 ,
typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1561 , INVALID_TYPE >::Type Type;
1578 template<
typename MT,
typename ST,
typename VT >
1579 struct TSMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST,true>, VT >
1583 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1584 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1585 IsNumeric<ST>::value
1586 ,
typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1587 , INVALID_TYPE >::Type Type;
1596 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1597 struct TSMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, SVecScalarMultExpr<VT,ST2,false> >
1601 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1602 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1603 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1604 ,
typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1605 , INVALID_TYPE >::Type Type;
1622 template<
typename VT,
typename MT,
typename ST >
1623 struct TSVecSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,false> >
1627 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1628 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1629 IsNumeric<ST>::value
1630 ,
typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1631 , INVALID_TYPE >::Type Type;
1640 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1641 struct TSVecSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,false> >
1645 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1646 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1647 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1648 ,
typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1649 , INVALID_TYPE >::Type Type;
1666 template<
typename VT,
typename MT,
typename ST >
1667 struct TSVecTSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,true> >
1671 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1672 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1673 IsNumeric<ST>::value
1674 ,
typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1675 , INVALID_TYPE >::Type Type;
1684 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1685 struct TSVecTSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,true> >
1689 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1690 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1691 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1692 ,
typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1693 , INVALID_TYPE >::Type Type;
1710 template<
typename MT1,
typename MT2,
typename ST >
1711 struct DMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
1715 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1716 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1717 IsNumeric<ST>::value
1718 ,
typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1719 , INVALID_TYPE >::Type Type;
1736 template<
typename MT1,
typename MT2,
typename ST >
1737 struct DMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
1741 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1742 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1743 IsNumeric<ST>::value
1744 ,
typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1745 , INVALID_TYPE >::Type Type;
1762 template<
typename MT1,
typename MT2,
typename ST >
1763 struct TDMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
1767 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1768 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1769 IsNumeric<ST>::value
1770 ,
typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1771 , INVALID_TYPE >::Type Type;
1788 template<
typename MT1,
typename MT2,
typename ST >
1789 struct TDMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
1793 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1794 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1795 IsNumeric<ST>::value
1796 ,
typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1797 , INVALID_TYPE >::Type Type;
1814 template<
typename MT1,
typename ST,
typename MT2 >
1815 struct SMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1819 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1820 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1821 IsNumeric<ST>::value
1822 ,
typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1823 , INVALID_TYPE >::Type Type;
1840 template<
typename MT1,
typename ST,
typename MT2 >
1841 struct SMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1845 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1846 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1847 IsNumeric<ST>::value
1848 ,
typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1849 , INVALID_TYPE >::Type Type;
1866 template<
typename MT1,
typename ST,
typename MT2 >
1867 struct TSMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
1871 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1872 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1873 IsNumeric<ST>::value
1874 ,
typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1875 , INVALID_TYPE >::Type Type;
1892 template<
typename MT1,
typename ST,
typename MT2 >
1893 struct TSMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
1897 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1898 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1899 IsNumeric<ST>::value
1900 ,
typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1901 , INVALID_TYPE >::Type Type;
1918 template<
typename MT1,
typename ST,
typename MT2 >
1919 struct SMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1923 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1924 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1925 IsNumeric<ST>::value
1926 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1927 , INVALID_TYPE >::Type Type;
1936 template<
typename MT1,
typename MT2,
typename ST >
1937 struct SMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
1941 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1942 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1943 IsNumeric<ST>::value
1944 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1945 , INVALID_TYPE >::Type Type;
1954 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
1955 struct SMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,false> >
1959 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1960 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1961 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1962 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1963 , INVALID_TYPE >::Type Type;
1980 template<
typename MT1,
typename ST,
typename MT2 >
1981 struct SMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1985 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1986 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1987 IsNumeric<ST>::value
1988 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1989 , INVALID_TYPE >::Type Type;
1998 template<
typename MT1,
typename MT2,
typename ST >
1999 struct SMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2003 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2004 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2005 IsNumeric<ST>::value
2006 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2007 , INVALID_TYPE >::Type Type;
2016 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2017 struct SMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,true> >
2021 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2022 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2023 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2024 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2025 , INVALID_TYPE >::Type Type;
2042 template<
typename MT1,
typename ST,
typename MT2 >
2043 struct TSMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2047 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2048 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2049 IsNumeric<ST>::value
2050 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2051 , INVALID_TYPE >::Type Type;
2060 template<
typename MT1,
typename MT2,
typename ST >
2061 struct TSMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
2065 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2066 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2067 IsNumeric<ST>::value
2068 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2069 , INVALID_TYPE >::Type Type;
2078 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2079 struct TSMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,false> >
2083 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2084 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2085 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2086 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2087 , INVALID_TYPE >::Type Type;
2104 template<
typename MT1,
typename ST,
typename MT2 >
2105 struct TSMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2109 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2110 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2111 IsNumeric<ST>::value
2112 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2113 , INVALID_TYPE >::Type Type;
2122 template<
typename MT1,
typename MT2,
typename ST >
2123 struct TSMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2127 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2128 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2129 IsNumeric<ST>::value
2130 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2131 , INVALID_TYPE >::Type Type;
2140 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2141 struct TSMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,true> >
2145 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2146 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2147 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2148 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2149 , INVALID_TYPE >::Type Type;
2166 template<
typename MT,
typename ST,
bool SO >
2167 struct SubmatrixExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2171 typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT>::Type, ST >::Type Type;
2188 template<
typename MT,
typename ST,
bool SO >
2189 struct RowExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2193 typedef typename MultExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
2210 template<
typename MT,
typename ST,
bool SO >
2211 struct ColumnExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2215 typedef typename MultExprTrait< typename ColumnExprTrait<const MT>::Type, ST >::Type Type;
Pointer difference type of the Blaze library.
Constraint on the data type.
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:3703
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:745
PointerType pointer
Pointer return type.
Definition: SMatScalarMultExpr.h:189
IteratorCategory iterator_category
The iterator category.
Definition: SMatScalarMultExpr.h:187
MT::CompositeType CT
Composite type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:111
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:196
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:178
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatScalarMultExpr.h:282
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2375
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:248
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatScalarMultExpr.h:184
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatScalarMultExpr.h:358
ValueType value_type
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:188
Header file for the Computation base class.
IteratorType matrix_
Iterator over the elements of the left-hand side sparse matrix expression.
Definition: SMatScalarMultExpr.h:289
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:423
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatScalarMultExpr.h:338
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:104
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatScalarMultExpr.h:180
Constraint on the data type.
SelectType< useAssign, const ResultType, const SMatScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatScalarMultExpr.h:158
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:411
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:250
Header file for the ValueIndexPair class.
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:431
Header file for the IsFloatingPoint type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2379
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:179
Element ValueType
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:181
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE(A, B)
Data type constraint.In case the two types A and B are not the same (ignoring all cv-qualifiers of bo...
Definition: SameType.h:89
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SMatScalarMultExpr.h:155
#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:149
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:290
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SMatScalarMultExpr.h:124
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2373
Header file for the SelectType class template.
SMatScalarMultExpr(const MT &matrix, ST scalar)
Constructor for the SMatScalarMultExpr class.
Definition: SMatScalarMultExpr.h:301
Header file for the RowExprTrait class template.
Expression object for sparse matrix-scalar multiplications.The SMatScalarMult class represents the co...
Definition: Forward.h:92
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:327
Header file for the EnableIf class template.
SMatScalarMultExpr< MT, ST, SO > This
Type of this SMatScalarMultExpr instance.
Definition: SMatScalarMultExpr.h:148
Header file for the BaseElementType type trait.
LeftOperand matrix_
Left-hand side sparse matrix of the multiplication expression.
Definition: SMatScalarMultExpr.h:430
Header file for the IsNumeric type trait.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatScalarMultExpr.h:348
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:2374
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
Header file for the MatScalarMultExpr base class.
Header file for run time assertion macros.
Utility type for generic codes.
Base template for the MultTrait class.
Definition: MultTrait.h:141
Header file for the division trait.
void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:209
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatScalarMultExpr.h:368
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:271
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:260
#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:399
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarMultExpr.h:219
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:239
Iterator over the elements of the sparse matrix/scalar multiplication expression. ...
Definition: SMatScalarMultExpr.h:170
Evaluation of the base element type of a given data type.Via this type trait it is possible to evalua...
Definition: BaseElementType.h:75
Header file for the RemoveReference type trait.
ValueType * PointerType
Pointer return type.
Definition: SMatScalarMultExpr.h:182
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatScalarMultExpr.h:208
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:314
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatScalarMultExpr.h:152
ReferenceType reference
Reference return type.
Definition: SMatScalarMultExpr.h:190
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:175
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatScalarMultExpr.h:239
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatScalarMultExpr.h:379
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:69
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type LeftOperand
Composite data type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:161
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:229
Header file for the IsComputation type trait class.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SMatScalarMultExpr.h:164
#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:2370
Header file for basic type definitions.
ConstIterator(IteratorType matrix, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SMatScalarMultExpr.h:197
size_t index() const
Access to the current index of the sparse element.
Definition: SMatScalarMultExpr.h:249
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatScalarMultExpr.h:150
Header file for the IsColumnVector type trait.
DifferenceType difference_type
Difference between two iterators.
Definition: SMatScalarMultExpr.h:191
ValueType & ReferenceType
Reference return type.
Definition: SMatScalarMultExpr.h:183
MT::ReturnType RN
Return type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:110
MT::ResultType RT
Result type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:109
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:151
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
LeftOperand leftOperand() const
Returns the left-hand side sparse matrix operand.
Definition: SMatScalarMultExpr.h:389
#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.