35#ifndef _BLAZE_MATH_EXPRESSIONS_DVECSERIALEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_DVECSERIALEXPR_H_
78 :
public VecSerialExpr< DenseVector< DVecSerialExpr<VT,TF>, TF > >
139 if( index >=
dv_.size() ) {
142 return (*
this)[index];
151 inline size_t size() const noexcept {
182 template<
typename T >
183 inline bool canAlias(
const T* alias )
const noexcept {
184 return dv_.canAlias( alias );
194 template<
typename T >
195 inline bool isAliased(
const T* alias )
const noexcept {
196 return dv_.isAliased( alias );
206 return dv_.isAligned();
216 return dv_.canSMPAssign();
237 template<
typename VT2 >
244 assign( *lhs, rhs.
dv_ );
261 template<
typename VT2 >
268 assign( *lhs, rhs.
dv_ );
285 template<
typename VT2 >
286 friend inline void addAssign( DenseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
292 addAssign( *lhs, rhs.dv_ );
309 template<
typename VT2 >
310 friend inline void addAssign( SparseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
316 addAssign( *lhs, rhs.dv_ );
334 template<
typename VT2 >
335 friend inline void subAssign( DenseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
341 subAssign( *lhs, rhs.dv_ );
359 template<
typename VT2 >
360 friend inline void subAssign( SparseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
366 subAssign( *lhs, rhs.dv_ );
384 template<
typename VT2 >
385 friend inline void multAssign( DenseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
391 multAssign( *lhs, rhs.dv_ );
409 template<
typename VT2 >
410 friend inline void multAssign( SparseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
416 multAssign( *lhs, rhs.dv_ );
433 template<
typename VT2 >
434 friend inline void divAssign( DenseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
440 divAssign( *lhs, rhs.dv_ );
457 template<
typename VT2 >
458 friend inline void divAssign( SparseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
464 divAssign( *lhs, rhs.dv_ );
481 template<
typename VT2 >
488 assign( *lhs, rhs.dv_ );
505 template<
typename VT2 >
512 assign( *lhs, rhs.dv_ );
530 template<
typename VT2 >
537 addAssign( *lhs, rhs.dv_ );
555 template<
typename VT2 >
562 addAssign( *lhs, rhs.dv_ );
580 template<
typename VT2 >
587 subAssign( *lhs, rhs.dv_ );
605 template<
typename VT2 >
612 subAssign( *lhs, rhs.dv_ );
630 template<
typename VT2 >
637 multAssign( *lhs, rhs.dv_ );
655 template<
typename VT2 >
662 multAssign( *lhs, rhs.dv_ );
680 template<
typename VT2 >
687 divAssign( *lhs, rhs.dv_ );
705 template<
typename VT2 >
712 divAssign( *lhs, rhs.dv_ );
759 return ReturnType( *dv );
774template<
typename VT,
bool TF >
775struct IsAligned< DVecSerialExpr<VT,TF> >
776 :
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::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 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 serial evaluation of dense vectors.
Definition DVecSerialExpr.h:80
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition DVecSerialExpr.h:125
const ResultType CompositeType
Data type for composite expression templates.
Definition DVecSerialExpr.h:95
Operand operand() const noexcept
Returns the dense vector operand.
Definition DVecSerialExpr.h:161
ResultType_t< VT > ResultType
Result type for expression template evaluations.
Definition DVecSerialExpr.h:89
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition DVecSerialExpr.h:215
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition DVecSerialExpr.h:103
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition DVecSerialExpr.h:138
TransposeType_t< VT > TransposeType
Transpose type for expression template evaluations.
Definition DVecSerialExpr.h:90
ElementType_t< VT > ElementType
Resulting element type.
Definition DVecSerialExpr.h:91
ReturnType_t< VT > ReturnType
Return type for expression template evaluations.
Definition DVecSerialExpr.h:92
VecSerialExpr< DenseVector< This, TF > > BaseType
Base type of this DVecSerialExpr instance.
Definition DVecSerialExpr.h:87
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition DVecSerialExpr.h:205
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition DVecSerialExpr.h:195
DVecSerialExpr(const VT &dv) noexcept
Constructor for the DVecSerialExpr class.
Definition DVecSerialExpr.h:114
If_t< IsExpression_v< VT >, const VT, const VT & > Operand
Composite data type of the dense vector expression.
Definition DVecSerialExpr.h:98
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition DVecSerialExpr.h:106
Operand dv_
Dense vector of the serial evaluation expression.
Definition DVecSerialExpr.h:222
DVecSerialExpr< VT, TF > This
Type of this DVecSerialExpr instance.
Definition DVecSerialExpr.h:84
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition DVecSerialExpr.h:151
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition DVecSerialExpr.h:183
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 VecSerialExpr base class.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition DMatSerialExpr.h:812
#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
#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
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 compute expression templates.
Definition Computation.h:68
Base class for all vector serial evaluation expression templates.
Definition VecSerialExpr.h:69
Header file for basic type definitions.