35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECSERIALEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECSERIALEXPR_H_
107 enum { vectorizable = 0 };
110 enum { smpAssignable = VT::smpAssignable };
142 inline ReturnType
at(
size_t index )
const {
143 if( index >=
dv_.size() ) {
146 return (*
this)[index];
186 template<
typename T >
188 return dv_.canAlias( alias );
198 template<
typename T >
200 return dv_.isAliased( alias );
210 return dv_.isAligned();
220 return dv_.canSMPAssign();
241 template<
typename VT2 >
248 assign( ~lhs, rhs.
dv_ );
265 template<
typename VT2 >
272 assign( ~lhs, rhs.
dv_ );
289 template<
typename VT2 >
290 friend inline void addAssign( DenseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
296 addAssign( ~lhs, rhs.dv_ );
313 template<
typename VT2 >
314 friend inline void addAssign( SparseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
320 addAssign( ~lhs, rhs.dv_ );
338 template<
typename VT2 >
339 friend inline void subAssign( DenseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
345 subAssign( ~lhs, rhs.dv_ );
363 template<
typename VT2 >
364 friend inline void subAssign( SparseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
370 subAssign( ~lhs, rhs.dv_ );
388 template<
typename VT2 >
389 friend inline void multAssign( DenseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
395 multAssign( ~lhs, rhs.dv_ );
413 template<
typename VT2 >
414 friend inline void multAssign( SparseVector<VT2,TF>& lhs,
const DVecSerialExpr& rhs )
420 multAssign( ~lhs, rhs.dv_ );
437 template<
typename VT2 >
444 assign( ~lhs, rhs.dv_ );
461 template<
typename VT2 >
468 assign( ~lhs, rhs.dv_ );
486 template<
typename VT2 >
493 addAssign( ~lhs, rhs.dv_ );
511 template<
typename VT2 >
518 addAssign( ~lhs, rhs.dv_ );
536 template<
typename VT2 >
543 subAssign( ~lhs, rhs.dv_ );
561 template<
typename VT2 >
568 subAssign( ~lhs, rhs.dv_ );
586 template<
typename VT2 >
593 multAssign( ~lhs, rhs.dv_ );
611 template<
typename VT2 >
618 multAssign( ~lhs, rhs.dv_ );
658 template<
typename VT
688 template<
typename VT
690 inline const DVecSerialExpr<VT,TF>
serial(
const DVecSerialExpr<VT,TF>& dv )
708 template<
typename VT,
bool TF >
709 struct Size< DVecSerialExpr<VT,TF> > :
public Size<VT>
725 template<
typename VT,
bool TF >
726 struct IsAligned< DVecSerialExpr<VT,TF> > :
public IsTrue< IsAligned<VT>::value >
742 template<
typename VT >
743 struct DVecSerialExprTrait< DVecSerialExpr<VT,false> >
747 typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value
748 , DVecSerialExpr<VT,false>
749 , INVALID_TYPE >::Type Type;
758 template<
typename VT >
759 struct TDVecSerialExprTrait< DVecSerialExpr<VT,true> >
763 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value
764 , DVecSerialExpr<VT,true>
765 , INVALID_TYPE >::Type Type;
774 template<
typename VT,
bool TF,
bool AF >
775 struct SubvectorExprTrait< DVecSerialExpr<VT,TF>, AF >
779 typedef typename SerialExprTrait< typename SubvectorExprTrait<const VT,AF>::Type >::Type Type;
Expression object for the forced serial evaluation of dense vectors.The DVecSerialExpr class represen...
Definition: DVecSerialExpr.h:86
VT::ElementType ElementType
Resulting element type.
Definition: DVecSerialExpr.h:95
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type Operand
Composite data type of the dense vector expression.
Definition: DVecSerialExpr.h:102
Header file for the TDVecSerialExprTrait class template.
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecSerialExpr.h:209
Header file for basic type definitions.
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecSerialExpr.h:187
const ResultType CompositeType
Data type for composite expression templates.
Definition: DVecSerialExpr.h:99
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.
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:721
Header file for the Computation base class.
Operand dv_
Dense vector of the serial evaluation expression.
Definition: DVecSerialExpr.h:226
VT::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecSerialExpr.h:94
DVecSerialExpr(const VT &dv)
Constructor for the DVecSerialExpr class.
Definition: DVecSerialExpr.h:118
Constraint on the data type.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecSerialExpr.h:219
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecSerialExpr.h:199
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
VT::ResultType ResultType
Result type for expression template evaluations.
Definition: DVecSerialExpr.h:93
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecSerialExpr.h:155
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:142
Header file for the IsAligned type trait.
Header file for the SerialExprTrait class template.
Constraint on the data type.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2585
Constraint on the data type.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
VT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DVecSerialExpr.h:96
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
Operand operand() const
Returns the dense vector operand.
Definition: DVecSerialExpr.h:165
Header file for the VecSerialExpr base class.
EnableIf< IsDenseMatrix< MT1 > >::Type 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
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2587
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type 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
Utility type for generic codes.
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:79
Header file for the DVecSerialExprTrait class template.
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
EnableIf< IsDenseMatrix< MT1 > >::Type 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
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:118
#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
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecSerialExpr.h:129
Header file for the SubvectorExprTrait class template.
Header file for exception macros.
Header file for the IsColumnVector type trait.
DVecSerialExpr< VT, TF > This
Type of this DVecSerialExpr instance.
Definition: DVecSerialExpr.h:92
EnableIf< IsDenseVector< VT1 > >::Type 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:189
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:81
#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.