35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECDVECDIVEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_DVECDVECDIVEXPR_H_ 92 template<
typename VT1
96 :
public VecVecDivExpr< DenseVector< DVecDVecDivExpr<VT1,VT2,TF>, TF > >
135 template<
typename VT >
138 enum :
bool { value = useAssign };
151 template<
typename VT >
152 struct UseSMPAssign {
153 enum :
bool { value = ( !VT1::smpAssignable || !VT2::smpAssignable ) && useAssign };
293 return (*left_) / (*right_);
302 inline auto load() const noexcept {
303 return left_.load() / right_.load();
314 return left_ == rhs.
left_;
325 return left_ != rhs.
left_;
336 return left_ < rhs.
left_;
347 return left_ > rhs.
left_;
358 return left_ <= rhs.
left_;
369 return left_ >= rhs.
left_;
380 return left_ - rhs.
left_;
430 enum :
bool { simdEnabled = VT1::simdEnabled && VT2::simdEnabled &&
434 enum :
bool { smpAssignable = VT1::smpAssignable && VT2::smpAssignable };
476 if( index >=
lhs_.size() ) {
479 return (*
this)[index];
492 return lhs_.load( index ) /
rhs_.load( index );
521 inline size_t size() const noexcept {
552 template<
typename T >
553 inline bool canAlias(
const T* alias )
const noexcept {
565 template<
typename T >
566 inline bool isAliased(
const T* alias )
const noexcept {
567 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
577 return lhs_.isAligned() &&
rhs_.isAligned();
587 return lhs_.canSMPAssign() ||
rhs_.canSMPAssign() ||
588 (
size() > SMP_DVECDVECDIV_THRESHOLD );
612 template<
typename VT >
621 divAssign( ~lhs, rhs.
rhs_ );
624 assign ( ~lhs, rhs.
lhs_ );
625 divAssign( ~lhs, rhs.
rhs_ );
649 template<
typename VT >
681 template<
typename VT >
694 addAssign( ~lhs, tmp );
717 template<
typename VT >
730 subAssign( ~lhs, tmp );
753 template<
typename VT >
766 multAssign( ~lhs, tmp );
789 template<
typename VT >
802 divAssign( ~lhs, tmp );
825 template<
typename VT >
862 template<
typename VT >
894 template<
typename VT >
930 template<
typename VT >
966 template<
typename VT >
1002 template<
typename VT >
1070 template<
typename VT1
1073 inline decltype(
auto)
1078 if( (~lhs).
size() != (~rhs).
size() ) {
1098 template<
typename VT1,
typename VT2,
bool TF >
1099 struct Size< DVecDVecDivExpr<VT1,VT2,TF>, 0UL >
1100 :
public Maximum< Size<VT1,0UL>, Size<VT2,0UL> >
1116 template<
typename VT1,
typename VT2,
bool TF >
1117 struct IsAligned< DVecDVecDivExpr<VT1,VT2,TF> >
1118 :
public And< IsAligned<VT1>, IsAligned<VT2> >
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Pointer difference type of the Blaze library.
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:346
Header file for auxiliary alias declarations.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:71
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:69
Header file for the VecVecDivExpr base class.
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecDVecDivExpr.h:379
BLAZE_ALWAYS_INLINE bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b) noexcept
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:949
Header file for basic type definitions.
ElementType & ReferenceType
Reference return type.
Definition: DVecDVecDivExpr.h:188
IteratorCategory iterator_category
The iterator category.
Definition: DVecDVecDivExpr.h:192
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:164
Header file for the serial shim.
Header file for the IsSame and IsStrictlySame type traits.
CompositeType_< VT2 > CT2
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:106
ResultType_< VT1 > RT1
Result type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:101
IfTrue_< useAssign, const ResultType, const DVecDVecDivExpr &> CompositeType
Data type for composite expression templates.
Definition: DVecDVecDivExpr.h:169
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:335
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecDVecDivExpr.h:501
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
Iterator over the elements of the dense vector.
Definition: DVecDVecDivExpr.h:181
Header file for the And class template.
Compile time value evaluation.The Maximum alias declaration selects the larger of the two given templ...
Definition: Maximum.h:73
Header file for the DenseVector base class.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:313
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 constant is set to true, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to false, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:140
RightOperand rhs_
Right-hand side dense vector of the division expression.
Definition: DVecDVecDivExpr.h:595
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecDVecDivExpr.h:423
Constraint on the data type.
Header file for the RequiresEvaluation type trait.
ReferenceType reference
Reference return type.
Definition: DVecDVecDivExpr.h:195
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
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:133
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:368
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DVecDVecDivExpr.h:163
ReturnType_< VT1 > RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:103
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecDVecDivExpr.h:462
If_< IsExpression< VT2 >, const VT2, const VT2 &> RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:175
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecDVecDivExpr.h:185
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecDVecDivExpr.h:521
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecDVecDivExpr.h:162
Header file for the DivExprTrait class template.
DivExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: DVecDVecDivExpr.h:121
Expression object for dense vector-dense vector divisions.The DVecDVecDivExpr class represents the co...
Definition: DVecDVecDivExpr.h:95
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:357
ReturnType_< VT2 > RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:104
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
Header file for the Maximum class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:71
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecDVecDivExpr.h:270
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecDVecDivExpr.h:260
Header file for the IsTemporary type trait class.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecDivExpr.h:282
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the If class template.
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecDVecDivExpr.h:422
ElementType * PointerType
Pointer return type.
Definition: DVecDVecDivExpr.h:187
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:102
ResultType_< VT2 > RT2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:102
#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
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecDVecDivExpr.h:531
Base class for all vector/vector division expression templates.The VecVecDivExpr class serves as a ta...
Definition: VecVecDivExpr.h:66
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecDivExpr.h:391
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Header file for all SIMD functionality.
PointerType pointer
Pointer return type.
Definition: DVecDVecDivExpr.h:194
Availability of a SIMD division for the given data types.Depending on the available instruction set (...
Definition: HasSIMDDiv.h:150
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
Header file for the IsAligned type trait.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecDVecDivExpr.h:236
Constraint on the data type.
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecDVecDivExpr.h:576
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecDVecDivExpr.h:566
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:324
CompositeType_< VT1 > CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:105
Constraint on the data type.
Header file for the exception macros of the math module.
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DVecDVecDivExpr.h:166
If_< IsExpression< VT1 >, const VT1, const VT1 &> LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:172
Constraint on the data type.
Header file for all forward declarations for expression class templates.
ElementType_< VT1 > ET1
Element type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:107
Header file for the EnableIf class template.
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition: DVecDVecDivExpr.h:302
typename DivTrait< T1, T2 >::Type DivTrait_
Auxiliary alias declaration for the DivTrait class template.The DivTrait_ alias declaration provides ...
Definition: DivTrait.h:292
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecDVecDivExpr.h:415
Header file for run time assertion macros.
ValueType value_type
Type of the underlying elements.
Definition: DVecDVecDivExpr.h:193
Header file for the division trait.
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecDVecDivExpr.h:403
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:154
ConstIterator_< VT1 > LeftIteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:199
DivTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: DVecDVecDivExpr.h:161
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
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecDVecDivExpr.h:223
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecDivExpr.h:248
ElementType_< VT2 > ET2
Element type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:108
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecDVecDivExpr.h:475
BLAZE_ALWAYS_INLINE auto load(size_t index) const noexcept
Access to the SIMD elements of the vector.
Definition: DVecDVecDivExpr.h:489
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecDVecDivExpr.h:586
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
#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
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecDVecDivExpr.h:511
LeftOperand lhs_
Left-hand side dense vector of the division expression.
Definition: DVecDVecDivExpr.h:594
Header file for the HasSIMDDiv type trait.
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_VECVECDIVEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid vector/vector ...
Definition: VecVecDivExpr.h:108
Header file for the IsComputation type trait class.
typename DivExprTrait< T1, T2 >::Type DivExprTrait_
Auxiliary alias declaration for the DivExprTrait class template.The DivExprTrait_ alias declaration p...
Definition: DivExprTrait.h:112
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
ConstIterator_< VT2 > RightIteratorType
ConstIterator type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:202
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
ConstIterator(LeftIteratorType left, RightIteratorType right)
Constructor for the ConstIterator class.
Definition: DVecDVecDivExpr.h:211
Compile time logical 'and' evaluation.The And alias declaration performs at compile time a logical 'a...
Definition: And.h:76
ElementType ValueType
Type of the underlying elements.
Definition: DVecDVecDivExpr.h:186
RightOperand rightOperand() const noexcept
Returns the right-hand side dense vector operand.
Definition: DVecDVecDivExpr.h:541
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
DVecDVecDivExpr(const VT1 &lhs, const VT2 &rhs) noexcept
Constructor for the DVecDVecDivExpr class.
Definition: DVecDVecDivExpr.h:448
System settings for the inline keywords.
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
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#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
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:95
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecDivExpr.h:553
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecDVecDivExpr.h:292