35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECEVALEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECEVALEXPR_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 {
179 template<
typename T >
180 inline bool canAlias(
const T* alias )
const noexcept {
181 return dv_.canAlias( alias );
191 template<
typename T >
192 inline bool isAliased(
const T* alias )
const noexcept {
193 return dv_.isAliased( alias );
203 return dv_.isAligned();
213 return dv_.canSMPAssign();
234 template<
typename VT2 >
241 assign( ~lhs, rhs.
dv_ );
258 template<
typename VT2 >
265 assign( ~lhs, rhs.
dv_ );
282 template<
typename VT2 >
283 friend inline void addAssign( DenseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
289 addAssign( ~lhs, rhs.dv_ );
306 template<
typename VT2 >
307 friend inline void addAssign( SparseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
313 addAssign( ~lhs, rhs.dv_ );
330 template<
typename VT2 >
331 friend inline void subAssign( DenseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
337 subAssign( ~lhs, rhs.dv_ );
354 template<
typename VT2 >
355 friend inline void subAssign( SparseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
361 subAssign( ~lhs, rhs.dv_ );
378 template<
typename VT2 >
379 friend inline void multAssign( DenseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
385 multAssign( ~lhs, rhs.dv_ );
402 template<
typename VT2 >
403 friend inline void multAssign( SparseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
409 multAssign( ~lhs, rhs.dv_ );
426 template<
typename VT2 >
427 friend inline void divAssign( DenseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
433 divAssign( ~lhs, rhs.dv_ );
450 template<
typename VT2 >
451 friend inline void divAssign( SparseVector<VT2,TF>& lhs,
const DVecEvalExpr& rhs )
457 divAssign( ~lhs, rhs.dv_ );
474 template<
typename VT2 >
498 template<
typename VT2 >
522 template<
typename VT2 >
546 template<
typename VT2 >
570 template<
typename VT2 >
594 template<
typename VT2 >
618 template<
typename VT2 >
642 template<
typename VT2 >
666 template<
typename VT2 >
690 template<
typename VT2 >
737 template<
typename VT
767 template<
typename VT
769 inline const DVecEvalExpr<VT,TF>
eval(
const DVecEvalExpr<VT,TF>& dv )
787 template<
typename VT,
bool TF >
788 struct Size< DVecEvalExpr<VT,TF> > :
public Size<VT>
804 template<
typename VT,
bool TF >
805 struct IsAligned< DVecEvalExpr<VT,TF> >
822 template<
typename VT >
823 struct DVecEvalExprTrait< DVecEvalExpr<VT,false> >
827 using Type = If_< And< IsDenseVector<VT>, IsColumnVector<VT> >
828 , DVecEvalExpr<VT,false>
838 template<
typename VT >
839 struct TDVecEvalExprTrait< DVecEvalExpr<VT,true> >
843 using Type = If_< And< IsDenseVector<VT>, IsRowVector<VT> >
844 , DVecEvalExpr<VT,true>
854 template<
typename VT,
bool TF,
bool AF >
855 struct SubvectorExprTrait< DVecEvalExpr<VT,TF>, AF >
859 using Type = EvalExprTrait_< SubvectorExprTrait_<const VT,AF> >;
const ResultType CompositeType
Data type for composite expression templates.
Definition: DVecEvalExpr.h:102
Header file for auxiliary alias declarations.
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:65
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
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.
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecEvalExpr.h:158
If_< IsExpression< VT >, const VT, const VT & > Operand
Composite data type of the dense vector expression.
Definition: DVecEvalExpr.h:105
Header file for the Computation base class.
Header file for the VecEvalExpr base class.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecEvalExpr.h:180
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
Constraint on the data type.
Operand dv_
Dense vector of the evaluation expression.
Definition: DVecEvalExpr.h:219
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
Expression object for the forced evaluation of dense vectors.The DVecEvalExpr class represents the co...
Definition: DVecEvalExpr.h:89
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecEvalExpr.h:132
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
Header file for the TDVecEvalExprTrait class template.
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Header file for the IsAligned type trait.
Constraint on the data type.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecEvalExpr.h:212
ResultType_< VT > ResultType
Result type for expression template evaluations.
Definition: DVecEvalExpr.h:96
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecEvalExpr.h:145
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecEvalExpr.h:202
Constraint on the data type.
Operand operand() const noexcept
Returns the dense vector operand.
Definition: DVecEvalExpr.h:168
Header file for the exception macros of the math module.
Header file for all forward declarations for expression class templates.
ElementType_< VT > ElementType
Resulting element type.
Definition: DVecEvalExpr.h:98
Header file for run time assertion macros.
Utility type for generic codes.
Header file for the DVecEvalExprTrait class template.
DVecEvalExpr(const VT &dv) noexcept
Constructor for the DVecEvalExpr class.
Definition: DVecEvalExpr.h:121
Header file for the EvalExprTrait class template.
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
const DMatEvalExpr< MT, SO > eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:705
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
Header file for the IsDenseVector type trait.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecEvalExpr.h:192
#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
DVecEvalExpr< VT, TF > This
Type of this DVecEvalExpr instance.
Definition: DVecEvalExpr.h:95
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.
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.
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
ReturnType_< VT > ReturnType
Return type for expression template evaluations.
Definition: DVecEvalExpr.h:99
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
TransposeType_< VT > TransposeType
Transpose type for expression template evaluations.
Definition: DVecEvalExpr.h:97