35#ifndef _BLAZE_MATH_EXPRESSIONS_SVECNOALIASEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_SVECNOALIASEXPR_H_
83 :
public VecNoAliasExpr< SparseVector< SVecNoAliasExpr<VT,TF>, TF > >
149 return sv_.at( index );
178 inline size_t size() const noexcept {
189 return sv_.nonZeros();
245 template<
typename T >
246 inline bool canAlias(
const T* alias )
const noexcept {
258 template<
typename T >
259 inline bool isAliased(
const T* alias )
const noexcept {
271 return sv_.canSMPAssign();
294 template<
typename VT2 >
301 assign( *lhs, rhs.
sv_ );
320 template<
typename VT2 >
327 assign( *lhs, rhs.
sv_ );
346 template<
typename VT2 >
347 friend inline void addAssign( DenseVector<VT2,TF>& lhs,
const SVecNoAliasExpr& rhs )
353 addAssign( *lhs, rhs.sv_ );
376 template<
typename VT2 >
377 friend inline void subAssign( DenseVector<VT2,TF>& lhs,
const SVecNoAliasExpr& rhs )
383 subAssign( *lhs, rhs.sv_ );
406 template<
typename VT2 >
407 friend inline void multAssign( DenseVector<VT2,TF>& lhs,
const SVecNoAliasExpr& rhs )
413 multAssign( *lhs, rhs.sv_ );
436 template<
typename VT2 >
462 template<
typename VT2 >
488 template<
typename VT2 >
518 template<
typename VT2 >
548 template<
typename VT2 >
606 return ReturnType( *sv );
Header file for auxiliary alias declarations.
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.
Definition Aliases.h:470
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.
Definition Aliases.h:550
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition Aliases.h:190
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition Aliases.h:450
Header file for run time assertion macros.
Header file for the function trace functionality.
Header file for the GetMemberType type trait.
Header file for the If class template.
Utility type for generic codes.
Header file for the IsExpression type trait class.
Deactivation of problematic macros.
Header file for the MAYBE_UNUSED function template.
Base class for N-dimensional dense vectors.
Definition DenseVector.h:77
Expression object for the non-aliased evaluation of sparse vectors.
Definition SVecNoAliasExpr.h:85
ConstIterator end() const
Returns an iterator just past the last non-zero element of the sparse vector.
Definition SVecNoAliasExpr.h:168
ConstIterator upperBound(size_t index) const
Returns an iterator to the first index greater then the given index.
Definition SVecNoAliasExpr.h:223
ConstIterator find(size_t index) const
Searches for a specific vector element.
Definition SVecNoAliasExpr.h:199
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition SVecNoAliasExpr.h:178
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition SVecNoAliasExpr.h:148
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition SVecNoAliasExpr.h:188
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition SVecNoAliasExpr.h:136
ResultType_t< VT > ResultType
Result type for expression template evaluations.
Definition SVecNoAliasExpr.h:100
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition SVecNoAliasExpr.h:246
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition SVecNoAliasExpr.h:259
ConstIterator lowerBound(size_t index) const
Returns an iterator to the first index not less then the given index.
Definition SVecNoAliasExpr.h:211
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition SVecNoAliasExpr.h:117
ReturnType_t< VT > ReturnType
Return type for expression template evaluations.
Definition SVecNoAliasExpr.h:103
TransposeType_t< VT > TransposeType
Transpose type for expression template evaluations.
Definition SVecNoAliasExpr.h:101
Operand sv_
Sparse vector of the no-alias expression.
Definition SVecNoAliasExpr.h:277
Operand operand() const noexcept
Returns the sparse vector operand.
Definition SVecNoAliasExpr.h:234
ElementType_t< VT > ElementType
Resulting element type.
Definition SVecNoAliasExpr.h:102
GetConstIterator_t< VT > ConstIterator
Iterator over the elements of the dense vector.
Definition SVecNoAliasExpr.h:109
If_t< RequiresEvaluation_v< VT >, const ResultType, const SVecNoAliasExpr & > CompositeType
Data type for composite expression templates.
Definition SVecNoAliasExpr.h:106
SVecNoAliasExpr(const VT &sv) noexcept
Constructor for the SVecNoAliasExpr class.
Definition SVecNoAliasExpr.h:125
If_t< IsExpression_v< VT >, const VT, const VT & > Operand
Composite data type of the sparse vector expression.
Definition SVecNoAliasExpr.h:112
VecNoAliasExpr< SparseVector< This, TF > > BaseType
Base type of this SVecNoAliasExpr instance.
Definition SVecNoAliasExpr.h:98
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition SVecNoAliasExpr.h:270
SVecNoAliasExpr< VT, TF > This
Type of this SVecNoAliasExpr instance.
Definition SVecNoAliasExpr.h:95
BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT(GetConstIterator, ConstIterator, INVALID_TYPE)
Definition of the GetConstIterator type trait.
ConstIterator begin() const
Returns an iterator to the first non-zero element of the sparse vector.
Definition SVecNoAliasExpr.h:158
Base class for sparse vectors.
Definition SparseVector.h:72
Constraint on the data type.
Constraint on the data type.
Header file for the Computation base class.
Header file for the Modification base class.
Header file for the SparseVector base class.
Header file for the VecNoAliasExpr base class.
decltype(auto) noalias(const DenseMatrix< MT, SO > &dm)
Forces the non-aliased evaluation of the given dense matrix expression dm.
Definition DMatNoAliasExpr.h:679
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition RequiresEvaluation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.
Definition TransposeFlag.h:63
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.
Definition SparseVector.h:61
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition Assert.h:101
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition DenseMatrix.h:162
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition DenseMatrix.h:100
auto smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP multiplication assignment of a vector to a dense vector.
Definition DenseVector.h:192
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition DenseMatrix.h:131
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition MaybeUnused.h:81
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition FunctionTrace.h:94
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition If.h:108
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.
Base class for all modification expression templates.
Definition Modification.h:76
Base class for all vector no-alias expression templates.
Definition VecNoAliasExpr.h:68
Header file for the RequiresEvaluation type trait.
Header file for basic type definitions.