35#ifndef _BLAZE_MATH_EXPRESSIONS_DVECEVALEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_DVECEVALEXPR_H_
78 :
public VecEvalExpr< DenseVector< DVecEvalExpr<VT,TF>, TF > >
139 if( index >=
dv_.size() ) {
142 return (*
this)[index];
151 inline size_t size() const noexcept {
172 template<
typename T >
173 inline bool canAlias(
const T* alias )
const noexcept {
174 return dv_.canAlias( alias );
184 template<
typename T >
185 inline bool isAliased(
const T* alias )
const noexcept {
186 return dv_.isAliased( alias );
196 return dv_.isAligned();
206 return dv_.canSMPAssign();
227 template<
typename VT2 >
234 assign( *lhs, rhs.
dv_ );
251 template<
typename VT2 >
258 assign( *lhs, rhs.
dv_ );
275 template<
typename VT2 >
276 friend inline void addAssign( DenseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
282 addAssign( *lhs, rhs.dv_ );
299 template<
typename VT2 >
300 friend inline void addAssign( SparseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
306 addAssign( *lhs, rhs.dv_ );
323 template<
typename VT2 >
324 friend inline void subAssign( DenseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
330 subAssign( *lhs, rhs.dv_ );
347 template<
typename VT2 >
348 friend inline void subAssign( SparseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
354 subAssign( *lhs, rhs.dv_ );
371 template<
typename VT2 >
372 friend inline void multAssign( DenseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
378 multAssign( *lhs, rhs.dv_ );
395 template<
typename VT2 >
396 friend inline void multAssign( SparseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
402 multAssign( *lhs, rhs.dv_ );
419 template<
typename VT2 >
420 friend inline void divAssign( DenseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
426 divAssign( *lhs, rhs.dv_ );
443 template<
typename VT2 >
444 friend inline void divAssign( SparseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
450 divAssign( *lhs, rhs.dv_ );
467 template<
typename VT2 >
491 template<
typename VT2 >
515 template<
typename VT2 >
539 template<
typename VT2 >
563 template<
typename VT2 >
587 template<
typename VT2 >
611 template<
typename VT2 >
635 template<
typename VT2 >
659 template<
typename VT2 >
683 template<
typename VT2 >
737 return ReturnType( *dv );
752template<
typename VT,
bool TF >
753struct IsAligned< DVecEvalExpr<VT,TF> >
754 :
public IsAligned<VT>
Header file for auxiliary alias declarations.
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.
Definition: Aliases.h:470
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition: Aliases.h:450
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition: Aliases.h:190
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.
Definition: Aliases.h:550
Header file for run time assertion macros.
Header file for the function trace functionality.
Header file for the If class template.
Header file for the IsAligned type trait.
Header file for the IsExpression type trait class.
Deactivation of problematic macros.
Expression object for the forced evaluation of dense vectors.
Definition: DVecEvalExpr.h:80
ElementType_t< VT > ElementType
Resulting element type.
Definition: DVecEvalExpr.h:91
Operand operand() const noexcept
Returns the dense vector operand.
Definition: DVecEvalExpr.h:161
DVecEvalExpr(const VT &dv) noexcept
Constructor for the DVecEvalExpr class.
Definition: DVecEvalExpr.h:114
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DVecEvalExpr.h:106
Operand dv_
Dense vector of the evaluation expression.
Definition: DVecEvalExpr.h:212
ResultType_t< VT > ResultType
Result type for expression template evaluations.
Definition: DVecEvalExpr.h:89
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecEvalExpr.h:195
If_t< IsExpression_v< VT >, const VT, const VT & > Operand
Composite data type of the dense vector expression.
Definition: DVecEvalExpr.h:98
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecEvalExpr.h:173
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DVecEvalExpr.h:103
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecEvalExpr.h:205
ReturnType_t< VT > ReturnType
Return type for expression template evaluations.
Definition: DVecEvalExpr.h:92
TransposeType_t< VT > TransposeType
Transpose type for expression template evaluations.
Definition: DVecEvalExpr.h:90
const ResultType CompositeType
Data type for composite expression templates.
Definition: DVecEvalExpr.h:95
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecEvalExpr.h:125
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecEvalExpr.h:138
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecEvalExpr.h:151
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecEvalExpr.h:185
Base class for N-dimensional dense vectors.
Definition: DenseVector.h:77
Base class for sparse vectors.
Definition: SparseVector.h:72
Constraint on the data type.
Header file for the Computation base class.
Header file for the DenseVector base class.
Header file for the VecEvalExpr base class.
decltype(auto) eval(const DenseVector< VT, TF > &dv)
Forces the evaluation of the given dense vector expression dv.
Definition: DVecEvalExpr.h:732
#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_DENSE_VECTOR_TYPE(T)
Constraint on the data type.
Definition: DenseVector.h:61
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
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:221
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
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition: If.h:108
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition: Exception.h:331
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition: FunctionTrace.h:94
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 compute expression templates.
Definition: Computation.h:68
Base class for all vector evaluation expression templates.
Definition: VecEvalExpr.h:69
Header file for basic type definitions.