35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECSERIALEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_DVECSERIALEXPR_H_ 77 :
public VecSerialExpr< DenseVector< DVecSerialExpr<VT,TF>, TF > >
134 if( index >=
dv_.size() ) {
137 return (*
this)[index];
146 inline size_t size() const noexcept {
177 template<
typename T >
178 inline bool canAlias(
const T* alias )
const noexcept {
179 return dv_.canAlias( alias );
189 template<
typename T >
190 inline bool isAliased(
const T* alias )
const noexcept {
191 return dv_.isAliased( alias );
201 return dv_.isAligned();
211 return dv_.canSMPAssign();
232 template<
typename VT2 >
239 assign( ~lhs, rhs.
dv_ );
256 template<
typename VT2 >
263 assign( ~lhs, rhs.
dv_ );
280 template<
typename VT2 >
281 friend inline void addAssign( DenseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
287 addAssign( ~lhs, rhs.dv_ );
304 template<
typename VT2 >
305 friend inline void addAssign( SparseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
311 addAssign( ~lhs, rhs.dv_ );
329 template<
typename VT2 >
330 friend inline void subAssign( DenseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
336 subAssign( ~lhs, rhs.dv_ );
354 template<
typename VT2 >
355 friend inline void subAssign( SparseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
361 subAssign( ~lhs, rhs.dv_ );
379 template<
typename VT2 >
380 friend inline void multAssign( DenseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
386 multAssign( ~lhs, rhs.dv_ );
404 template<
typename VT2 >
405 friend inline void multAssign( SparseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
411 multAssign( ~lhs, rhs.dv_ );
428 template<
typename VT2 >
429 friend inline void divAssign( DenseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
435 divAssign( ~lhs, rhs.dv_ );
452 template<
typename VT2 >
453 friend inline void divAssign( SparseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
459 divAssign( ~lhs, rhs.dv_ );
476 template<
typename VT2 >
483 assign( ~lhs, rhs.dv_ );
500 template<
typename VT2 >
507 assign( ~lhs, rhs.dv_ );
525 template<
typename VT2 >
532 addAssign( ~lhs, rhs.dv_ );
550 template<
typename VT2 >
557 addAssign( ~lhs, rhs.dv_ );
575 template<
typename VT2 >
582 subAssign( ~lhs, rhs.dv_ );
600 template<
typename VT2 >
607 subAssign( ~lhs, rhs.dv_ );
625 template<
typename VT2 >
632 multAssign( ~lhs, rhs.dv_ );
650 template<
typename VT2 >
657 multAssign( ~lhs, rhs.dv_ );
675 template<
typename VT2 >
682 divAssign( ~lhs, rhs.dv_ );
700 template<
typename VT2 >
707 divAssign( ~lhs, rhs.dv_ );
747 template<
typename VT
754 return ReturnType( ~dv );
778 template<
typename VT
780 inline decltype(
auto)
serial( const DVecSerialExpr<VT,TF>& dv )
798 template<
typename VT,
bool TF >
799 struct IsAligned< DVecSerialExpr<VT,TF> >
800 :
public IsAligned<VT>
Expression object for the forced serial evaluation of dense vectors.The DVecSerialExpr class represen...
Definition: DVecSerialExpr.h:76
Header file for auxiliary alias declarations.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecSerialExpr.h:120
If_t< IsExpression_v< VT >, const VT, const VT & > Operand
Composite data type of the dense vector expression.
Definition: DVecSerialExpr.h:93
Header file for basic type definitions.
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias template for the If class template.The If_t alias template provides a convenient shor...
Definition: If.h:109
ResultType_t< VT > ResultType
Result type for expression template evaluations.
Definition: DVecSerialExpr.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 simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DVecSerialExpr.h:98
Base class for all vector serial evaluation expression templates.The VecSerialExpr class serves as a ...
Definition: VecSerialExpr.h:67
Header file for the DenseVector base class.
Header file for the Computation base class.
Operand dv_
Dense vector of the serial evaluation expression.
Definition: DVecSerialExpr.h:217
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 operand() const noexcept
Returns the dense vector operand.
Definition: DVecSerialExpr.h:156
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecSerialExpr.h:210
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecSerialExpr.h:178
#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.
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DVecSerialExpr.h:101
Constraint on the data type.
Header file for the exception macros of the math module.
DVecSerialExpr(const VT &dv) noexcept
Constructor for the DVecSerialExpr class.
Definition: DVecSerialExpr.h:109
Header file for the VecSerialExpr base class.
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecSerialExpr.h:200
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.
TransposeType_t< VT > TransposeType
Transpose type for expression template evaluations.
Definition: DVecSerialExpr.h:85
const ResultType CompositeType
Data type for composite expression templates.
Definition: DVecSerialExpr.h:90
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecSerialExpr.h:190
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_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
Header file for all forward declarations for expression class templates.
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
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecSerialExpr.h:146
#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
ElementType_t< VT > ElementType
Resulting element type.
Definition: DVecSerialExpr.h:86
ReturnType_t< VT > ReturnType
Return type for expression template evaluations.
Definition: DVecSerialExpr.h:87
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
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecSerialExpr.h:133
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:146
#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,...
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.
Header file for the function trace functionality.