35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SVECSCALARMULTEXPR_H_
102 template<
typename VT
105 class SVecScalarMultExpr :
public SparseVector< SVecScalarMultExpr<VT,ST,TF>, TF >
106 ,
private VecScalarMultExpr
107 ,
private Computation
140 template<
typename VT2 >
143 enum { value = useAssign };
156 template<
typename VT2 >
157 struct UseSMPAssign {
158 enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
185 enum { smpAssignable = 0 };
442 template<
typename T >
444 return vector_.canAlias( alias );
454 template<
typename T >
456 return vector_.isAliased( alias );
480 template<
typename VT2 >
488 assign( ~lhs, rhs.vector_ );
489 (~lhs) *= rhs.scalar_;
508 template<
typename VT2 >
516 assign( ~lhs, rhs.vector_ );
517 (~lhs) *= rhs.scalar_;
536 template<
typename VT2 >
537 friend inline typename EnableIf< UseAssign<VT2> >::Type
572 template<
typename VT2 >
573 friend inline typename EnableIf< UseAssign<VT2> >::Type
608 template<
typename VT2 >
609 friend inline typename EnableIf< UseAssign<VT2> >::Type
652 template<
typename VT2 >
653 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
688 template<
typename VT2 >
689 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
724 template<
typename VT2 >
725 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
783 template<
typename VT
785 inline const SVecScalarMultExpr<VT,typename BaseElementType<VT>::Type,TF>
825 template<
typename T1
828 inline const typename EnableIf< IsNumeric<T2>,
typename MultExprTrait<T1,T2>::Type >::Type
834 return Type( ~vec, scalar );
860 template<
typename T1
863 inline const typename EnableIf< IsNumeric<T1>,
typename MultExprTrait<T1,T2>::Type >::Type
869 return Type( ~vec, scalar );
900 template<
typename VT
902 inline const SVecScalarMultExpr<VT,typename VT::ElementType,TF>
909 const ElementType len (
length( ~vec ) );
937 template<
typename VT
940 inline const SVecScalarMultExpr<VT,ST,TF>
941 operator-(
const SVecScalarMultExpr<VT,ST,TF>& sv )
945 return SVecScalarMultExpr<VT,ST,TF>( sv.leftOperand(), -sv.rightOperand() );
972 template<
typename VT
976 inline const typename EnableIf< IsNumeric<ST2>
977 ,
typename MultExprTrait< SVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
978 operator*(
const SVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
982 return vec.leftOperand() * ( vec.rightOperand() * scalar );
1001 template<
typename ST1
1005 inline const typename EnableIf< IsNumeric<ST1>
1006 ,
typename MultExprTrait< ST1, SVecScalarMultExpr<VT,ST2,TF> >::Type >::Type
1007 operator*( ST1 scalar,
const SVecScalarMultExpr<VT,ST2,TF>& vec )
1011 return vec.leftOperand() * ( scalar * vec.rightOperand() );
1030 template<
typename VT
1034 inline const typename EnableIf< IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>
1035 ,
typename DivExprTrait< SVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
1036 operator/(
const SVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1040 return vec.leftOperand() * ( vec.rightOperand() / scalar );
1060 template<
typename VT1
1064 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
1065 operator*(
const SVecScalarMultExpr<VT1,ST,TF>& lhs,
const DenseVector<VT2,TF>& rhs )
1069 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1089 template<
typename VT1
1093 inline const typename MultExprTrait< VT1, SVecScalarMultExpr<VT2,ST,TF> >::Type
1094 operator*(
const DenseVector<VT1,TF>& lhs,
const SVecScalarMultExpr<VT2,ST,TF>& rhs )
1098 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1118 template<
typename VT1
1121 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
1122 operator*(
const SVecScalarMultExpr<VT1,ST,false>& lhs,
const DenseVector<VT2,true>& rhs )
1126 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1146 template<
typename VT1
1149 inline const typename MultExprTrait< VT1, SVecScalarMultExpr<VT2,ST,true> >::Type
1150 operator*(
const DenseVector<VT1,false>& lhs,
const SVecScalarMultExpr<VT2,ST,true>& rhs )
1154 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1174 template<
typename VT1
1178 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
1179 operator*(
const SVecScalarMultExpr<VT1,ST,TF>& lhs,
const SparseVector<VT2,TF>& rhs )
1183 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1203 template<
typename VT1
1207 inline const typename MultExprTrait< VT1, SVecScalarMultExpr<VT2,ST,TF> >::Type
1208 operator*(
const SparseVector<VT1,TF>& lhs,
const SVecScalarMultExpr<VT2,ST,TF>& rhs )
1212 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1232 template<
typename VT1
1237 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,TF>, SVecScalarMultExpr<VT2,ST2,TF> >::Type
1238 operator*(
const SVecScalarMultExpr<VT1,ST1,TF>& lhs,
const SVecScalarMultExpr<VT2,ST2,TF>& rhs )
1242 return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1262 template<
typename VT1
1265 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
1266 operator*(
const SVecScalarMultExpr<VT1,ST,false>& lhs,
const SparseVector<VT2,true>& rhs )
1270 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1290 template<
typename VT1
1293 inline const typename MultExprTrait< VT1, SVecScalarMultExpr<VT2,ST,true> >::Type
1294 operator*(
const SparseVector<VT1,false>& lhs,
const SVecScalarMultExpr<VT2,ST,true>& rhs )
1298 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1318 template<
typename VT1
1322 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >::Type
1323 operator*(
const SVecScalarMultExpr<VT1,ST1,false>& lhs,
const SVecScalarMultExpr<VT2,ST2,true>& rhs )
1327 return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1347 template<
typename MT
1351 inline const typename MultExprTrait< MT, SVecScalarMultExpr<VT,ST,false> >::Type
1352 operator*(
const DenseMatrix<MT,SO>& mat,
const SVecScalarMultExpr<VT,ST,false>& vec )
1356 return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1376 template<
typename VT
1380 inline const typename MultExprTrait< SVecScalarMultExpr<VT,ST,true>, MT >::Type
1381 operator*(
const SVecScalarMultExpr<VT,ST,true>& vec,
const DenseMatrix<MT,SO>& mat )
1385 return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1405 template<
typename MT
1409 inline const typename MultExprTrait< MT, SVecScalarMultExpr<VT,ST,false> >::Type
1410 operator*(
const SparseMatrix<MT,SO>& mat,
const SVecScalarMultExpr<VT,ST,false>& vec )
1414 return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1434 template<
typename VT
1438 inline const typename MultExprTrait< SVecScalarMultExpr<VT,ST,true>, MT >::Type
1439 operator*(
const SVecScalarMultExpr<VT,ST,true>& vec,
const SparseMatrix<MT,SO>& mat )
1443 return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1459 template<
typename VT,
typename ST,
bool TF >
1477 template<
typename VT,
typename ST1,
typename ST2 >
1482 typedef typename SelectType< IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1483 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1484 ,
typename SVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1485 , INVALID_TYPE >::Type Type;
1502 template<
typename VT,
typename ST1,
typename ST2 >
1507 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1508 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1509 ,
typename TSVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1510 , INVALID_TYPE >::Type Type;
1527 template<
typename VT,
typename ST1,
typename ST2 >
1532 enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1536 typedef typename SVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1537 typedef typename SVecScalarDivExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1542 typedef typename SelectType< IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1543 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1544 ,
typename SelectType<condition,T1,T2>::Type
1545 , INVALID_TYPE >::Type Type;
1562 template<
typename VT,
typename ST1,
typename ST2 >
1567 enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
1571 typedef typename TSVecScalarMultExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T1;
1572 typedef typename TSVecScalarDivExprTrait<VT,typename DivTrait<ST1,ST2>::Type>::Type T2;
1577 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1578 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1579 ,
typename SelectType<condition,T1,T2>::Type
1580 , INVALID_TYPE >::Type Type;
1597 template<
typename VT1,
typename VT2,
typename ST >
1602 typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1603 IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
1604 IsNumeric<ST>::value
1605 ,
typename SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1606 , INVALID_TYPE >::Type Type;
1623 template<
typename VT1,
typename VT2,
typename ST >
1628 typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1629 IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
1630 IsNumeric<ST>::value
1631 ,
typename SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1632 , INVALID_TYPE >::Type Type;
1649 template<
typename VT1,
typename VT2,
typename ST >
1654 typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
1655 IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
1656 IsNumeric<ST>::value
1657 ,
typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1658 , INVALID_TYPE >::Type Type;
1675 template<
typename VT1,
typename ST,
typename VT2 >
1680 typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
1681 IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1682 IsNumeric<ST>::value
1683 ,
typename SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1684 , INVALID_TYPE >::Type Type;
1701 template<
typename VT1,
typename ST,
typename VT2 >
1706 typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
1707 IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1708 IsNumeric<ST>::value
1709 ,
typename TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1710 , INVALID_TYPE >::Type Type;
1727 template<
typename VT1,
typename ST,
typename VT2 >
1732 typedef typename SelectType< IsSparseVector<VT1>::value && IsRowVector<VT1>::value &&
1733 IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
1734 IsNumeric<ST>::value
1735 ,
typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1736 , INVALID_TYPE >::Type Type;
1753 template<
typename VT1,
typename ST,
typename VT2 >
1758 typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
1759 IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
1760 IsNumeric<ST>::value
1761 ,
typename SVecScalarMultExprTrait<typename SVecSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1762 , INVALID_TYPE >::Type Type;
1771 template<
typename VT1,
typename VT2,
typename ST >
1776 typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
1777 IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
1778 IsNumeric<ST>::value
1779 ,
typename SVecScalarMultExprTrait<typename SVecSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1780 , INVALID_TYPE >::Type Type;
1789 template<
typename VT1,
typename ST1,
typename VT2,
typename ST2 >
1794 typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
1795 IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
1796 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1797 ,
typename SVecScalarMultExprTrait<typename SVecSVecMultExprTrait<VT1,VT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1798 , INVALID_TYPE >::Type Type;
1815 template<
typename VT1,
typename ST,
typename VT2 >
1820 typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
1821 IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
1822 IsNumeric<ST>::value
1823 ,
typename SMatScalarMultExprTrait<typename SVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1824 , INVALID_TYPE >::Type Type;
1833 template<
typename VT1,
typename VT2,
typename ST >
1838 typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
1839 IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
1840 IsNumeric<ST>::value
1841 ,
typename SMatScalarMultExprTrait<typename SVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1842 , INVALID_TYPE >::Type Type;
1851 template<
typename VT1,
typename ST1,
typename VT2,
typename ST2 >
1856 typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
1857 IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
1858 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1859 ,
typename SMatScalarMultExprTrait<typename SVecTSVecMultExprTrait<VT1,VT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1860 , INVALID_TYPE >::Type Type;
1877 template<
typename VT1,
typename ST,
typename VT2 >
1882 typedef typename SelectType< IsSparseVector<VT1>::value && IsRowVector<VT1>::value &&
1883 IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
1884 IsNumeric<ST>::value
1885 ,
typename TSVecScalarMultExprTrait<typename TSVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1886 , INVALID_TYPE >::Type Type;
1895 template<
typename VT1,
typename VT2,
typename ST >
1900 typedef typename SelectType< IsSparseVector<VT1>::value && IsRowVector<VT1>::value &&
1901 IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
1902 IsNumeric<ST>::value
1903 ,
typename TSVecScalarMultExprTrait<typename TSVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1904 , INVALID_TYPE >::Type Type;
1913 template<
typename VT1,
typename ST1,
typename VT2,
typename ST2 >
1918 typedef typename SelectType< IsSparseVector<VT1>::value && IsRowVector<VT1>::value &&
1919 IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
1920 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1921 ,
typename TSVecScalarMultExprTrait<typename TSVecTSVecMultExprTrait<VT1,VT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1922 , INVALID_TYPE >::Type Type;
1939 template<
typename MT,
typename VT,
typename ST >
1944 typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1945 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1946 IsNumeric<ST>::value
1947 ,
typename DVecScalarMultExprTrait<typename DMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1948 , INVALID_TYPE >::Type Type;
1965 template<
typename MT,
typename VT,
typename ST >
1970 typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
1971 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
1972 IsNumeric<ST>::value
1973 ,
typename DVecScalarMultExprTrait<typename TDMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
1974 , INVALID_TYPE >::Type Type;
1991 template<
typename VT,
typename ST,
typename MT >
1996 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
1997 IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
1998 IsNumeric<ST>::value
1999 ,
typename TDVecScalarMultExprTrait<typename TSVecDMatMultExprTrait<VT,MT>::Type,ST>::Type
2000 , INVALID_TYPE >::Type Type;
2017 template<
typename VT,
typename ST,
typename MT >
2022 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
2023 IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2024 IsNumeric<ST>::value
2025 ,
typename TDVecScalarMultExprTrait<typename TSVecTDMatMultExprTrait<VT,MT>::Type,ST>::Type
2026 , INVALID_TYPE >::Type Type;
2043 template<
typename MT,
typename VT,
typename ST >
2048 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2049 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
2050 IsNumeric<ST>::value
2051 ,
typename SVecScalarMultExprTrait<typename SMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
2052 , INVALID_TYPE >::Type Type;
2069 template<
typename MT,
typename VT,
typename ST >
2074 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2075 IsSparseVector<VT>::value && IsColumnVector<VT>::value &&
2076 IsNumeric<ST>::value
2077 ,
typename SVecScalarMultExprTrait<typename TSMatSVecMultExprTrait<MT,VT>::Type,ST>::Type
2078 , INVALID_TYPE >::Type Type;
2095 template<
typename VT,
typename ST,
typename MT >
2100 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
2101 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2102 IsNumeric<ST>::value
2103 ,
typename TSVecScalarMultExprTrait<typename TSVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
2104 , INVALID_TYPE >::Type Type;
2121 template<
typename VT,
typename ST,
typename MT >
2126 typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value &&
2127 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2128 IsNumeric<ST>::value
2129 ,
typename TSVecScalarMultExprTrait<typename TSVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
2130 , INVALID_TYPE >::Type Type;
2147 template<
typename VT,
typename ST,
bool TF,
bool AF >
2152 typedef typename MultExprTrait< typename SubvectorExprTrait<const VT,AF>::Type, ST >::Type Type;
ValueType & ReferenceType
Reference return type.
Definition: SVecScalarMultExpr.h:204
Pointer difference type of the Blaze library.
Constraint on the data type.
BLAZE_ALWAYS_INLINE void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:879
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SVecScalarMultExpr.h:443
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:4838
const EnableIf< IsNumeric< T2 >, typename DivExprTrait< T1, T2 >::Type >::Type operator/(const DenseMatrix< T1, SO > &mat, T2 scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:936
Header file for the SparseVector base class.
ConstIterator end() const
Returns an iterator just past the last non-zero element of the sparse vector.
Definition: SVecScalarMultExpr.h:355
size_t size() const
Returns the current size/dimension of the vector.
Definition: SVecScalarMultExpr.h:365
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SVecScalarMultExpr.h:205
PointerType pointer
Pointer return type.
Definition: SVecScalarMultExpr.h:210
Header file for the IsSparseMatrix type trait.
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SVecScalarMultExpr.h:455
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: SVecScalarMultExpr.h:177
ConstIterator lowerBound(size_t index) const
Returns an iterator to the first index not less then the given index.
Definition: SVecScalarMultExpr.h:398
Header file for the IsColumnMajorMatrix type trait.
ConstIterator begin() const
Returns an iterator to the first non-zero element of the sparse vector.
Definition: SVecScalarMultExpr.h:345
ConstIterator find(size_t index) const
Searches for a specific vector element.
Definition: SVecScalarMultExpr.h:386
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SVecScalarMultExpr.h:303
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2478
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:257
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SVecScalarMultExpr.h:126
Iterator over the elements of the sparse vector/scalar multiplication expression. ...
Definition: SVecScalarMultExpr.h:191
ValueType * PointerType
Pointer return type.
Definition: SVecScalarMultExpr.h:203
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:695
Header file for the Computation base class.
Header file for the RequiresEvaluation type trait.
ReturnType value() const
Access to the current value of the sparse element.
Definition: SVecScalarMultExpr.h:260
Header file for the VecScalarMultExpr base class.
ConstIterator(IteratorType vector, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SVecScalarMultExpr.h:218
Constraint on the data type.
Header file for the DivExprTrait class template.
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:259
Header file for the ValueIndexPair class.
ResultType::ElementType ElementType
Resulting element type.
Definition: SVecScalarMultExpr.h:168
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: SVecScalarMultExpr.h:311
const ConstIterator * operator->() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecScalarMultExpr.h:250
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SVecScalarMultExpr.h:281
Header file for the IsFloatingPoint type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
BLAZE_ALWAYS_INLINE void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:635
IteratorCategory iterator_category
The iterator category.
Definition: SVecScalarMultExpr.h:208
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
LeftOperand vector_
Left-hand side sparse vector of the multiplication expression.
Definition: SVecScalarMultExpr.h:462
#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
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional vector type...
Definition: SparseVector.h:79
size_t index() const
Access to the current index of the sparse element.
Definition: SVecScalarMultExpr.h:270
Constraint on the data type.
#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
DifferenceType difference_type
Difference between two iterators.
Definition: SVecScalarMultExpr.h:212
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SVecScalarMultExpr.h:167
RemoveReference< LeftOperand >::Type::ConstIterator IteratorType
Iterator type of the sparse vector expression.
Definition: SVecScalarMultExpr.h:199
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
IteratorType vector_
Iterator over the elements of the left-hand side sparse vector expression.
Definition: SVecScalarMultExpr.h:310
Constraint on the data type.
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
CMathTrait< typename VT::ElementType >::Type length(const DenseVector< VT, TF > &dv)
Calculation of the dense vector length .
Definition: DenseVector.h:463
Constraint on the data type.
Header file for the IsDenseMatrix type trait.
Header file for the EnableIf class template.
ConstIterator & operator++()
Pre-increment operator.
Definition: SVecScalarMultExpr.h:229
Header file for the serial shim.
Header file for the BaseElementType type trait.
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SVecScalarMultExpr.h:463
Header file for the IsNumeric type trait.
ValueIndexPair< ElementType > Element
Element type of the sparse vector expression.
Definition: SVecScalarMultExpr.h:196
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the IsSparseVector type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2477
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
Element ValueType
Type of the underlying pointers.
Definition: SVecScalarMultExpr.h:202
ConstIterator upperBound(size_t index) const
Returns an iterator to the first index greater then the given index.
Definition: SVecScalarMultExpr.h:410
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SVecScalarMultExpr.h:292
Header file for run time assertion macros.
Utility type for generic codes.
Base template for the MultTrait class.
Definition: MultTrait.h:142
ValueType value_type
Type of the underlying pointers.
Definition: SVecScalarMultExpr.h:209
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SVecScalarMultExpr.h:201
BLAZE_ALWAYS_INLINE void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:742
VT::CompositeType CT
Composite type of the sparse vector expression.
Definition: SVecScalarMultExpr.h:113
Header file for the division trait.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecScalarMultExpr.h:375
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
Constraint on the data type.
#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
ReferenceType reference
Reference return type.
Definition: SVecScalarMultExpr.h:211
const Element operator*() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecScalarMultExpr.h:240
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:118
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: SVecScalarMultExpr.h:431
Evaluation of the base element type of a given data type.Via this type trait it is possible to evalua...
Definition: BaseElementType.h:80
Header file for the RemoveReference type trait.
Header file for the IsDenseVector type trait.
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:70
Header file for the IsRowMajorMatrix type trait.
Header file for the IsComputation type trait class.
SelectType< useAssign, const ResultType, const SVecScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SVecScalarMultExpr.h:174
Expression object for sparse vector-scalar multiplications.The SVecScalarMultExpr class represents th...
Definition: Forward.h:115
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
SVecScalarMultExpr(const VT &vector, ST scalar)
Constructor for the SVecScalarMultExpr class.
Definition: SVecScalarMultExpr.h:322
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
#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
VT::ResultType RT
Result type of the sparse vector expression.
Definition: SVecScalarMultExpr.h:111
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
SVecScalarMultExpr< VT, ST, TF > This
Type of this SVecScalarMultExpr instance.
Definition: SVecScalarMultExpr.h:165
Header file for basic type definitions.
Header file for the SubvectorExprTrait class template.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SVecScalarMultExpr.h:171
const DVecScalarMultExpr< VT, typename VT::ElementType, TF > normalize(const DenseVector< VT, TF > &vec)
Normalization of the dense vector ( ).
Definition: DVecScalarMultExpr.h:1068
LeftOperand leftOperand() const
Returns the left-hand side sparse vector operand.
Definition: SVecScalarMultExpr.h:421
Header file for the IsColumnVector type trait.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SVecScalarMultExpr.h:180
EnableIf< IsDenseVector< VT1 > >::Type smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:189
Header file for the Size type trait.
Evaluation of the resulting expression type of a multiplication.Via this type trait it is possible to...
Definition: MultExprTrait.h:137
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:238
#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
VT::ReturnType RN
Return type of the sparse vector expression.
Definition: SVecScalarMultExpr.h:112
MultTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: SVecScalarMultExpr.h:166
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecScalarMultExpr.h:334
#define BLAZE_CONSTRAINT_MUST_BE_FLOATING_POINT_TYPE(T)
Constraint on the data type.In case the given data type T is not a floating point data type...
Definition: FloatingPoint.h:79
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
BLAZE_ALWAYS_INLINE void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:849