35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SVECSCALARMULTEXPR_H_
106 template<
typename VT
109 class SVecScalarMultExpr :
public SparseVector< SVecScalarMultExpr<VT,ST,TF>, TF >
110 ,
private VecScalarMultExpr
111 ,
private Computation
144 template<
typename VT2 >
147 enum :
bool { value = useAssign };
160 template<
typename VT2 >
161 struct UseSMPAssign {
162 enum :
bool { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
189 enum :
bool { smpAssignable =
false };
351 inline ReturnType
at(
size_t index )
const {
352 if( index >=
vector_.size() ) {
355 return (*
this)[index];
384 inline size_t size() const noexcept {
461 template<
typename T >
462 inline bool canAlias(
const T* alias )
const noexcept {
463 return vector_.canAlias( alias );
473 template<
typename T >
474 inline bool isAliased(
const T* alias )
const noexcept {
475 return vector_.isAliased( alias );
499 template<
typename VT2 >
507 assign( ~lhs, rhs.vector_ );
508 (~lhs) *= rhs.scalar_;
527 template<
typename VT2 >
535 assign( ~lhs, rhs.vector_ );
536 (~lhs) *= rhs.scalar_;
555 template<
typename VT2 >
556 friend inline EnableIf_< UseAssign<VT2> >
567 const ResultType tmp(
serial( rhs ) );
568 addAssign( ~lhs, tmp );
591 template<
typename VT2 >
592 friend inline EnableIf_< UseAssign<VT2> >
603 const ResultType tmp(
serial( rhs ) );
604 subAssign( ~lhs, tmp );
627 template<
typename VT2 >
628 friend inline EnableIf_< UseAssign<VT2> >
639 const ResultType tmp(
serial( rhs ) );
640 multAssign( ~lhs, tmp );
671 template<
typename VT2 >
672 friend inline EnableIf_< UseSMPAssign<VT2> >
683 const ResultType tmp( rhs );
707 template<
typename VT2 >
708 friend inline EnableIf_< UseSMPAssign<VT2> >
719 const ResultType tmp( rhs );
743 template<
typename VT2 >
744 friend inline EnableIf_< UseSMPAssign<VT2> >
755 const ResultType tmp( rhs );
802 template<
typename VT
804 inline const SVecScalarMultExpr<VT,UnderlyingBuiltin_<VT>,TF>
844 template<
typename T1
847 inline const EnableIf_< IsNumeric<T2>, MultExprTrait_<T1,T2> >
878 template<
typename T1
881 inline const EnableIf_< IsNumeric<T1>, MultExprTrait_<T1,T2> >
917 template<
typename VT
919 inline const SVecScalarMultExpr<VT,ElementType_<VT>,TF>
926 const ElementType len (
length( ~vec ) );
954 template<
typename VT
957 inline const SVecScalarMultExpr<VT,ST,TF>
958 operator-(
const SVecScalarMultExpr<VT,ST,TF>& sv )
962 return SVecScalarMultExpr<VT,ST,TF>( sv.leftOperand(), -sv.rightOperand() );
989 template<
typename VT
993 inline const EnableIf_< IsNumeric<ST2>, MultExprTrait_< SVecScalarMultExpr<VT,ST1,TF>, ST2 > >
994 operator*(
const SVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
998 return vec.leftOperand() * ( vec.rightOperand() * scalar );
1017 template<
typename ST1
1021 inline const EnableIf_< IsNumeric<ST1>, MultExprTrait_< ST1, SVecScalarMultExpr<VT,ST2,TF> > >
1022 operator*( ST1 scalar,
const SVecScalarMultExpr<VT,ST2,TF>& vec )
1026 return vec.leftOperand() * ( scalar * vec.rightOperand() );
1045 template<
typename VT
1049 inline const EnableIf_< And< IsNumeric<ST2>, Or< IsInvertible<ST1>, IsInvertible<ST2> > >
1050 , DivExprTrait_< SVecScalarMultExpr<VT,ST1,TF>, ST2 > >
1051 operator/(
const SVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1055 return vec.leftOperand() * ( vec.rightOperand() / scalar );
1075 template<
typename VT1
1079 inline const MultExprTrait_< SVecScalarMultExpr<VT1,ST,TF>, VT2 >
1080 operator*(
const SVecScalarMultExpr<VT1,ST,TF>& lhs,
const DenseVector<VT2,TF>& rhs )
1084 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1104 template<
typename VT1
1108 inline const MultExprTrait_< VT1, SVecScalarMultExpr<VT2,ST,TF> >
1109 operator*(
const DenseVector<VT1,TF>& lhs,
const SVecScalarMultExpr<VT2,ST,TF>& rhs )
1113 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1133 template<
typename VT1
1136 inline const MultExprTrait_< SVecScalarMultExpr<VT1,ST,false>, VT2 >
1137 operator*(
const SVecScalarMultExpr<VT1,ST,false>& lhs,
const DenseVector<VT2,true>& rhs )
1141 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1161 template<
typename VT1
1164 inline const MultExprTrait_< VT1, SVecScalarMultExpr<VT2,ST,true> >
1165 operator*(
const DenseVector<VT1,false>& lhs,
const SVecScalarMultExpr<VT2,ST,true>& rhs )
1169 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1189 template<
typename VT1
1193 inline const MultExprTrait_< SVecScalarMultExpr<VT1,ST,TF>, VT2 >
1194 operator*(
const SVecScalarMultExpr<VT1,ST,TF>& lhs,
const SparseVector<VT2,TF>& rhs )
1198 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1218 template<
typename VT1
1222 inline const MultExprTrait_< VT1, SVecScalarMultExpr<VT2,ST,TF> >
1223 operator*(
const SparseVector<VT1,TF>& lhs,
const SVecScalarMultExpr<VT2,ST,TF>& rhs )
1227 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1247 template<
typename VT1
1252 inline const MultExprTrait_< SVecScalarMultExpr<VT1,ST1,TF>, SVecScalarMultExpr<VT2,ST2,TF> >
1253 operator*(
const SVecScalarMultExpr<VT1,ST1,TF>& lhs,
const SVecScalarMultExpr<VT2,ST2,TF>& rhs )
1257 return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1277 template<
typename VT1
1280 inline const MultExprTrait_< SVecScalarMultExpr<VT1,ST,false>, VT2 >
1281 operator*(
const SVecScalarMultExpr<VT1,ST,false>& lhs,
const SparseVector<VT2,true>& rhs )
1285 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1305 template<
typename VT1
1308 inline const MultExprTrait_< VT1, SVecScalarMultExpr<VT2,ST,true> >
1309 operator*(
const SparseVector<VT1,false>& lhs,
const SVecScalarMultExpr<VT2,ST,true>& rhs )
1313 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1333 template<
typename VT1
1337 inline const MultExprTrait_< SVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >
1338 operator*(
const SVecScalarMultExpr<VT1,ST1,false>& lhs,
const SVecScalarMultExpr<VT2,ST2,true>& rhs )
1342 return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1362 template<
typename MT
1366 inline const MultExprTrait_< MT, SVecScalarMultExpr<VT,ST,false> >
1367 operator*(
const DenseMatrix<MT,SO>& mat,
const SVecScalarMultExpr<VT,ST,false>& vec )
1371 return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1391 template<
typename VT
1395 inline const MultExprTrait_< SVecScalarMultExpr<VT,ST,true>, MT >
1396 operator*(
const SVecScalarMultExpr<VT,ST,true>& vec,
const DenseMatrix<MT,SO>& mat )
1400 return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1420 template<
typename MT
1424 inline const MultExprTrait_< MT, SVecScalarMultExpr<VT,ST,false> >
1425 operator*(
const SparseMatrix<MT,SO>& mat,
const SVecScalarMultExpr<VT,ST,false>& vec )
1429 return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1449 template<
typename VT
1453 inline const MultExprTrait_< SVecScalarMultExpr<VT,ST,true>, MT >
1454 operator*(
const SVecScalarMultExpr<VT,ST,true>& vec,
const SparseMatrix<MT,SO>& mat )
1458 return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1474 template<
typename VT,
typename ST,
bool TF >
1491 template<
typename VT,
typename ST1,
typename ST2 >
1496 typedef If_< And< IsSparseVector<VT>, IsColumnVector<VT>
1497 , IsNumeric<ST1>, IsNumeric<ST2> >
1498 , SVecScalarMultExprTrait_< VT, MultTrait_<ST1,ST2> >
1499 , INVALID_TYPE > Type;
1516 template<
typename VT,
typename ST1,
typename ST2 >
1521 using Type = If_< And< IsSparseVector<VT>, IsRowVector<VT>
1522 , IsNumeric<ST1>, IsNumeric<ST2> >
1523 , TSVecScalarMultExprTrait_< VT, MultTrait_<ST1,ST2> >
1541 template<
typename VT,
typename ST1,
typename ST2 >
1546 using ScalarType = DivTrait_<ST1,ST2>;
1551 using Type = If_< And< IsSparseVector<VT>, IsColumnVector<VT>
1552 , IsNumeric<ST1>, IsNumeric<ST2> >
1553 , If_< IsInvertible<ScalarType>
1554 , SVecScalarMultExprTrait_<VT,ScalarType>
1555 , SVecScalarDivExprTrait_<VT,ScalarType> >
1573 template<
typename VT,
typename ST1,
typename ST2 >
1578 using ScalarType = DivTrait_<ST1,ST2>;
1583 using Type = If_< And< IsSparseVector<VT>, IsRowVector<VT>
1584 , IsNumeric<ST1>, IsNumeric<ST2> >
1585 , If_< IsInvertible<ScalarType>
1586 , TSVecScalarMultExprTrait_<VT,ScalarType>
1587 , TSVecScalarDivExprTrait_<VT,ScalarType> >
1605 template<
typename VT1,
typename VT2,
typename ST >
1610 using Type = If_< And< IsDenseVector<VT1>, IsColumnVector<VT1>
1611 , IsSparseVector<VT2>, IsColumnVector<VT2>
1613 , SVecScalarMultExprTrait_< DVecSVecMultExprTrait_<VT1,VT2>, ST >
1631 template<
typename VT1,
typename VT2,
typename ST >
1636 using Type = If_< And< IsDenseVector<VT1>, IsColumnVector<VT1>
1637 , IsSparseVector<VT2>, IsRowVector<VT2>
1639 , SMatScalarMultExprTrait_< DVecTSVecMultExprTrait_<VT1,VT2>, ST >
1657 template<
typename VT1,
typename VT2,
typename ST >
1662 using Type = If_< And< IsDenseVector<VT1>, IsRowVector<VT1>
1663 , IsSparseVector<VT2>, IsRowVector<VT2>
1665 , TSVecScalarMultExprTrait_< TDVecTSVecMultExprTrait_<VT1,VT2>, ST >
1683 template<
typename VT1,
typename ST,
typename VT2 >
1688 using Type = If_< And< IsSparseVector<VT1>, IsColumnVector<VT1>
1689 , IsDenseVector<VT2>, IsColumnVector<VT2>
1691 , SVecScalarMultExprTrait_< SVecDVecMultExprTrait_<VT1,VT2>, ST >
1709 template<
typename VT1,
typename ST,
typename VT2 >
1714 using Type = If_< And< IsSparseVector<VT1>, IsColumnVector<VT1>
1715 , IsDenseVector<VT2>, IsRowVector<VT2>
1717 , TSMatScalarMultExprTrait_< SVecTDVecMultExprTrait_<VT1,VT2>, ST >
1735 template<
typename VT1,
typename ST,
typename VT2 >
1740 using Type = If_< And< IsSparseVector<VT1>, IsRowVector<VT1>
1741 , IsDenseVector<VT2>, IsRowVector<VT2>
1743 , TSVecScalarMultExprTrait_< TSVecTDVecMultExprTrait_<VT1,VT2>, ST >
1761 template<
typename VT1,
typename ST,
typename VT2 >
1766 using Type = If_< And< IsSparseVector<VT1>, IsColumnVector<VT1>
1767 , IsSparseVector<VT2>, IsColumnVector<VT2>
1769 , SVecScalarMultExprTrait_< SVecSVecMultExprTrait_<VT1,VT2>, ST >
1779 template<
typename VT1,
typename VT2,
typename ST >
1784 using Type = If_< And< IsSparseVector<VT1>, IsColumnVector<VT1>
1785 , IsSparseVector<VT2>, IsColumnVector<VT2>
1787 , SVecScalarMultExprTrait_< SVecSVecMultExprTrait_<VT1,VT2>, ST >
1797 template<
typename VT1,
typename ST1,
typename VT2,
typename ST2 >
1802 using Type = If_< And< IsSparseVector<VT1>, IsColumnVector<VT1>
1803 , IsSparseVector<VT2>, IsColumnVector<VT2>
1804 , IsNumeric<ST1>, IsNumeric<ST2> >
1805 , SVecScalarMultExprTrait_< SVecSVecMultExprTrait_<VT1,VT2>, MultTrait_<ST1,ST2> >
1823 template<
typename VT1,
typename ST,
typename VT2 >
1828 using Type = If_< And< IsSparseVector<VT1>, IsColumnVector<VT1>
1829 , IsSparseVector<VT2>, IsRowVector<VT2>
1831 , SMatScalarMultExprTrait_< SVecTSVecMultExprTrait_<VT1,VT2>, ST >
1841 template<
typename VT1,
typename VT2,
typename ST >
1846 using Type = If_< And< IsSparseVector<VT1>, IsColumnVector<VT1>
1847 , IsSparseVector<VT2>, IsRowVector<VT2>
1849 , SMatScalarMultExprTrait_< SVecTSVecMultExprTrait_<VT1,VT2>, ST >
1859 template<
typename VT1,
typename ST1,
typename VT2,
typename ST2 >
1864 using Type = If_< And< IsSparseVector<VT1>, IsColumnVector<VT1>
1865 , IsSparseVector<VT2>, IsRowVector<VT2>
1866 , IsNumeric<ST1>, IsNumeric<ST2> >
1867 , SMatScalarMultExprTrait_< SVecTSVecMultExprTrait_<VT1,VT2>, MultTrait_<ST1,ST2> >
1885 template<
typename VT1,
typename ST,
typename VT2 >
1890 using Type = If_< And< IsSparseVector<VT1>, IsRowVector<VT1>
1891 , IsSparseVector<VT2>, IsRowVector<VT2>
1893 , TSVecScalarMultExprTrait_< TSVecTSVecMultExprTrait_<VT1,VT2>, ST >
1903 template<
typename VT1,
typename VT2,
typename ST >
1908 using Type = If_< And< IsSparseVector<VT1>, IsRowVector<VT1>
1909 , IsSparseVector<VT2>, IsRowVector<VT2>
1911 , TSVecScalarMultExprTrait_< TSVecTSVecMultExprTrait_<VT1,VT2>, ST >
1921 template<
typename VT1,
typename ST1,
typename VT2,
typename ST2 >
1926 using Type = If_< And< IsSparseVector<VT1>, IsRowVector<VT1>
1927 , IsSparseVector<VT2>, IsRowVector<VT2>
1928 , IsNumeric<ST1>, IsNumeric<ST2> >
1929 , TSVecScalarMultExprTrait_< TSVecTSVecMultExprTrait_<VT1,VT2>, MultTrait_<ST1,ST2> >
1947 template<
typename MT,
typename VT,
typename ST >
1952 using Type = If_< And< IsDenseMatrix<MT>, IsRowMajorMatrix<MT>
1953 , IsSparseVector<VT>, IsColumnVector<VT>
1955 , DVecScalarMultExprTrait_< DMatSVecMultExprTrait_<MT,VT>, ST >
1973 template<
typename MT,
typename VT,
typename ST >
1978 using Type = If_< And< IsDenseMatrix<MT>, IsColumnMajorMatrix<MT>
1979 , IsSparseVector<VT>, IsColumnVector<VT>
1981 , DVecScalarMultExprTrait_< TDMatSVecMultExprTrait_<MT,VT>, ST >
1999 template<
typename VT,
typename ST,
typename MT >
2004 using Type = If_< And< IsSparseVector<VT>, IsRowVector<VT>
2005 , IsDenseMatrix<MT>, IsRowMajorMatrix<MT>
2007 , TDVecScalarMultExprTrait_< TSVecDMatMultExprTrait_<VT,MT>, ST >
2025 template<
typename VT,
typename ST,
typename MT >
2030 using Type = If_< And< IsSparseVector<VT>, IsRowVector<VT>
2031 , IsDenseMatrix<MT>, IsColumnMajorMatrix<MT>
2033 , TDVecScalarMultExprTrait_< TSVecTDMatMultExprTrait_<VT,MT>, ST >
2051 template<
typename MT,
typename VT,
typename ST >
2056 using Type = If_< And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT>
2057 , IsSparseVector<VT>, IsColumnVector<VT>
2059 , SVecScalarMultExprTrait_< SMatSVecMultExprTrait_<MT,VT>, ST >
2077 template<
typename MT,
typename VT,
typename ST >
2082 using Type = If_< And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT>
2083 , IsSparseVector<VT>, IsColumnVector<VT>
2085 , SVecScalarMultExprTrait_< TSMatSVecMultExprTrait_<MT,VT>, ST >
2103 template<
typename VT,
typename ST,
typename MT >
2108 using Type = If_< And< IsSparseVector<VT>, IsRowVector<VT>
2109 , IsSparseMatrix<MT>, IsRowMajorMatrix<MT>
2111 , TSVecScalarMultExprTrait_< TSVecSMatMultExprTrait_<VT,MT>, ST >
2129 template<
typename VT,
typename ST,
typename MT >
2134 using Type = If_< And< IsSparseVector<VT>, IsRowVector<VT>
2135 , IsSparseMatrix<MT>, IsColumnMajorMatrix<MT>
2137 , TSVecScalarMultExprTrait_< TSVecTSMatMultExprTrait_<VT,MT>, ST >
2155 template<
typename VT,
typename ST,
bool TF,
bool AF >
2160 using Type = MultExprTrait_< SubvectorExprTrait_<const VT,AF>, ST >;
ValueType & ReferenceType
Reference return type.
Definition: SVecScalarMultExpr.h:208
Pointer difference type of the Blaze library.
Header file for auxiliary alias declarations.
Constraint on the data type.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SVecScalarMultExpr.h:184
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SVecScalarMultExpr.h:462
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:70
IteratorCategory iterator_category
The iterator category.
Definition: SVecScalarMultExpr.h:212
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7800
Header file for basic type definitions.
Header file for the SparseVector base class.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SVecScalarMultExpr.h:296
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the IsSparseMatrix type trait.
Header file for the serial shim.
Header file for the IsColumnMajorMatrix type trait.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SVecScalarMultExpr.h:209
Header file for the IsRowVector type trait.
EnableIf_< IsDenseVector< VT1 > > 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:193
const Element operator*() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecScalarMultExpr.h:244
Header file for the And class template.
Iterator over the elements of the sparse vector/scalar multiplication expression. ...
Definition: SVecScalarMultExpr.h:195
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: SVecScalarMultExpr.h:450
ConstIterator_< RemoveReference_< LeftOperand > > IteratorType
Iterator type of the sparse vector expression.
Definition: SVecScalarMultExpr.h:203
const ConstIterator * operator->() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecScalarMultExpr.h:254
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:245
Header file for the Computation base class.
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:731
Header file for the RequiresEvaluation type trait.
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SVecScalarMultExpr.h:307
size_t index() const
Access to the current index of the sparse element.
Definition: SVecScalarMultExpr.h:274
Header file for the VecScalarMultExpr base class.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
typename UnderlyingBuiltin< T >::Type UnderlyingBuiltin_
Auxiliary alias declaration for the UnderlyingBuiltin type trait.The UnderlyingBuiltin_ alias declara...
Definition: UnderlyingBuiltin.h:133
ConstIterator & operator++()
Pre-increment operator.
Definition: SVecScalarMultExpr.h:233
Constraint on the data type.
auto length(const DenseVector< VT, TF > &dv) -> decltype(sqrt(sqrLength(~dv)))
Calculation of the dense vector length .
Definition: DenseVector.h:574
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecScalarMultExpr.h:394
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SVecScalarMultExpr.h:482
Header file for the DivExprTrait class template.
ConstIterator lowerBound(size_t index) const
Returns an iterator to the first index not less then the given index.
Definition: SVecScalarMultExpr.h:417
typename MultExprTrait< T1, T2 >::Type MultExprTrait_
Auxiliary alias declaration for the MultExprTrait class template.The MultExprTrait_ alias declaration...
Definition: MultExprTrait.h:344
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
ValueIndexPair< ElementType > Element
Element type of the sparse vector expression.
Definition: SVecScalarMultExpr.h:200
const EnableIf_< IsNumeric< T2 >, DivExprTrait_< T1, T2 > > operator/(const DenseMatrix< T1, SO > &mat, T2 scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:966
Header file for the ValueIndexPair class.
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
PointerType pointer
Pointer return type.
Definition: SVecScalarMultExpr.h:214
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
ReturnType value() const
Access to the current value of the sparse element.
Definition: SVecScalarMultExpr.h:264
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: SVecScalarMultExpr.h:315
Header file for the UnderlyingBuiltin type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: SVecScalarMultExpr.h:175
Header file for the Or class template.
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: SVecScalarMultExpr.h:384
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
If_< IsExpression< VT >, const VT, const VT & > LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: SVecScalarMultExpr.h:181
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE(A, B)
Data type constraint.In case the two types A and B are not the same (ignoring all cv-qualifiers of bo...
Definition: SameType.h:71
#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:61
CompositeType_< VT > CT
Composite type of the sparse vector expression.
Definition: SVecScalarMultExpr.h:117
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:60
Header file for the exception macros of the math module.
Constraint on the data type.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Header file for the IsDenseMatrix type trait.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SVecScalarMultExpr.h:474
Header file for the EnableIf class template.
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse vector operand.
Definition: SVecScalarMultExpr.h:440
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SVecScalarMultExpr.h:285
Header file for the IsNumeric type trait.
IfTrue_< useAssign, const ResultType, const SVecScalarMultExpr & > CompositeType
Data type for composite expression templates.
Definition: SVecScalarMultExpr.h:178
ConstIterator end() const
Returns an iterator just past the last non-zero element of the sparse vector.
Definition: SVecScalarMultExpr.h:374
ConstIterator find(size_t index) const
Searches for a specific vector element.
Definition: SVecScalarMultExpr.h:405
Header file for the IsSparseVector type trait.
ElementType_< ResultType > ElementType
Resulting element type.
Definition: SVecScalarMultExpr.h:172
ResultType_< VT > RT
Result type of the sparse vector expression.
Definition: SVecScalarMultExpr.h:115
Header file for run time assertion macros.
Utility type for generic codes.
Element ValueType
Type of the underlying pointers.
Definition: SVecScalarMultExpr.h:206
Header file for the division trait.
IteratorType vector_
Iterator over the elements of the left-hand side sparse vector expression.
Definition: SVecScalarMultExpr.h:314
ReferenceType reference
Reference return type.
Definition: SVecScalarMultExpr.h:215
SVecScalarMultExpr< VT, ST, TF > This
Type of this SVecScalarMultExpr instance.
Definition: SVecScalarMultExpr.h:169
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:160
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SVecScalarMultExpr.h:205
MultTrait_< RT, ST > ResultType
Result type for expression template evaluations.
Definition: SVecScalarMultExpr.h:170
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:61
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecScalarMultExpr.h:338
ValueType * PointerType
Pointer return type.
Definition: SVecScalarMultExpr.h:207
DifferenceType difference_type
Difference between two iterators.
Definition: SVecScalarMultExpr.h:216
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
Header file for the RemoveReference type trait.
Header file for the IsInvertible type trait.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
Header file for the IsDenseVector type trait.
ValueType value_type
Type of the underlying pointers.
Definition: SVecScalarMultExpr.h:213
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
ReturnType_< VT > RN
Return type of the sparse vector expression.
Definition: SVecScalarMultExpr.h:116
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:70
const DVecScalarMultExpr< VT, ElementType_< VT >, TF > normalize(const DenseVector< VT, TF > &vec)
Normalization of the dense vector ( ).
Definition: DVecScalarMultExpr.h:1164
ConstIterator upperBound(size_t index) const
Returns an iterator to the first index greater then the given index.
Definition: SVecScalarMultExpr.h:429
Header file for the IsRowMajorMatrix type trait.
MultExprTrait_< RN, ST > ExprReturnType
Expression return type for the subscript operator.
Definition: SVecScalarMultExpr.h:130
Header file for the IsComputation type trait class.
Expression object for sparse vector-scalar multiplications.The SVecScalarMultExpr class represents th...
Definition: Forward.h:118
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:110
#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
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SVecScalarMultExpr.h:171
SVecScalarMultExpr(const VT &vector, ST scalar) noexcept
Constructor for the SVecScalarMultExpr class.
Definition: SVecScalarMultExpr.h:326
Header file for the SubvectorExprTrait class template.
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
ConstIterator begin() const
Returns an iterator to the first non-zero element of the sparse vector.
Definition: SVecScalarMultExpr.h:364
LeftOperand vector_
Left-hand side sparse vector of the multiplication expression.
Definition: SVecScalarMultExpr.h:481
Header file for the IsColumnVector type trait.
Header file for the Size type trait.
#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:63
#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
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: SVecScalarMultExpr.h:351
#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:61
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
ConstIterator(IteratorType vector, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SVecScalarMultExpr.h:222