35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATSCALARMULTEXPR_H_
101 template<
typename MT
104 class SMatScalarMultExpr :
public SparseMatrix< SMatScalarMultExpr<MT,ST,SO>, SO >
105 ,
private MatScalarMultExpr
106 ,
private Computation
139 template<
typename MT2 >
142 enum { value = useAssign };
298 enum { smpAssignable = 0 };
416 template<
typename T >
418 return matrix_.canAlias( alias );
428 template<
typename T >
430 return matrix_.isAliased( alias );
454 template<
typename MT2
464 assign( ~lhs, rhs.matrix_ );
465 (~lhs) *= rhs.scalar_;
484 template<
typename MT2
494 assign( ~lhs, rhs.matrix_ );
495 (~lhs) *= rhs.scalar_;
514 template<
typename MT2
516 friend inline typename EnableIf< UseAssign<MT2> >::Type
551 template<
typename MT2
553 friend inline typename EnableIf< UseAssign<MT2> >::Type
619 template<
typename MT
621 inline const SMatScalarMultExpr<MT,typename BaseElementType<MT>::Type,SO>
661 template<
typename T1
664 inline const typename EnableIf< IsNumeric<T2>,
typename MultExprTrait<T1,T2>::Type >::Type
670 return Type( ~mat, scalar );
696 template<
typename T1
699 inline const typename EnableIf< IsNumeric<T1>,
typename MultExprTrait<T1,T2>::Type >::Type
705 return Type( ~mat, scalar );
730 template<
typename VT
733 inline const SMatScalarMultExpr<VT,ST,TF>
734 operator-(
const SMatScalarMultExpr<VT,ST,TF>& sm )
738 return SMatScalarMultExpr<VT,ST,TF>( sm.leftOperand(), -sm.rightOperand() );
765 template<
typename MT
769 inline const typename EnableIf< IsNumeric<ST2>
770 ,
typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
771 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
775 return mat.leftOperand() * ( mat.rightOperand() * scalar );
794 template<
typename ST1
798 inline const typename EnableIf< IsNumeric<ST1>
799 ,
typename MultExprTrait< ST1, SMatScalarMultExpr<MT,ST2,SO> >::Type >::Type
800 operator*( ST1 scalar,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
804 return mat.leftOperand() * ( scalar * mat.rightOperand() );
823 template<
typename MT
827 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
828 ,
typename DivExprTrait< SMatScalarMultExpr<MT,ST1,SO>, ST2 >::Type >::Type
829 operator/(
const SMatScalarMultExpr<MT,ST1,SO>& mat, ST2 scalar )
833 return mat.leftOperand() * ( mat.rightOperand() / scalar );
853 template<
typename MT
857 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
858 operator*(
const SMatScalarMultExpr<MT,ST,SO>& mat,
const DenseVector<VT,false>& vec )
862 return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
882 template<
typename VT
886 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
887 operator*(
const DenseVector<VT,true>& vec,
const SMatScalarMultExpr<MT,ST,SO>& mat )
891 return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
913 template<
typename MT
918 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, DVecScalarMultExpr<VT,ST2,false> >::Type
919 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat,
const DVecScalarMultExpr<VT,ST2,false>& vec )
923 return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
945 template<
typename VT
950 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
951 operator*(
const DVecScalarMultExpr<VT,ST1,true>& vec,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
955 return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
975 template<
typename MT
979 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST,SO>, VT >::Type
980 operator*(
const SMatScalarMultExpr<MT,ST,SO>& mat,
const SparseVector<VT,false>& vec )
984 return ( mat.leftOperand() * (~vec) ) * mat.rightOperand();
1004 template<
typename VT
1008 inline const typename MultExprTrait< VT, SMatScalarMultExpr<MT,ST,SO> >::Type
1009 operator*(
const SparseVector<VT,true>& vec,
const SMatScalarMultExpr<MT,ST,SO>& mat )
1013 return ( (~vec) * mat.leftOperand() ) * mat.rightOperand();
1035 template<
typename MT
1040 inline const typename MultExprTrait< SMatScalarMultExpr<MT,ST1,SO>, SVecScalarMultExpr<VT,ST2,false> >::Type
1041 operator*(
const SMatScalarMultExpr<MT,ST1,SO>& mat,
const SVecScalarMultExpr<VT,ST2,false>& vec )
1045 return ( mat.leftOperand() * vec.leftOperand() ) * ( mat.rightOperand() * vec.rightOperand() );
1067 template<
typename VT
1072 inline const typename MultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,SO> >::Type
1073 operator*(
const SVecScalarMultExpr<VT,ST1,true>& vec,
const SMatScalarMultExpr<MT,ST2,SO>& mat )
1077 return ( vec.leftOperand() * mat.leftOperand() ) * ( vec.rightOperand() * mat.rightOperand() );
1097 template<
typename MT1
1102 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1103 operator*(
const SMatScalarMultExpr<MT1,ST,SO1>& lhs,
const DenseMatrix<MT2,SO2>& rhs )
1107 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1127 template<
typename MT1
1132 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1133 operator*(
const DenseMatrix<MT1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1137 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1157 template<
typename MT1
1162 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST,SO1>, MT2 >::Type
1163 operator*(
const SMatScalarMultExpr<MT1,ST,SO1>& lhs,
const SparseMatrix<MT2,SO2>& rhs )
1167 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1187 template<
typename MT1
1192 inline const typename MultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,SO2> >::Type
1193 operator*(
const SparseMatrix<MT1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST,SO2>& rhs )
1197 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1217 template<
typename MT1
1223 inline const typename MultExprTrait< SMatScalarMultExpr<MT1,ST1,SO1>, SMatScalarMultExpr<MT2,ST2,SO2> >::Type
1224 operator*(
const SMatScalarMultExpr<MT1,ST1,SO1>& lhs,
const SMatScalarMultExpr<MT2,ST2,SO2>& rhs )
1228 return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1244 template<
typename MT,
typename ST1,
typename ST2 >
1245 struct SMatScalarMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, ST2 >
1249 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1250 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1251 ,
typename SMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1252 , INVALID_TYPE >::Type Type;
1269 template<
typename MT,
typename ST1,
typename ST2 >
1270 struct TSMatScalarMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, ST2 >
1274 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1275 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1276 ,
typename TSMatScalarMultExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type
1277 , INVALID_TYPE >::Type Type;
1294 template<
typename MT,
typename ST1,
typename ST2 >
1295 struct SMatScalarDivExprTrait< SMatScalarMultExpr<MT,ST1,false>, ST2 >
1299 enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1303 typedef typename SMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1304 typedef typename SMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1309 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1310 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1311 ,
typename SelectType<condition,T1,T2>::Type
1312 , INVALID_TYPE >::Type Type;
1329 template<
typename MT,
typename ST1,
typename ST2 >
1330 struct TSMatScalarDivExprTrait< SMatScalarMultExpr<MT,ST1,true>, ST2 >
1334 enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1338 typedef typename TSMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1339 typedef typename TSMatScalarDivExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1344 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1345 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1346 ,
typename SelectType<condition,T1,T2>::Type
1347 , INVALID_TYPE >::Type Type;
1364 template<
typename MT,
typename ST,
typename VT >
1365 struct SMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST,false>, VT >
1369 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1370 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1371 IsNumeric<ST>::value
1372 ,
typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1373 , INVALID_TYPE >::Type Type;
1382 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1383 struct SMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, DVecScalarMultExpr<VT,ST2,false> >
1387 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1388 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1389 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1390 ,
typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1391 , INVALID_TYPE >::Type Type;
1408 template<
typename MT,
typename ST,
typename VT >
1409 struct TSMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST,true>, VT >
1413 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1414 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1415 IsNumeric<ST>::value
1416 ,
typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
1417 , INVALID_TYPE >::Type Type;
1426 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1427 struct TSMatDVecMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, DVecScalarMultExpr<VT,ST2,false> >
1431 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1432 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1433 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1434 ,
typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1435 , INVALID_TYPE >::Type Type;
1452 template<
typename VT,
typename MT,
typename ST >
1453 struct TDVecSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,false> >
1457 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1458 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1459 IsNumeric<ST>::value
1460 ,
typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1461 , INVALID_TYPE >::Type Type;
1470 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1471 struct TDVecSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,false> >
1475 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1476 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1477 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1478 ,
typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1479 , INVALID_TYPE >::Type Type;
1496 template<
typename VT,
typename MT,
typename ST >
1497 struct TDVecTSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,true> >
1501 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1502 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1503 IsNumeric<ST>::value
1504 ,
typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1505 , INVALID_TYPE >::Type Type;
1514 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1515 struct TDVecTSMatMultExprTrait< DVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,true> >
1519 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1520 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1521 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1522 ,
typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1523 , INVALID_TYPE >::Type Type;
1540 template<
typename MT,
typename ST,
typename VT >
1541 struct SMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST,false>, VT >
1545 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1546 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1547 IsNumeric<ST>::value
1548 ,
typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1549 , INVALID_TYPE >::Type Type;
1558 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1559 struct SMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST1,false>, SVecScalarMultExpr<VT,ST2,false> >
1563 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1564 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1565 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1566 ,
typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1567 , INVALID_TYPE >::Type Type;
1584 template<
typename MT,
typename ST,
typename VT >
1585 struct TSMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST,true>, VT >
1589 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1590 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1591 IsNumeric<ST>::value
1592 ,
typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1593 , INVALID_TYPE >::Type Type;
1602 template<
typename MT,
typename ST1,
typename VT,
typename ST2 >
1603 struct TSMatSVecMultExprTrait< SMatScalarMultExpr<MT,ST1,true>, SVecScalarMultExpr<VT,ST2,false> >
1607 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1608 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1609 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1610 ,
typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1611 , INVALID_TYPE >::Type Type;
1628 template<
typename VT,
typename MT,
typename ST >
1629 struct TSVecSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,false> >
1633 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1634 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1635 IsNumeric<ST>::value
1636 ,
typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
1637 , INVALID_TYPE >::Type Type;
1646 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1647 struct TSVecSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,false> >
1651 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1652 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1653 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1654 ,
typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1655 , INVALID_TYPE >::Type Type;
1672 template<
typename VT,
typename MT,
typename ST >
1673 struct TSVecTSMatMultExprTrait< VT, SMatScalarMultExpr<MT,ST,true> >
1677 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1678 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1679 IsNumeric<ST>::value
1680 ,
typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
1681 , INVALID_TYPE >::Type Type;
1690 template<
typename VT,
typename ST1,
typename MT,
typename ST2 >
1691 struct TSVecTSMatMultExprTrait< SVecScalarMultExpr<VT,ST1,true>, SMatScalarMultExpr<MT,ST2,true> >
1695 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1696 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1697 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1698 ,
typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1699 , INVALID_TYPE >::Type Type;
1716 template<
typename MT1,
typename MT2,
typename ST >
1717 struct DMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
1721 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1722 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1723 IsNumeric<ST>::value
1724 ,
typename DMatScalarMultExprTrait<typename DMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1725 , INVALID_TYPE >::Type Type;
1742 template<
typename MT1,
typename MT2,
typename ST >
1743 struct DMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
1747 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1748 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1749 IsNumeric<ST>::value
1750 ,
typename DMatScalarMultExprTrait<typename DMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1751 , INVALID_TYPE >::Type Type;
1768 template<
typename MT1,
typename MT2,
typename ST >
1769 struct TDMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
1773 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1774 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1775 IsNumeric<ST>::value
1776 ,
typename TDMatScalarMultExprTrait<typename TDMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1777 , INVALID_TYPE >::Type Type;
1794 template<
typename MT1,
typename MT2,
typename ST >
1795 struct TDMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
1799 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1800 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1801 IsNumeric<ST>::value
1802 ,
typename TDMatScalarMultExprTrait<typename TDMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1803 , INVALID_TYPE >::Type Type;
1820 template<
typename MT1,
typename ST,
typename MT2 >
1821 struct SMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1825 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1826 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1827 IsNumeric<ST>::value
1828 ,
typename DMatScalarMultExprTrait<typename SMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1829 , INVALID_TYPE >::Type Type;
1846 template<
typename MT1,
typename ST,
typename MT2 >
1847 struct SMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1851 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1852 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1853 IsNumeric<ST>::value
1854 ,
typename DMatScalarMultExprTrait<typename SMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1855 , INVALID_TYPE >::Type Type;
1872 template<
typename MT1,
typename ST,
typename MT2 >
1873 struct TSMatDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
1877 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1878 IsDenseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1879 IsNumeric<ST>::value
1880 ,
typename TDMatScalarMultExprTrait<typename TSMatDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1881 , INVALID_TYPE >::Type Type;
1898 template<
typename MT1,
typename ST,
typename MT2 >
1899 struct TSMatTDMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
1903 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
1904 IsDenseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1905 IsNumeric<ST>::value
1906 ,
typename TDMatScalarMultExprTrait<typename TSMatTDMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1907 , INVALID_TYPE >::Type Type;
1924 template<
typename MT1,
typename ST,
typename MT2 >
1925 struct SMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1929 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1930 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1931 IsNumeric<ST>::value
1932 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1933 , INVALID_TYPE >::Type Type;
1942 template<
typename MT1,
typename MT2,
typename ST >
1943 struct SMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
1947 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1948 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1949 IsNumeric<ST>::value
1950 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1951 , INVALID_TYPE >::Type Type;
1960 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
1961 struct SMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,false> >
1965 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1966 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
1967 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1968 ,
typename SMatScalarMultExprTrait<typename SMatSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1969 , INVALID_TYPE >::Type Type;
1986 template<
typename MT1,
typename ST,
typename MT2 >
1987 struct SMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,false>, MT2 >
1991 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
1992 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
1993 IsNumeric<ST>::value
1994 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
1995 , INVALID_TYPE >::Type Type;
2004 template<
typename MT1,
typename MT2,
typename ST >
2005 struct SMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2009 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2010 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2011 IsNumeric<ST>::value
2012 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2013 , INVALID_TYPE >::Type Type;
2022 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2023 struct SMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,false>, SMatScalarMultExpr<MT2,ST2,true> >
2027 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
2028 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2029 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2030 ,
typename SMatScalarMultExprTrait<typename SMatTSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2031 , INVALID_TYPE >::Type Type;
2048 template<
typename MT1,
typename ST,
typename MT2 >
2049 struct TSMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2053 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2054 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2055 IsNumeric<ST>::value
2056 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2057 , INVALID_TYPE >::Type Type;
2066 template<
typename MT1,
typename MT2,
typename ST >
2067 struct TSMatSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,false> >
2071 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2072 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2073 IsNumeric<ST>::value
2074 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2075 , INVALID_TYPE >::Type Type;
2084 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2085 struct TSMatSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,false> >
2089 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2090 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
2091 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2092 ,
typename TSMatScalarMultExprTrait<typename TSMatSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2093 , INVALID_TYPE >::Type Type;
2110 template<
typename MT1,
typename ST,
typename MT2 >
2111 struct TSMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST,true>, MT2 >
2115 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2116 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2117 IsNumeric<ST>::value
2118 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2119 , INVALID_TYPE >::Type Type;
2128 template<
typename MT1,
typename MT2,
typename ST >
2129 struct TSMatTSMatMultExprTrait< MT1, SMatScalarMultExpr<MT2,ST,true> >
2133 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2134 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2135 IsNumeric<ST>::value
2136 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,ST>::Type
2137 , INVALID_TYPE >::Type Type;
2146 template<
typename MT1,
typename ST1,
typename MT2,
typename ST2 >
2147 struct TSMatTSMatMultExprTrait< SMatScalarMultExpr<MT1,ST1,true>, SMatScalarMultExpr<MT2,ST2,true> >
2151 typedef typename SelectType< IsSparseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
2152 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
2153 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2154 ,
typename TSMatScalarMultExprTrait<typename TSMatTSMatMultExprTrait<MT1,MT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2155 , INVALID_TYPE >::Type Type;
2172 template<
typename MT,
typename ST,
bool SO,
bool AF >
2173 struct SubmatrixExprTrait< SMatScalarMultExpr<MT,ST,SO>, AF >
2177 typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type, ST >::Type Type;
2194 template<
typename MT,
typename ST,
bool SO >
2195 struct RowExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2199 typedef typename MultExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
2216 template<
typename MT,
typename ST,
bool SO >
2217 struct ColumnExprTrait< SMatScalarMultExpr<MT,ST,SO> >
2221 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:4075
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:772
PointerType pointer
Pointer return type.
Definition: SMatScalarMultExpr.h:190
IteratorCategory iterator_category
The iterator category.
Definition: SMatScalarMultExpr.h:188
MT::CompositeType CT
Composite type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:112
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:151
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:197
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:179
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatScalarMultExpr.h:283
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2384
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:249
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatScalarMultExpr.h:185
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatScalarMultExpr.h:364
ValueType value_type
Type of the underlying pointers.
Definition: SMatScalarMultExpr.h:189
Header file for the Computation base class.
IteratorType matrix_
Iterator over the elements of the left-hand side sparse matrix expression.
Definition: SMatScalarMultExpr.h:290
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:429
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatScalarMultExpr.h:344
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:181
Constraint on the data type.
SelectType< useAssign, const ResultType, const SMatScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatScalarMultExpr.h:159
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:417
Constraint on the data type.
Header file for the MultExprTrait class template.
void smpAddAssign(DenseMatrix< 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:121
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:251
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:437
Header file for the IsFloatingPoint type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2388
Header file for the dense matrix SMP implementation.
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:182
#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:156
#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:150
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SMatScalarMultExpr.h:291
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SMatScalarMultExpr.h:125
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2382
Header file for the SelectType class template.
SMatScalarMultExpr(const MT &matrix, ST scalar)
Constructor for the SMatScalarMultExpr class.
Definition: SMatScalarMultExpr.h:307
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:333
Header file for the EnableIf class template.
SMatScalarMultExpr< MT, ST, SO > This
Type of this SMatScalarMultExpr instance.
Definition: SMatScalarMultExpr.h:149
Header file for the BaseElementType type trait.
LeftOperand matrix_
Left-hand side sparse matrix of the multiplication expression.
Definition: SMatScalarMultExpr.h:436
Header file for the IsNumeric type trait.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatScalarMultExpr.h:354
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:2383
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:374
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatScalarMultExpr.h:272
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:261
#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:405
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarMultExpr.h:220
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:171
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:183
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatScalarMultExpr.h:209
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:320
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatScalarMultExpr.h:153
ReferenceType reference
Reference return type.
Definition: SMatScalarMultExpr.h:191
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:176
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatScalarMultExpr.h:240
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatScalarMultExpr.h:385
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:162
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:230
Header file for the IsComputation type trait class.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SMatScalarMultExpr.h:165
#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:2379
Header file for basic type definitions.
ConstIterator(IteratorType matrix, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SMatScalarMultExpr.h:198
size_t index() const
Access to the current index of the sparse element.
Definition: SMatScalarMultExpr.h:250
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatScalarMultExpr.h:151
Header file for the IsColumnVector type trait.
DifferenceType difference_type
Difference between two iterators.
Definition: SMatScalarMultExpr.h:192
ValueType & ReferenceType
Reference return type.
Definition: SMatScalarMultExpr.h:184
MT::ReturnType RN
Return type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:111
MT::ResultType RT
Result type of the sparse matrix expression.
Definition: SMatScalarMultExpr.h:110
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:152
#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:395
#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.