35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECDVECMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECDVECMULTEXPR_H_
93 template<
typename VT1
136 template<
typename VT >
139 enum { value = useAssign };
152 template<
typename VT >
153 struct UseSMPAssign {
154 enum { value = ( !VT1::smpAssignable || !VT2::smpAssignable ) && useAssign };
213 explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right )
295 return (*left_) * (*right_);
304 inline IntrinsicType
load()
const {
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 { vectorizable = VT1::vectorizable && VT2::vectorizable &&
437 enum { smpAssignable = VT1::smpAssignable && VT2::smpAssignable };
473 inline ReturnType
at(
size_t index )
const {
474 if( index >=
lhs_.size() ) {
477 return (*
this)[index];
491 const IntrinsicType xmm1(
lhs_.load( index ) );
492 const IntrinsicType xmm2(
rhs_.load( index ) );
553 template<
typename T >
566 template<
typename T >
568 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
578 return lhs_.isAligned() &&
rhs_.isAligned();
588 return lhs_.canSMPAssign() ||
rhs_.canSMPAssign() ||
589 (
size() > SMP_DVECDVECMULT_THRESHOLD );
613 template<
typename VT >
622 multAssign( ~lhs, rhs.
rhs_ );
625 multAssign( ~lhs, rhs.
lhs_ );
628 assign ( ~lhs, rhs.
lhs_ );
629 multAssign( ~lhs, rhs.
rhs_ );
649 template<
typename VT >
661 const ResultType tmp(
serial( rhs ) );
681 template<
typename VT >
682 friend inline typename EnableIf< UseAssign<VT> >::Type
693 const ResultType tmp(
serial( rhs ) );
694 addAssign( ~lhs, tmp );
717 template<
typename VT >
718 friend inline typename EnableIf< UseAssign<VT> >::Type
729 const ResultType tmp(
serial( rhs ) );
730 subAssign( ~lhs, tmp );
753 template<
typename VT >
754 friend inline typename EnableIf< UseAssign<VT> >::Type
761 multAssign( ~lhs, rhs.lhs_ );
762 multAssign( ~lhs, rhs.rhs_ );
781 template<
typename VT >
782 friend inline typename EnableIf< UseAssign<VT> >::Type
789 multAssign( ~lhs, rhs.lhs_ );
790 multAssign( ~lhs, rhs.rhs_ );
809 template<
typename VT >
810 friend inline typename EnableIf< UseSMPAssign<VT> >::Type
817 if( !IsComputation<VT1>::value &&
isSame( ~lhs, rhs.lhs_ ) ) {
820 else if( !IsComputation<VT2>::value &&
isSame( ~lhs, rhs.rhs_ ) ) {
845 template<
typename VT >
846 friend inline typename EnableIf< UseSMPAssign<VT> >::Type
857 const ResultType tmp( rhs );
877 template<
typename VT >
878 friend inline typename EnableIf< UseSMPAssign<VT> >::Type
889 const ResultType tmp( rhs );
914 template<
typename VT >
915 friend inline typename EnableIf< UseSMPAssign<VT> >::Type
926 const ResultType tmp( rhs );
951 template<
typename VT >
952 friend inline typename EnableIf< UseSMPAssign<VT> >::Type
980 template<
typename VT >
981 friend inline typename EnableIf< UseSMPAssign<VT> >::Type
1040 template<
typename T1
1043 inline const DVecDVecMultExpr<T1,T2,TF>
1048 if( (~lhs).
size() != (~rhs).
size() ) {
1067 template<
typename VT1,
typename VT2,
bool TF >
1069 :
public Max< Size<VT1>, Size<VT2> >
1085 template<
typename VT1,
typename VT2,
bool TF >
1087 :
public IsTrue< And< IsAligned<VT1>, IsAligned<VT2> >::value >
1103 template<
typename VT1,
typename VT2,
bool TF >
1105 :
public IsTrue< And< IsPadded<VT1>, IsPadded<VT2> >::value >
1121 template<
typename VT1,
typename VT2,
bool TF,
bool AF >
1126 typedef typename MultExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
1127 ,
typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecDVecMultExpr.h:425
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
Pointer difference type of the Blaze library.
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:89
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecDVecMultExpr.h:165
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7820
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecMultExpr.h:250
ConstIterator(LeftIteratorType left, RightIteratorType right)
Constructor for the ConstIterator class.
Definition: DVecDVecMultExpr.h:213
Header file for basic type definitions.
DifferenceType difference_type
Difference between two iterators.
Definition: DVecDVecMultExpr.h:198
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
Iterator over the elements of the dense vector.
Definition: DVecDVecMultExpr.h:183
ReferenceType reference
Reference return type.
Definition: DVecDVecMultExpr.h:197
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecMultExpr.h:554
LeftOperand lhs_
Left-hand side dense vector of the multiplication expression.
Definition: DVecDVecMultExpr.h:595
VT2::ResultType RT2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:103
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:359
BLAZE_ALWAYS_INLINE bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b)
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:647
VT2::ConstIterator RightIteratorType
ConstIterator type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:204
Header file for the IsSame and IsStrictlySame type traits.
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:337
VT1::ReturnType RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:104
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:259
Header file for the And class template.
Header file for the DenseVector base class.
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecDVecMultExpr.h:424
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.
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
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecDVecMultExpr.h:294
Header file for the RequiresEvaluation type trait.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:326
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecDVecMultExpr.h:381
Constraint on the data type.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecDVecMultExpr.h:191
Header file for the MultExprTrait class template.
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:261
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.
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecDVecMultExpr.h:262
Header file for the multiplication trait.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecDVecMultExpr.h:567
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecDVecMultExpr.h:164
PointerType pointer
Pointer return type.
Definition: DVecDVecMultExpr.h:196
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
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecDVecMultExpr.h:187
RightOperand rightOperand() const
Returns the right-hand side dense vector operand.
Definition: DVecDVecMultExpr.h:542
SelectType< IsExpression< VT2 >::value, const VT2, const VT2 & >::Type RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:177
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
VT2::ReturnType RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:105
#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
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecDVecMultExpr.h:238
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecDVecMultExpr.h:487
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecDVecMultExpr.h:522
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecDVecMultExpr.h:304
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 DVecDVecMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecDVecMultExpr.h:171
SelectType< IsExpression< VT1 >::value, const VT1, const VT1 & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:174
Header file for the IsAligned type trait.
Constraint on the data type.
VT1::ResultType RT1
Result type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:102
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:348
#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
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:370
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecDVecMultExpr.h:512
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecMultExpr.h:284
Constraint on the data type.
Header file for the VecVecMultExpr base class.
VT2::CompositeType CT2
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:107
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecDVecMultExpr.h:473
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
DVecDVecMultExpr< VT1, VT2, TF > This
Type of this DVecDVecMultExpr instance.
Definition: DVecDVecMultExpr.h:161
Expression object for dense vector-dense vector multiplications.The DVecDVecMultExpr class represents...
Definition: DVecDVecMultExpr.h:96
Header file for the EnableIf class template.
Header file for the IsPadded type trait.
Header file for the serial shim.
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecDVecMultExpr.h:502
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
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
ElementType ValueType
Type of the underlying elements.
Definition: DVecDVecMultExpr.h:188
Header file for run time assertion macros.
ValueType value_type
Type of the underlying elements.
Definition: DVecDVecMultExpr.h:195
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
Base template for the MultTrait class.
Definition: MultTrait.h:138
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
IteratorCategory iterator_category
The iterator category.
Definition: DVecDVecMultExpr.h:194
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:315
VT2::ElementType ET2
Element type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:109
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecDVecMultExpr.h:460
MultExprTrait< RN1, RN2 >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecDVecMultExpr.h:122
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecDVecMultExpr.h:272
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecMultExpr.h:393
ElementType * PointerType
Pointer return type.
Definition: DVecDVecMultExpr.h:189
DVecDVecMultExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the DVecDVecMultExpr class.
Definition: DVecDVecMultExpr.h:446
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecDVecMultExpr.h:532
VT1::CompositeType CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:106
Header file for all intrinsic functionality.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecDVecMultExpr.h:587
#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
VT1::ElementType ET1
Element type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:108
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: DVecDVecMultExpr.h:162
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_VECVECMULTEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid vector/vector ...
Definition: VecVecMultExpr.h:165
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecDVecMultExpr.h:417
Header file for the IsComputation type trait class.
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecDVecMultExpr.h:577
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
Header file for the IsTrue value trait.
Header file for the SubvectorExprTrait class template.
RightOperand rhs_
Right-hand side dense vector of the multiplication expression.
Definition: DVecDVecMultExpr.h:596
Header file for exception macros.
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecDVecMultExpr.h:225
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecDVecMultExpr.h:405
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecDVecMultExpr.h:168
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.
Evaluation of the resulting expression type of a multiplication.Via this type trait it is possible to...
Definition: MultExprTrait.h:137
#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
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
Base class for all vector/vector multiplication expression templates.The VecVecMultExpr class serves ...
Definition: VecVecMultExpr.h:65
#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:87
VT1::ConstIterator LeftIteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:201
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecDVecMultExpr.h:163
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
ElementType & ReferenceType
Reference return type.
Definition: DVecDVecMultExpr.h:190