35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECDVECDIVEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECDVECDIVEXPR_H_
94 template<
typename VT1
137 template<
typename VT >
140 enum :
bool { value = useAssign };
153 template<
typename VT >
154 struct UseSMPAssign {
155 enum :
bool { value = ( !VT1::smpAssignable || !VT2::smpAssignable ) && useAssign };
213 explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right )
295 return (*left_) / (*right_);
304 inline auto load() const noexcept {
305 return left_.load() / right_.load();
316 return left_ == rhs.
left_;
327 return left_ != rhs.
left_;
338 return left_ < rhs.
left_;
349 return left_ > rhs.
left_;
360 return left_ <= rhs.
left_;
371 return left_ >= rhs.
left_;
382 return left_ - rhs.
left_;
432 enum :
bool { simdEnabled = VT1::simdEnabled && VT2::simdEnabled &&
436 enum :
bool { smpAssignable = VT1::smpAssignable && VT2::smpAssignable };
477 inline ReturnType
at(
size_t index )
const {
478 if( index >=
lhs_.size() ) {
481 return (*
this)[index];
494 return lhs_.load( index ) /
rhs_.load( index );
523 inline size_t size() const noexcept {
554 template<
typename T >
555 inline bool canAlias(
const T* alias )
const noexcept {
567 template<
typename T >
568 inline bool isAliased(
const T* alias )
const noexcept {
569 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
579 return lhs_.isAligned() &&
rhs_.isAligned();
589 return lhs_.canSMPAssign() ||
rhs_.canSMPAssign() ||
590 (
size() > SMP_DVECDVECDIV_THRESHOLD );
614 template<
typename VT >
623 divAssign( ~lhs, rhs.
rhs_ );
627 assign ( ~lhs, rhs.
lhs_ );
628 divAssign( ~lhs, rhs.
rhs_ );
631 const ResultType tmp(
serial( rhs ) );
652 template<
typename VT >
664 const ResultType tmp(
serial( rhs ) );
684 template<
typename VT >
685 friend inline EnableIf_< UseAssign<VT> >
696 const ResultType tmp(
serial( rhs ) );
697 addAssign( ~lhs, tmp );
720 template<
typename VT >
721 friend inline EnableIf_< UseAssign<VT> >
732 const ResultType tmp(
serial( rhs ) );
733 subAssign( ~lhs, tmp );
756 template<
typename VT >
757 friend inline EnableIf_< UseAssign<VT> >
768 const ResultType tmp(
serial( rhs ) );
769 multAssign( ~lhs, tmp );
792 template<
typename VT >
793 friend inline EnableIf_< UseAssign<VT> >
804 const ResultType tmp(
serial( rhs ) );
805 divAssign( ~lhs, tmp );
828 template<
typename VT >
829 friend inline EnableIf_< UseSMPAssign<VT> >
836 if( !IsComputation<VT1>::value &&
isSame( ~lhs, rhs.lhs_ ) ) {
839 else if( IsSame<VT,ResultType>::value ||
840 IsSame< ElementType_<VT>, ElementType_<VT1> >::value ) {
845 const ResultType tmp( rhs );
866 template<
typename VT >
867 friend inline EnableIf_< UseSMPAssign<VT> >
878 const ResultType tmp( rhs );
898 template<
typename VT >
899 friend inline EnableIf_< UseSMPAssign<VT> >
910 const ResultType tmp( rhs );
934 template<
typename VT >
935 friend inline EnableIf_< UseSMPAssign<VT> >
946 const ResultType tmp( rhs );
970 template<
typename VT >
971 friend inline EnableIf_< UseSMPAssign<VT> >
982 const ResultType tmp( rhs );
1006 template<
typename VT >
1007 friend inline EnableIf_< UseSMPAssign<VT> >
1018 const ResultType tmp( rhs );
1074 template<
typename T1
1077 inline const DVecDVecDivExpr<T1,T2,TF>
1082 if( (~lhs).
size() != (~rhs).
size() ) {
1101 template<
typename VT1,
typename VT2,
bool TF >
1103 :
public Max< Size<VT1>, Size<VT2> >
1119 template<
typename VT1,
typename VT2,
bool TF >
1121 :
public BoolConstant< And< IsAligned<VT1>, IsAligned<VT2> >::value >
1137 template<
typename VT1,
typename VT2,
bool TF,
bool AF >
1142 using Type = DivExprTrait_< SubvectorExprTrait_<const VT1,AF>
1143 , SubvectorExprTrait_<const VT2,AF> >;
#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.
Header file for auxiliary alias declarations.
Header file for the Max class template.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:72
DVecDVecDivExpr< VT1, VT2, TF > This
Type of this DVecDVecDivExpr instance.
Definition: DVecDVecDivExpr.h:162
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:70
Header file for the VecVecDivExpr base class.
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecDVecDivExpr.h:513
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:653
Header file for basic type definitions.
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 serial shim.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
Header file for the IsSame and IsStrictlySame type traits.
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:183
If_< IsExpression< VT2 >, const VT2, const VT2 & > RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:177
Header file for the And class template.
Header file for the DenseVector base class.
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecDVecDivExpr.h:533
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
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:138
RightOperand rhs_
Right-hand side dense vector of the division expression.
Definition: DVecDVecDivExpr.h:597
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecDVecDivExpr.h:425
Constraint on the data type.
Header file for the RequiresEvaluation type trait.
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecDVecDivExpr.h:578
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecDVecDivExpr.h:191
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
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecDVecDivExpr.h:568
CompositeType_< VT2 > CT2
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:108
IteratorCategory iterator_category
The iterator category.
Definition: DVecDVecDivExpr.h:194
Constraint on the data type.
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
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
Header file for the DivExprTrait class template.
Expression object for dense vector-dense vector divisions.The DVecDVecDivExpr class represents the co...
Definition: DVecDVecDivExpr.h:97
ResultType_< VT2 > RT2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:104
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:337
IfTrue_< useAssign, const ResultType, const DVecDVecDivExpr & > CompositeType
Data type for composite expression templates.
Definition: DVecDVecDivExpr.h:171
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
ConstIterator_< VT1 > LeftIteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:201
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecDivExpr.h:555
const EnableIf_< IsNumeric< T2 >, DivExprTrait_< T1, T2 > > operator/(const DenseMatrix< T1, SO > &mat, T2 scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:966
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecDVecDivExpr.h:272
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecDVecDivExpr.h:262
Header file for the IsTemporary type trait class.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecDivExpr.h:284
ElementType_< VT2 > ET2
Element type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:110
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
Header file for the If class template.
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:348
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecDVecDivExpr.h:424
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecDVecDivExpr.h:588
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
DivTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: DVecDVecDivExpr.h:163
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
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:370
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecDVecDivExpr.h:294
ValueType value_type
Type of the underlying elements.
Definition: DVecDVecDivExpr.h:195
#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
Base class for all vector/vector division expression templates.The VecVecDivExpr class serves as a ta...
Definition: VecVecDivExpr.h:65
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecDivExpr.h:393
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.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecDVecDivExpr.h:464
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:326
Availability of a SIMD division for the given data types.Depending on the available instruction set (...
Definition: HasSIMDDiv.h:144
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.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecDVecDivExpr.h:238
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:60
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:359
DivExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: DVecDVecDivExpr.h:123
ElementType * PointerType
Pointer return type.
Definition: DVecDVecDivExpr.h:189
BLAZE_ALWAYS_INLINE auto load(size_t index) const noexcept
Access to the SIMD elements of the vector.
Definition: DVecDVecDivExpr.h:491
Constraint on the data type.
ConstIterator_< VT2 > RightIteratorType
ConstIterator type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:204
Header file for the exception macros of the math module.
ElementType ValueType
Type of the underlying elements.
Definition: DVecDVecDivExpr.h:188
Header file for all forward declarations for expression class templates.
Header file for the EnableIf class template.
If_< IsExpression< VT1 >, const VT1, const VT1 & > LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:174
DifferenceType difference_type
Difference between two iterators.
Definition: DVecDVecDivExpr.h:198
typename DivTrait< T1, T2 >::Type DivTrait_
Auxiliary alias declaration for the DivTrait class template.The DivTrait_ alias declaration provides ...
Definition: DivTrait.h:245
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecDVecDivExpr.h:503
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecDVecDivExpr.h:477
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecDVecDivExpr.h:417
Header file for run time assertion macros.
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecDVecDivExpr.h:381
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:405
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
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition: DVecDVecDivExpr.h:304
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:225
ReferenceType reference
Reference return type.
Definition: DVecDVecDivExpr.h:197
ResultType_< VT1 > RT1
Result type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:103
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecDivExpr.h:250
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecDVecDivExpr.h:187
CompositeType_< VT1 > CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:107
ElementType_< VT1 > ET1
Element type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:109
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecDVecDivExpr.h:164
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
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecDVecDivExpr.h:315
LeftOperand lhs_
Left-hand side dense vector of the division expression.
Definition: DVecDVecDivExpr.h:596
ReturnType_< VT2 > RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:106
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:109
RightOperand rightOperand() const noexcept
Returns the right-hand side dense vector operand.
Definition: DVecDVecDivExpr.h:543
Header file for the IsComputation type trait class.
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecDVecDivExpr.h:523
typename DivExprTrait< T1, T2 >::Type DivExprTrait_
Auxiliary alias declaration for the DivExprTrait class template.The DivExprTrait_ alias declaration p...
Definition: DivExprTrait.h:196
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
ElementType & ReferenceType
Reference return type.
Definition: DVecDVecDivExpr.h:190
PointerType pointer
Pointer return type.
Definition: DVecDVecDivExpr.h:196
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.
ConstIterator(LeftIteratorType left, RightIteratorType right)
Constructor for the ConstIterator class.
Definition: DVecDVecDivExpr.h:213
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
DVecDVecDivExpr(const VT1 &lhs, const VT2 &rhs) noexcept
Constructor for the DVecDVecDivExpr class.
Definition: DVecDVecDivExpr.h:450
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DVecDVecDivExpr.h:168
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:71
Header file for the IsExpression type trait class.
ReturnType_< VT1 > RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecDivExpr.h:105
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DVecDVecDivExpr.h:165
Header file for the FunctionTrace class.