All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DVecDVecSubExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECDVECSUBEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECDVECSUBEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <stdexcept>
50 #include <blaze/math/Intrinsics.h>
61 #include <blaze/util/Assert.h>
63 #include <blaze/util/EnableIf.h>
65 #include <blaze/util/SelectType.h>
66 #include <blaze/util/Types.h>
68 
69 
70 namespace blaze {
71 
72 //=================================================================================================
73 //
74 // CLASS DVECDVECSUBEXPR
75 //
76 //=================================================================================================
77 
78 //*************************************************************************************************
85 template< typename VT1 // Type of the left-hand side dense vector
86  , typename VT2 // Type of the right-hand side dense vector
87  , bool TF > // Transpose flag
88 class DVecDVecSubExpr : public DenseVector< DVecDVecSubExpr<VT1,VT2,TF>, TF >
89  , private VecVecSubExpr
90  , private Computation
91 {
92  private:
93  //**Type definitions****************************************************************************
94  typedef typename VT1::ResultType RT1;
95  typedef typename VT2::ResultType RT2;
96  typedef typename VT1::ReturnType RN1;
97  typedef typename VT2::ReturnType RN2;
98  typedef typename VT1::CompositeType CT1;
99  typedef typename VT2::CompositeType CT2;
100  typedef typename VT1::ElementType ET1;
101  typedef typename VT2::ElementType ET2;
102  //**********************************************************************************************
103 
104  //**Return type evaluation**********************************************************************
106 
111  enum { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
112 
115  //**********************************************************************************************
116 
117  //**Evaluation strategy*************************************************************************
119 
125  enum { useAssign = ( RequiresEvaluation<VT1>::value || RequiresEvaluation<VT2>::value || !returnExpr ) };
126 
128  template< typename VT >
130  struct UseAssign {
131  enum { value = useAssign };
132  };
134  //**********************************************************************************************
135 
136  public:
137  //**Type definitions****************************************************************************
143 
146 
149 
151  typedef typename SelectType< IsExpression<VT1>::value, const VT1, const VT1& >::Type LeftOperand;
152 
154  typedef typename SelectType< IsExpression<VT2>::value, const VT2, const VT2& >::Type RightOperand;
155  //**********************************************************************************************
156 
157  //**ConstIterator class definition**************************************************************
161  {
162  public:
163  //**Type definitions*************************************************************************
164  typedef std::random_access_iterator_tag IteratorCategory;
165  typedef ElementType ValueType;
166  typedef ElementType* PointerType;
167  typedef ElementType& ReferenceType;
169 
170  // STL iterator requirements
176 
179 
182  //*******************************************************************************************
183 
184  //**Constructor******************************************************************************
190  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right )
191  : left_ ( left ) // Iterator to the current left-hand side element
192  , right_( right ) // Iterator to the current right-hand side element
193  {}
194  //*******************************************************************************************
195 
196  //**Addition assignment operator*************************************************************
202  inline ConstIterator& operator+=( size_t inc ) {
203  left_ += inc;
204  right_ += inc;
205  return *this;
206  }
207  //*******************************************************************************************
208 
209  //**Subtraction assignment operator**********************************************************
215  inline ConstIterator& operator-=( size_t dec ) {
216  left_ -= dec;
217  right_ -= dec;
218  return *this;
219  }
220  //*******************************************************************************************
221 
222  //**Prefix increment operator****************************************************************
228  ++left_;
229  ++right_;
230  return *this;
231  }
232  //*******************************************************************************************
233 
234  //**Postfix increment operator***************************************************************
239  inline const ConstIterator operator++( int ) {
240  return ConstIterator( left_++, right_++ );
241  }
242  //*******************************************************************************************
243 
244  //**Prefix decrement operator****************************************************************
250  --left_;
251  --right_;
252  return *this;
253  }
254  //*******************************************************************************************
255 
256  //**Postfix decrement operator***************************************************************
261  inline const ConstIterator operator--( int ) {
262  return ConstIterator( left_--, right_-- );
263  }
264  //*******************************************************************************************
265 
266  //**Element access operator******************************************************************
271  inline ReturnType operator*() const {
272  return (*left_) - (*right_);
273  }
274  //*******************************************************************************************
275 
276  //**Load function****************************************************************************
281  inline IntrinsicType load() const {
282  return left_.load() - right_.load();
283  }
284  //*******************************************************************************************
285 
286  //**Equality operator************************************************************************
292  inline bool operator==( const ConstIterator& rhs ) const {
293  return left_ == rhs.left_;
294  }
295  //*******************************************************************************************
296 
297  //**Inequality operator**********************************************************************
303  inline bool operator!=( const ConstIterator& rhs ) const {
304  return left_ != rhs.left_;
305  }
306  //*******************************************************************************************
307 
308  //**Less-than operator***********************************************************************
314  inline bool operator<( const ConstIterator& rhs ) const {
315  return left_ < rhs.left_;
316  }
317  //*******************************************************************************************
318 
319  //**Greater-than operator********************************************************************
325  inline bool operator>( const ConstIterator& rhs ) const {
326  return left_ > rhs.left_;
327  }
328  //*******************************************************************************************
329 
330  //**Less-or-equal-than operator**************************************************************
336  inline bool operator<=( const ConstIterator& rhs ) const {
337  return left_ <= rhs.left_;
338  }
339  //*******************************************************************************************
340 
341  //**Greater-or-equal-than operator***********************************************************
347  inline bool operator>=( const ConstIterator& rhs ) const {
348  return left_ >= rhs.left_;
349  }
350  //*******************************************************************************************
351 
352  //**Subtraction operator*********************************************************************
358  inline DifferenceType operator-( const ConstIterator& rhs ) const {
359  return left_ - rhs.left_;
360  }
361  //*******************************************************************************************
362 
363  //**Addition operator************************************************************************
370  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
371  return ConstIterator( it.left_ + inc, it.right_ + inc );
372  }
373  //*******************************************************************************************
374 
375  //**Addition operator************************************************************************
382  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
383  return ConstIterator( it.left_ + inc, it.right_ + inc );
384  }
385  //*******************************************************************************************
386 
387  //**Subtraction operator*********************************************************************
394  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
395  return ConstIterator( it.left_ - dec, it.right_ - dec );
396  }
397  //*******************************************************************************************
398 
399  private:
400  //**Member variables*************************************************************************
403  //*******************************************************************************************
404  };
405  //**********************************************************************************************
406 
407  //**Compilation flags***************************************************************************
409  enum { vectorizable = VT1::vectorizable && VT2::vectorizable &&
412 
414  enum { smpAssignable = VT1::smpAssignable && VT2::smpAssignable };
415  //**********************************************************************************************
416 
417  //**Constructor*********************************************************************************
423  explicit inline DVecDVecSubExpr( const VT1& lhs, const VT2& rhs )
424  : lhs_( lhs ) // Left-hand side dense vector of the subtraction expression
425  , rhs_( rhs ) // Right-hand side dense vector of the subtraction expression
426  {
427  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
428  }
429  //**********************************************************************************************
430 
431  //**Subscript operator**************************************************************************
437  inline ReturnType operator[]( size_t index ) const {
438  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
439  return lhs_[index] - rhs_[index];
440  }
441  //**********************************************************************************************
442 
443  //**Load function*******************************************************************************
449  inline IntrinsicType load( size_t index ) const {
450  typedef IntrinsicTrait<ElementType> IT;
451  BLAZE_INTERNAL_ASSERT( index < lhs_.size() , "Invalid vector access index" );
452  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
453  const IntrinsicType xmm1( lhs_.load( index ) );
454  const IntrinsicType xmm2( rhs_.load( index ) );
455  return xmm1 - xmm2;
456  }
457  //**********************************************************************************************
458 
459  //**Begin function******************************************************************************
464  inline ConstIterator begin() const {
465  return ConstIterator( lhs_.begin(), rhs_.begin() );
466  }
467  //**********************************************************************************************
468 
469  //**End function********************************************************************************
474  inline ConstIterator end() const {
475  return ConstIterator( lhs_.end(), rhs_.end() );
476  }
477  //**********************************************************************************************
478 
479  //**Size function*******************************************************************************
484  inline size_t size() const {
485  return lhs_.size();
486  }
487  //**********************************************************************************************
488 
489  //**Left operand access*************************************************************************
494  inline LeftOperand leftOperand() const {
495  return lhs_;
496  }
497  //**********************************************************************************************
498 
499  //**Right operand access************************************************************************
504  inline RightOperand rightOperand() const {
505  return rhs_;
506  }
507  //**********************************************************************************************
508 
509  //**********************************************************************************************
515  template< typename T >
516  inline bool canAlias( const T* alias ) const {
517  return ( IsComputation<VT1>::value && ( RequiresEvaluation<VT1>::value ? lhs_.isAliased( alias ) : lhs_.canAlias( alias ) ) ) ||
518  ( IsComputation<VT2>::value && ( RequiresEvaluation<VT2>::value ? rhs_.isAliased( alias ) : rhs_.canAlias( alias ) ) );
519  }
520  //**********************************************************************************************
521 
522  //**********************************************************************************************
528  template< typename T >
529  inline bool isAliased( const T* alias ) const {
530  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
531  }
532  //**********************************************************************************************
533 
534  //**********************************************************************************************
539  inline bool isAligned() const {
540  return lhs_.isAligned() && rhs_.isAligned();
541  }
542  //**********************************************************************************************
543 
544  //**********************************************************************************************
549  inline bool canSMPAssign() const {
550  return lhs_.canSMPAssign() || rhs_.canSMPAssign() ||
552  }
553  //**********************************************************************************************
554 
555  private:
556  //**Member variables****************************************************************************
557  LeftOperand lhs_;
558  RightOperand rhs_;
559  //**********************************************************************************************
560 
561  //**Assignment to dense vectors*****************************************************************
575  template< typename VT > // Type of the target dense vector
576  friend inline typename EnableIf< UseAssign<VT> >::Type
577  assign( DenseVector<VT,TF>& lhs, const DVecDVecSubExpr& rhs )
578  {
580 
581  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
582 
583  if( !IsComputation<VT1>::value && (~lhs).isAliased( &rhs.lhs_ ) ) {
584  smpSubAssign( ~lhs, rhs.rhs_ );
585  }
586  else {
587  smpAssign ( ~lhs, rhs.lhs_ );
588  smpSubAssign( ~lhs, rhs.rhs_ );
589  }
590  }
592  //**********************************************************************************************
593 
594  //**Assignment to sparse vectors****************************************************************
608  template< typename VT > // Type of the target sparse vector
609  friend inline typename EnableIf< UseAssign<VT> >::Type
610  assign( SparseVector<VT,TF>& lhs, const DVecDVecSubExpr& rhs )
611  {
613 
617 
618  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
619 
620  const ResultType tmp( rhs );
621  smpAssign( ~lhs, tmp );
622  }
624  //**********************************************************************************************
625 
626  //**Addition assignment to dense vectors********************************************************
640  template< typename VT > // Type of the target dense vector
641  friend inline typename EnableIf< UseAssign<VT> >::Type
642  addAssign( DenseVector<VT,TF>& lhs, const DVecDVecSubExpr& rhs )
643  {
645 
646  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
647 
648  smpAddAssign( ~lhs, rhs.lhs_ );
649  smpSubAssign( ~lhs, rhs.rhs_ );
650  }
652  //**********************************************************************************************
653 
654  //**Addition assignment to sparse vectors*******************************************************
655  // No special implementation for the addition assignment to sparse vectors.
656  //**********************************************************************************************
657 
658  //**Subtraction assignment to dense vectors*****************************************************
672  template< typename VT > // Type of the target dense vector
673  friend inline typename EnableIf< UseAssign<VT> >::Type
674  subAssign( DenseVector<VT,TF>& lhs, const DVecDVecSubExpr& rhs )
675  {
677 
678  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
679 
680  smpSubAssign( ~lhs, rhs.lhs_ );
681  smpAddAssign( ~lhs, rhs.rhs_ );
682  }
684  //**********************************************************************************************
685 
686  //**Subtraction assignment to sparse vectors****************************************************
687  // No special implementation for the subtraction assignment to sparse vectors.
688  //**********************************************************************************************
689 
690  //**Multiplication assignment to dense vectors**************************************************
704  template< typename VT > // Type of the target dense vector
705  friend inline typename EnableIf< UseAssign<VT> >::Type
706  multAssign( DenseVector<VT,TF>& lhs, const DVecDVecSubExpr& rhs )
707  {
709 
713 
714  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
715 
716  const ResultType tmp( rhs );
717  smpMultAssign( ~lhs, tmp );
718  }
720  //**********************************************************************************************
721 
722  //**Multiplication assignment to sparse vectors*************************************************
723  // No special implementation for the multiplication assignment to sparse vectors.
724  //**********************************************************************************************
725 
726  //**Compile time checks*************************************************************************
733  //**********************************************************************************************
734 };
735 //*************************************************************************************************
736 
737 
738 
739 
740 //=================================================================================================
741 //
742 // GLOBAL BINARY ARITHMETIC OPERATORS
743 //
744 //=================================================================================================
745 
746 //*************************************************************************************************
770 template< typename T1 // Type of the left-hand side dense vector
771  , typename T2 // Type of the right-hand side dense vector
772  , bool TF > // Transpose flag
773 inline const DVecDVecSubExpr<T1,T2,TF>
775 {
777 
778  if( (~lhs).size() != (~rhs).size() )
779  throw std::invalid_argument( "Vector sizes do not match" );
780 
781  return DVecDVecSubExpr<T1,T2,TF>( ~lhs, ~rhs );
782 }
783 //*************************************************************************************************
784 
785 
786 
787 
788 //=================================================================================================
789 //
790 // EXPRESSION TRAIT SPECIALIZATIONS
791 //
792 //=================================================================================================
793 
794 //*************************************************************************************************
796 template< typename VT1, typename VT2, bool TF, bool AF >
797 struct SubvectorExprTrait< DVecDVecSubExpr<VT1,VT2,TF>, AF >
798 {
799  public:
800  //**********************************************************************************************
801  typedef typename SubExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
802  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
803  //**********************************************************************************************
804 };
806 //*************************************************************************************************
807 
808 } // namespace blaze
809 
810 #endif
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecDVecSubExpr.h:168
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecDVecSubExpr.h:402
PointerType pointer
Pointer return type.
Definition: DVecDVecSubExpr.h:173
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:172
Header file for the subtraction trait.
ReferenceType reference
Reference return type.
Definition: DVecDVecSubExpr.h:174
SelectType< IsExpression< VT2 >::value, const VT2, const VT2 & >::Type RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:154
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:151
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecDVecSubExpr.h:239
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecDVecSubExpr.h:437
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:197
SelectType< IsExpression< VT1 >::value, const VT1, const VT1 & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:151
void smpMultAssign(DenseVector< 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:178
Header file for the IsSame and IsStrictlySame type traits.
DVecDVecSubExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the DVecDVecSubExpr class.
Definition: DVecDVecSubExpr.h:423
VT1::ReturnType RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:96
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecSubExpr.h:370
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2384
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:249
VT2::ReturnType RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:97
Header file for the DenseVector base class.
VT1::ElementType ET1
Element type of the left-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:100
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
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecDVecSubExpr.h:539
Header file for the RequiresEvaluation type trait.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecDVecSubExpr.h:215
DVecDVecSubExpr< VT1, VT2, TF > This
Type of this DVecDVecSubExpr instance.
Definition: DVecDVecSubExpr.h:138
ElementType * PointerType
Pointer return type.
Definition: DVecDVecSubExpr.h:166
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:394
void smpAddAssign(DenseMatrix< 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:121
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:202
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:251
const size_t SMP_DVECDVECSUB_THRESHOLD
SMP dense vector/dense vector subtraction threshold.This threshold represents the system-specific thr...
Definition: Thresholds.h:100
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecDVecSubExpr.h:142
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecDVecSubExpr.h:271
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecSubExpr.h:336
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:347
Header file for the IsTemporary type trait class.
IteratorCategory iterator_category
The iterator category.
Definition: DVecDVecSubExpr.h:171
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecDVecSubExpr.h:358
Header file for the dense vector SMP implementation.
VT1::CompositeType CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:98
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecDVecSubExpr.h:249
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2388
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecDVecSubExpr.h:164
Iterator over the elements of the dense vector.
Definition: DVecDVecSubExpr.h:160
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecDVecSubExpr.h:141
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecSubExpr.h:303
DifferenceType difference_type
Difference between two iterators.
Definition: DVecDVecSubExpr.h:175
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:148
Constraint on the data type.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecDVecSubExpr.h:140
#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:101
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:401
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2382
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecDVecSubExpr.h:382
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:474
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:464
ElementType ValueType
Type of the underlying elements.
Definition: DVecDVecSubExpr.h:165
Header file for the EnableIf class template.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecDVecSubExpr.h:549
void smpAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:91
ConstIterator(LeftIteratorType left, RightIteratorType right)
Constructor for the ConstIterator class.
Definition: DVecDVecSubExpr.h:190
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecSubExpr.h:314
VT1::ConstIterator LeftIteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:178
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2383
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:748
Header file for run time assertion macros.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecDVecSubExpr.h:145
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:167
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecDVecSubExpr.h:529
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecSubExpr.h:227
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:139
VT2::ConstIterator RightIteratorType
ConstIterator type of the right-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:181
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecDVecSubExpr.h:292
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecDVecSubExpr.h:281
RightOperand rhs_
Right-hand side dense vector of the subtraction expression.
Definition: DVecDVecSubExpr.h:558
SubExprTrait< RN1, RN2 >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecDVecSubExpr.h:114
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:99
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecSubExpr.h:516
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
Header file for the sparse vector SMP implementation.
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecDVecSubExpr.h:494
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:2379
VT2::ResultType RT2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecSubExpr.h:95
Header file for basic type definitions.
IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecDVecSubExpr.h:449
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:94
RightOperand rightOperand() const
Returns the right-hand side dense vector operand.
Definition: DVecDVecSubExpr.h:504
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:557
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecSubExpr.h:261
Header file for the SubExprTrait class template.
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecDVecSubExpr.h:484
Expression object for dense vector-dense vector subtractions.The DVecDVecSubExpr class represents the...
Definition: DVecDVecSubExpr.h:88
#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
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecSubExpr.h:325
#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.