35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECSERIALEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_SVECSERIALEXPR_H_ 79 :
public VecSerialExpr< SparseVector< SVecSerialExpr<VT,TF>, TF > >
99 enum :
bool { smpAssignable = VT::smpAssignable };
132 if( index >=
sv_.size() ) {
135 return (*
this)[index];
144 inline size_t size() const noexcept {
155 return sv_.nonZeros();
185 template<
typename T >
186 inline bool canAlias(
const T* alias )
const noexcept {
187 return sv_.canAlias( alias );
197 template<
typename T >
198 inline bool isAliased(
const T* alias )
const noexcept {
199 return sv_.isAliased( alias );
209 return sv_.canSMPAssign();
230 template<
typename VT2 >
237 assign( ~lhs, rhs.sv_ );
254 template<
typename VT2 >
261 assign( ~lhs, rhs.sv_ );
278 template<
typename VT2 >
285 addAssign( ~lhs, rhs.sv_ );
302 template<
typename VT2 >
309 addAssign( ~lhs, rhs.sv_ );
327 template<
typename VT2 >
334 subAssign( ~lhs, rhs.sv_ );
352 template<
typename VT2 >
359 subAssign( ~lhs, rhs.sv_ );
377 template<
typename VT2 >
384 multAssign( ~lhs, rhs.sv_ );
402 template<
typename VT2 >
409 multAssign( ~lhs, rhs.sv_ );
426 template<
typename VT2 >
433 assign( ~lhs, rhs.sv_ );
450 template<
typename VT2 >
457 assign( ~lhs, rhs.sv_ );
475 template<
typename VT2 >
482 addAssign( ~lhs, rhs.sv_ );
500 template<
typename VT2 >
507 addAssign( ~lhs, rhs.sv_ );
525 template<
typename VT2 >
532 subAssign( ~lhs, rhs.sv_ );
550 template<
typename VT2 >
557 subAssign( ~lhs, rhs.sv_ );
575 template<
typename VT2 >
582 multAssign( ~lhs, rhs.sv_ );
600 template<
typename VT2 >
607 multAssign( ~lhs, rhs.sv_ );
647 template<
typename VT
678 template<
typename VT
698 template<
typename VT,
bool TF >
699 struct Size< SVecSerialExpr<VT,TF> >
Header file for auxiliary alias declarations.
Header file for basic type definitions.
Header file for the SparseVector base class.
const ResultType CompositeType
Data type for composite expression templates.
Definition: SVecSerialExpr.h:91
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:164
If_< IsExpression< VT >, const VT, const VT &> Operand
Composite data type of the sparse vector expression.
Definition: SVecSerialExpr.h:94
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
Header file for the Computation base class.
SVecSerialExpr(const VT &sv) noexcept
Constructor for the SVecSerialExpr class.
Definition: SVecSerialExpr.h:107
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SVecSerialExpr.h:198
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
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:133
ElementType_< VT > ElementType
Resulting element type.
Definition: SVecSerialExpr.h:87
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecSerialExpr.h:154
ReturnType_< VT > ReturnType
Return type for expression template evaluations.
Definition: SVecSerialExpr.h:88
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecSerialExpr.h:118
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:102
#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
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: SVecSerialExpr.h:131
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
Operand operand() const noexcept
Returns the sparse vector operand.
Definition: SVecSerialExpr.h:164
#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
Constraint on the data type.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SVecSerialExpr.h:208
TransposeType_< VT > TransposeType
Transpose type for expression template evaluations.
Definition: SVecSerialExpr.h:86
Header file for the exception macros of the math module.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Expression object for the forced serial evaluation of sparse vectors.The SVecSerialExpr class represe...
Definition: Forward.h:140
Header file for the VecSerialExpr base class.
Header file for run time assertion macros.
Utility type for generic codes.
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:154
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:819
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SVecSerialExpr.h:186
Operand sv_
Sparse vector of the serial evaluation expression.
Definition: SVecSerialExpr.h:215
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3082
ResultType_< VT > ResultType
Result type for expression template evaluations.
Definition: SVecSerialExpr.h:85
Header file for the IsComputation type trait class.
Compile time evaluation of the size of a vector.The Size type trait evaluates the size of the given v...
Definition: Size.h:74
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: SVecSerialExpr.h:144
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
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
Header file for the IsExpression type trait class.
Header file for the function trace functionality.