35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECEVALEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_DVECEVALEXPR_H_ 77 :
public VecEvalExpr< DenseVector< DVecEvalExpr<VT,TF>, TF > >
134 if( index >=
dv_.size() ) {
137 return (*
this)[index];
146 inline size_t size() const noexcept {
167 template<
typename T >
168 inline bool canAlias(
const T* alias )
const noexcept {
169 return dv_.canAlias( alias );
179 template<
typename T >
180 inline bool isAliased(
const T* alias )
const noexcept {
181 return dv_.isAliased( alias );
191 return dv_.isAligned();
201 return dv_.canSMPAssign();
222 template<
typename VT2 >
229 assign( ~lhs, rhs.
dv_ );
246 template<
typename VT2 >
253 assign( ~lhs, rhs.
dv_ );
270 template<
typename VT2 >
271 friend inline void addAssign( DenseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
277 addAssign( ~lhs, rhs.dv_ );
294 template<
typename VT2 >
295 friend inline void addAssign( SparseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
301 addAssign( ~lhs, rhs.dv_ );
318 template<
typename VT2 >
319 friend inline void subAssign( DenseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
325 subAssign( ~lhs, rhs.dv_ );
342 template<
typename VT2 >
343 friend inline void subAssign( SparseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
349 subAssign( ~lhs, rhs.dv_ );
366 template<
typename VT2 >
367 friend inline void multAssign( DenseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
373 multAssign( ~lhs, rhs.dv_ );
390 template<
typename VT2 >
391 friend inline void multAssign( SparseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
397 multAssign( ~lhs, rhs.dv_ );
414 template<
typename VT2 >
415 friend inline void divAssign( DenseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
421 divAssign( ~lhs, rhs.dv_ );
438 template<
typename VT2 >
439 friend inline void divAssign( SparseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
445 divAssign( ~lhs, rhs.dv_ );
462 template<
typename VT2 >
486 template<
typename VT2 >
510 template<
typename VT2 >
534 template<
typename VT2 >
558 template<
typename VT2 >
582 template<
typename VT2 >
606 template<
typename VT2 >
630 template<
typename VT2 >
654 template<
typename VT2 >
678 template<
typename VT2 >
725 template<
typename VT
756 template<
typename VT
758 inline decltype(
auto)
eval( const DVecEvalExpr<VT,TF>& dv )
776 template<
typename VT,
bool TF >
777 struct IsAligned< DVecEvalExpr<VT,TF> >
778 :
public IsAligned<VT>
Header file for auxiliary alias declarations.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecEvalExpr.h:120
Header file for basic type definitions.
Base class for all vector evaluation expression templates.The VecEvalExpr class serves as a tag for a...
Definition: VecEvalExpr.h:66
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias declaration for the If class template.The If_t alias declaration provides a convenien...
Definition: If.h:109
ResultType_t< VT > ResultType
Result type for expression template evaluations.
Definition: DVecEvalExpr.h:84
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
Header file for the DenseVector base class.
Operand operand() const noexcept
Returns the dense vector operand.
Definition: DVecEvalExpr.h:156
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecEvalExpr.h:146
Header file for the Computation base class.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecEvalExpr.h:200
Header file for the VecEvalExpr base class.
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.The ReturnType_t alias declaration provides ...
Definition: Aliases.h:410
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
auto smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:220
Operand dv_
Dense vector of the evaluation expression.
Definition: DVecEvalExpr.h:207
Expression object for the forced evaluation of dense vectors.The DVecEvalExpr class represents the co...
Definition: DVecEvalExpr.h:76
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecEvalExpr.h:180
#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
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
Header file for the IsAligned type trait.
Constraint on the data type.
decltype(auto) eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:786
Constraint on the data type.
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DVecEvalExpr.h:101
Header file for the exception macros of the math module.
Header file for all forward declarations for expression class templates.
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DVecEvalExpr.h:98
ElementType_t< VT > ElementType
Resulting element type.
Definition: DVecEvalExpr.h:86
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.The TransposeType_t alias declaration pro...
Definition: Aliases.h:470
Header file for run time assertion macros.
If_t< IsExpression_v< VT >, const VT, const VT &> Operand
Composite data type of the dense vector expression.
Definition: DVecEvalExpr.h:93
DVecEvalExpr(const VT &dv) noexcept
Constructor for the DVecEvalExpr class.
Definition: DVecEvalExpr.h:109
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
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecEvalExpr.h:190
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecEvalExpr.h:133
ReturnType_t< VT > ReturnType
Return type for expression template evaluations.
Definition: DVecEvalExpr.h:87
#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
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
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:61
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
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecEvalExpr.h:168
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:138
TransposeType_t< VT > TransposeType
Transpose type for expression template evaluations.
Definition: DVecEvalExpr.h:85
#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
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:191
Header file for the IsExpression type trait class.
const ResultType CompositeType
Data type for composite expression templates.
Definition: DVecEvalExpr.h:90
Header file for the function trace functionality.