35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECDVECSUBEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECDVECSUBEXPR_H_
82 template<
typename VT1
125 template<
typename VT >
128 enum { value = useAssign };
269 return (*
left_) - (*right_);
278 inline IntrinsicType
load()
const {
406 enum { vectorizable = VT1::vectorizable && VT2::vectorizable &&
411 enum { smpAssignable = VT1::smpAssignable && VT2::smpAssignable };
446 inline IntrinsicType
load(
size_t index )
const {
450 const IntrinsicType xmm1(
lhs_.load( index ) );
451 const IntrinsicType xmm2(
rhs_.load( index ) );
512 template<
typename T >
525 template<
typename T >
527 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
551 template<
typename VT >
584 template<
typename VT >
596 const ResultType tmp( rhs );
616 template<
typename VT >
617 friend inline typename EnableIf< UseAssign<VT> >::Type
648 template<
typename VT >
649 friend inline typename EnableIf< UseAssign<VT> >::Type
680 template<
typename VT >
681 friend inline typename EnableIf< UseAssign<VT> >::Type
692 const ResultType tmp( rhs );
746 template<
typename T1
749 inline const DVecDVecSubExpr<T1,T2,TF>
754 if( (~lhs).
size() != (~rhs).
size() )
755 throw std::invalid_argument(
"Vector sizes do not match" );
772 template<
typename VT1,
typename VT2,
bool TF >
777 typedef typename SubExprTrait< typename SubvectorExprTrait<const VT1>::Type
778 ,
typename SubvectorExprTrait<const VT2>::Type >::Type Type;
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecDVecSubExpr.h:165
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecDVecSubExpr.h:399
PointerType pointer
Pointer return type.
Definition: DVecDVecSubExpr.h:170
Pointer difference type of the Blaze library.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
ValueType value_type
Type of the underlying elements.
Definition: DVecDVecSubExpr.h:169
Header file for the subtraction trait.
ReferenceType reference
Reference return type.
Definition: DVecDVecSubExpr.h:171
SelectType< IsExpression< VT2 >::value, const VT2, const VT2 & >::Type RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:151
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecDVecSubExpr.h:236
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecDVecSubExpr.h:434
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:196
SelectType< IsExpression< VT1 >::value, const VT1, const VT1 & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:148
Header file for the IsSame and IsStrictlySame type traits.
DVecDVecSubExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the DVecDVecSubExpr class.
Definition: DVecDVecSubExpr.h:420
VT1::ReturnType RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:93
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecSubExpr.h:367
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2375
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:248
VT2::ReturnType RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:94
Header file for the DenseVector base class.
VT1::ElementType ET1
Element type of the left-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:97
Header file for the Computation base class.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:158
Header file for the RequiresEvaluation type trait.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecDVecSubExpr.h:212
DVecDVecSubExpr< VT1, VT2, TF > This
Type of this DVecDVecSubExpr instance.
Definition: DVecDVecSubExpr.h:135
ElementType * PointerType
Pointer return type.
Definition: DVecDVecSubExpr.h:163
Constraint on the data type.
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecDVecSubExpr.h:391
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecDVecSubExpr.h:199
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:250
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecDVecSubExpr.h:139
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecDVecSubExpr.h:268
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecSubExpr.h:333
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecSubExpr.h:344
Header file for the IsTemporary type trait class.
IteratorCategory iterator_category
The iterator category.
Definition: DVecDVecSubExpr.h:168
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecDVecSubExpr.h:355
VT1::CompositeType CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:95
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecDVecSubExpr.h:246
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2379
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecDVecSubExpr.h:161
Iterator over the elements of the dense vector.
Definition: DVecDVecSubExpr.h:157
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecDVecSubExpr.h:138
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecSubExpr.h:300
DifferenceType difference_type
Difference between two iterators.
Definition: DVecDVecSubExpr.h:172
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:179
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
SelectType< useAssign, const ResultType, const DVecDVecSubExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecDVecSubExpr.h:145
Constraint on the data type.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecDVecSubExpr.h:137
#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
Constraint on the data type.
VT2::ElementType ET2
Element type of the right-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:98
Evaluation of the return type of a subtraction expression.Via this type trait it is possible to evalu...
Definition: SubExprTrait.h:103
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecDVecSubExpr.h:398
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2373
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecDVecSubExpr.h:379
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:269
Header file for the VecVecSubExpr base class.
Header file for the SelectType class template.
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecDVecSubExpr.h:471
Header file for all forward declarations for expression class templates.
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecDVecSubExpr.h:461
ElementType ValueType
Type of the underlying elements.
Definition: DVecDVecSubExpr.h:162
Header file for the EnableIf class template.
ConstIterator(LeftIteratorType left, RightIteratorType right)
Constructor for the ConstIterator class.
Definition: DVecDVecSubExpr.h:187
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecSubExpr.h:311
VT1::ConstIterator LeftIteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:175
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2374
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:648
Header file for run time assertion macros.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecDVecSubExpr.h:142
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:209
const DenseIterator< Type > operator-(const DenseIterator< Type > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:585
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
ElementType & ReferenceType
Reference return type.
Definition: DVecDVecSubExpr.h:164
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecDVecSubExpr.h:526
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecSubExpr.h:224
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:239
SubTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: DVecDVecSubExpr.h:136
VT2::ConstIterator RightIteratorType
ConstIterator type of the right-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:178
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecDVecSubExpr.h:289
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecDVecSubExpr.h:278
RightOperand rhs_
Right-hand side dense vector of the subtraction expression.
Definition: DVecDVecSubExpr.h:534
SubExprTrait< RN1, RN2 >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecDVecSubExpr.h:111
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
VT2::CompositeType CT2
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:96
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecSubExpr.h:513
Header file for the IsComputation type trait class.
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecDVecSubExpr.h:491
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:105
#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:2370
VT2::ResultType RT2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:92
Header file for basic type definitions.
IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecDVecSubExpr.h:446
Header file for the SubvectorExprTrait class template.
Base template for the SubTrait class.
Definition: SubTrait.h:141
VT1::ResultType RT1
Result type of the left-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:91
RightOperand rightOperand() const
Returns the right-hand side dense vector operand.
Definition: DVecDVecSubExpr.h:501
Base class for all vector/vector subtraction expression templates.The VecVecSubExpr class serves as a...
Definition: VecVecSubExpr.h:65
LeftOperand lhs_
Left-hand side dense vector of the subtraction expression.
Definition: DVecDVecSubExpr.h:533
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecSubExpr.h:258
Header file for the SubExprTrait class template.
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecDVecSubExpr.h:481
Expression object for dense vector-dense vector subtractions.The DVecDVecSubExpr class represents the...
Definition: DVecDVecSubExpr.h:85
#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
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecSubExpr.h:322
#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.