35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECABSEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECABSEXPR_H_
125 template<
typename VT2 >
128 enum { value = useAssign };
141 template<
typename VT2 >
142 struct UseSMPAssign {
143 enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
282 inline IntrinsicType
load()
const {
283 return abs( it_.load() );
294 return it_ == rhs.
it_;
305 return it_ != rhs.
it_;
316 return it_ < rhs.
it_;
327 return it_ > rhs.
it_;
338 return it_ <= rhs.
it_;
349 return it_ >= rhs.
it_;
360 return it_ - rhs.
it_;
409 enum { vectorizable = VT::vectorizable &&
413 enum { smpAssignable = VT::smpAssignable };
449 return abs(
dv_.load( index ) );
499 template<
typename T >
511 template<
typename T >
513 return dv_.isAliased( alias );
523 return dv_.isAligned();
533 return dv_.canSMPAssign();
556 template<
typename VT2 >
584 template<
typename VT2 >
596 const ResultType tmp(
serial( rhs ) );
616 template<
typename VT2 >
617 friend inline typename EnableIf< UseAssign<VT2> >::Type
628 const ResultType tmp(
serial( rhs ) );
652 template<
typename VT2 >
653 friend inline typename EnableIf< UseAssign<VT2> >::Type
664 const ResultType tmp(
serial( rhs ) );
688 template<
typename VT2 >
689 friend inline typename EnableIf< UseAssign<VT2> >::Type
700 const ResultType tmp(
serial( rhs ) );
724 template<
typename VT2 >
725 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
752 template<
typename VT2 >
753 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
764 const ResultType tmp( rhs );
784 template<
typename VT2 >
785 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
796 const ResultType tmp( rhs );
820 template<
typename VT2 >
821 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
832 const ResultType tmp( rhs );
856 template<
typename VT2 >
857 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
868 const ResultType tmp( rhs );
913 template<
typename VT
943 template<
typename VT
945 inline const DVecAbsExpr<VT,TF>&
abs(
const DVecAbsExpr<VT,TF>& dv )
965 template<
typename VT,
bool TF >
983 template<
typename VT >
988 typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value
989 , DVecAbsExpr<VT,false>
990 , INVALID_TYPE >::Type Type;
999 template<
typename VT >
1004 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value
1005 , DVecAbsExpr<VT,true>
1006 , INVALID_TYPE >::Type Type;
1015 template<
typename VT,
bool TF,
bool AF >
1016 struct SubvectorExprTrait<
DVecAbsExpr<VT,TF>, AF >
1020 typedef typename AbsExprTrait< typename SubvectorExprTrait<const VT,AF>::Type >::Type Type;
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecAbsExpr.h:458
Pointer difference type of the Blaze library.
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecAbsExpr.h:445
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
DVecAbsExpr(const VT &dv)
Constructor for the DVecAbsExpr class.
Definition: DVecAbsExpr.h:421
BLAZE_ALWAYS_INLINE void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:879
VT::ResultType ResultType
Result type for expression template evaluations.
Definition: DVecAbsExpr.h:151
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:264
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:209
Header file for the IsRowVector type trait.
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecAbsExpr.h:383
Header file for the DenseVector base class.
const DMatAbsExpr< MT, SO > abs(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the absolute values of each single element of dm.
Definition: DMatAbsExpr.h:914
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecAbsExpr.h:371
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecAbsExpr.h:432
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecAbsExpr.h:173
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:699
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecAbsExpr.h:500
Header file for the Computation base class.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecAbsExpr.h:261
Expression object for the dense vector abs() function.The DVecAbsExpr class represents the compile ti...
Definition: DVecAbsExpr.h:91
Header file for the RequiresEvaluation type trait.
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecAbsExpr.h:468
Header file for the TDVecAbsExprTrait class template.
Constraint on the data type.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:293
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:263
DifferenceType difference_type
Difference between two iterators.
Definition: DVecAbsExpr.h:184
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecAbsExpr.h:478
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the IsTemporary type trait class.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecAbsExpr.h:395
IteratorType it_
Iterator to the current vector element.
Definition: DVecAbsExpr.h:402
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
BLAZE_ALWAYS_INLINE void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:635
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:315
Header file for the DVecAbsExprTrait class template.
SelectType< useAssign, const ResultType, const DVecAbsExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecAbsExpr.h:160
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 VecAbsExpr base class.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:78
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecAbsExpr.h:282
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2504
Constraint on the data type.
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type Operand
Composite data type of the dense vector expression.
Definition: DVecAbsExpr.h:163
Base class for all vector absolute value expression templates.The VecAbsExpr class serves as a tag fo...
Definition: VecAbsExpr.h:65
IteratorCategory iterator_category
The iterator category.
Definition: DVecAbsExpr.h:180
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2505
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
Header file for the EnableIf class template.
Header file for the serial shim.
Operand dv_
Dense vector of the absolute value expression.
Definition: DVecAbsExpr.h:539
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:348
ReferenceType reference
Reference return type.
Definition: DVecAbsExpr.h:183
ElementType * PointerType
Pointer return type.
Definition: DVecAbsExpr.h:175
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:2506
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:749
IntrinsicTrait< ET >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecAbsExpr.h:154
Header file for run time assertion macros.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecAbsExpr.h:218
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
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecAbsExpr.h:206
Utility type for generic codes.
BLAZE_ALWAYS_INLINE void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:742
DVecAbsExpr< VT, TF > This
Type of this DVecAbsExpr instance.
Definition: DVecAbsExpr.h:150
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecAbsExpr.h:532
VT::ElementType ElementType
Resulting element type.
Definition: DVecAbsExpr.h:153
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecAbsExpr.h:512
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:326
ValueType value_type
Type of the underlying elements.
Definition: DVecAbsExpr.h:181
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:304
ElementType ValueType
Type of the underlying elements.
Definition: DVecAbsExpr.h:174
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecAbsExpr.h:229
VT::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecAbsExpr.h:152
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: DVecAbsExpr.h:195
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecAbsExpr.h:271
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecAbsExpr.h:522
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecAbsExpr.h:177
Header file for the IsDenseVector type trait.
Header file for all intrinsic functionality.
#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
PointerType pointer
Pointer return type.
Definition: DVecAbsExpr.h:182
Iterator over the elements of the dense vector.
Definition: DVecAbsExpr.h:169
Header file for the IsComputation type trait class.
Operand operand() const
Returns the dense vector operand.
Definition: DVecAbsExpr.h:488
AbsExprTrait< RN >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecAbsExpr.h:111
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
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecAbsExpr.h:359
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecAbsExpr.h:240
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
#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:2502
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecAbsExpr.h:157
Header file for the SubvectorExprTrait class template.
ElementType & ReferenceType
Reference return type.
Definition: DVecAbsExpr.h:176
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecAbsExpr.h:250
Header file for the AbsExprTrait class template.
Header file for the IsColumnVector type trait.
Evaluation of the return type of an absolute value expression.Via this type trait it is possible to e...
Definition: AbsExprTrait.h:87
VT::ConstIterator IteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecAbsExpr.h:187
const DVecAbsExpr< VT, TF > abs(const DenseVector< VT, TF > &dv)
Returns a vector containing the absolute values of each single element of dv.
Definition: DVecAbsExpr.h:915
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecAbsExpr.h:337
VT::ReturnType RN
Return type of the dense vector expression.
Definition: DVecAbsExpr.h:97
System settings for the inline keywords.
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:238
#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
VT::ElementType ET
Element type of the dense vector expression.
Definition: DVecAbsExpr.h:98
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
BLAZE_ALWAYS_INLINE void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:849