35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECSERIALEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECSERIALEXPR_H_
110 enum :
bool { simdEnabled =
false };
113 enum :
bool { smpAssignable = VT::smpAssignable };
145 inline ReturnType
at(
size_t index )
const {
146 if( index >=
dv_.size() ) {
149 return (*
this)[index];
158 inline size_t size() const noexcept {
189 template<
typename T >
190 inline bool canAlias(
const T* alias )
const noexcept {
191 return dv_.canAlias( alias );
201 template<
typename T >
202 inline bool isAliased(
const T* alias )
const noexcept {
203 return dv_.isAliased( alias );
213 return dv_.isAligned();
223 return dv_.canSMPAssign();
244 template<
typename VT2 >
251 assign( ~lhs, rhs.
dv_ );
268 template<
typename VT2 >
275 assign( ~lhs, rhs.
dv_ );
292 template<
typename VT2 >
293 friend inline void addAssign( DenseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
299 addAssign( ~lhs, rhs.dv_ );
316 template<
typename VT2 >
317 friend inline void addAssign( SparseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
323 addAssign( ~lhs, rhs.dv_ );
341 template<
typename VT2 >
342 friend inline void subAssign( DenseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
348 subAssign( ~lhs, rhs.dv_ );
366 template<
typename VT2 >
367 friend inline void subAssign( SparseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
373 subAssign( ~lhs, rhs.dv_ );
391 template<
typename VT2 >
392 friend inline void multAssign( DenseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
398 multAssign( ~lhs, rhs.dv_ );
416 template<
typename VT2 >
417 friend inline void multAssign( SparseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
423 multAssign( ~lhs, rhs.dv_ );
440 template<
typename VT2 >
441 friend inline void divAssign( DenseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
447 divAssign( ~lhs, rhs.dv_ );
464 template<
typename VT2 >
465 friend inline void divAssign( SparseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
471 divAssign( ~lhs, rhs.dv_ );
488 template<
typename VT2 >
495 assign( ~lhs, rhs.dv_ );
512 template<
typename VT2 >
519 assign( ~lhs, rhs.dv_ );
537 template<
typename VT2 >
544 addAssign( ~lhs, rhs.dv_ );
562 template<
typename VT2 >
569 addAssign( ~lhs, rhs.dv_ );
587 template<
typename VT2 >
594 subAssign( ~lhs, rhs.dv_ );
612 template<
typename VT2 >
619 subAssign( ~lhs, rhs.dv_ );
637 template<
typename VT2 >
644 multAssign( ~lhs, rhs.dv_ );
662 template<
typename VT2 >
669 multAssign( ~lhs, rhs.dv_ );
687 template<
typename VT2 >
694 divAssign( ~lhs, rhs.dv_ );
712 template<
typename VT2 >
719 divAssign( ~lhs, rhs.dv_ );
759 template<
typename VT
789 template<
typename VT
791 inline const DVecSerialExpr<VT,TF>
serial(
const DVecSerialExpr<VT,TF>& dv )
809 template<
typename VT,
bool TF >
810 struct Size< DVecSerialExpr<VT,TF> > :
public Size<VT>
826 template<
typename VT,
bool TF >
827 struct IsAligned< DVecSerialExpr<VT,TF> >
844 template<
typename VT >
845 struct DVecSerialExprTrait< DVecSerialExpr<VT,false> >
849 using Type = If_< And< IsDenseVector<VT>, IsColumnVector<VT> >
850 , DVecSerialExpr<VT,false>
860 template<
typename VT >
861 struct TDVecSerialExprTrait< DVecSerialExpr<VT,true> >
865 using Type = If_< And< IsDenseVector<VT>, IsRowVector<VT> >
866 , DVecSerialExpr<VT,true>
876 template<
typename VT,
bool TF,
bool AF >
877 struct SubvectorExprTrait< DVecSerialExpr<VT,TF>, AF >
881 using Type = SerialExprTrait_< SubvectorExprTrait_<const VT,AF> >;
Expression object for the forced serial evaluation of dense vectors.The DVecSerialExpr class represen...
Definition: DVecSerialExpr.h:89
Header file for the TDVecSerialExprTrait class template.
ElementType_< VT > ElementType
Resulting element type.
Definition: DVecSerialExpr.h:98
Header file for auxiliary alias declarations.
Header file for basic type definitions.
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:160
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecSerialExpr.h:190
TransposeType_< VT > TransposeType
Transpose type for expression template evaluations.
Definition: DVecSerialExpr.h:97
Operand operand() const noexcept
Returns the dense vector operand.
Definition: DVecSerialExpr.h:168
const ResultType CompositeType
Data type for composite expression templates.
Definition: DVecSerialExpr.h:102
Base class for all vector serial evaluation expression templates.The VecSerialExpr class serves as a ...
Definition: VecSerialExpr.h:65
Header file for the IsRowVector type trait.
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 And class template.
Header file for the DenseVector base class.
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
Header file for the Computation base class.
Operand dv_
Dense vector of the serial evaluation expression.
Definition: DVecSerialExpr.h:229
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
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:129
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecSerialExpr.h:222
Constraint on the data type.
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
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:98
#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
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
ResultType_< VT > ResultType
Result type for expression template evaluations.
Definition: DVecSerialExpr.h:96
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecSerialExpr.h:145
Header file for the IsAligned type trait.
Header file for the SerialExprTrait class template.
Constraint on the data type.
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecSerialExpr.h:212
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecSerialExpr.h:158
Constraint on the data type.
Header file for the exception macros of the math module.
Header file for all forward declarations for expression class templates.
DVecSerialExpr(const VT &dv) noexcept
Constructor for the DVecSerialExpr class.
Definition: DVecSerialExpr.h:121
Header file for the VecSerialExpr base class.
Header file for run time assertion macros.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecSerialExpr.h:202
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:160
EnableIf_< IsDenseVector< VT1 > > smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:222
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
If_< IsExpression< VT >, const VT, const VT & > Operand
Composite data type of the dense vector expression.
Definition: DVecSerialExpr.h:105
Header file for the IsDenseVector type trait.
#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
Header file for the DVecSerialExprTrait class template.
ReturnType_< VT > ReturnType
Return type for expression template evaluations.
Definition: DVecSerialExpr.h:99
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:110
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
Header file for the IntegralConstant class template.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecSerialExpr.h:132
Header file for the SubvectorExprTrait class template.
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
Header file for the IsColumnVector type trait.
DVecSerialExpr< VT, TF > This
Type of this DVecSerialExpr instance.
Definition: DVecSerialExpr.h:95
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 FunctionTrace class.