All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DVecDVecAddExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECDVECADDEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECDVECADDEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <stdexcept>
50 #include <blaze/math/Intrinsics.h>
60 #include <blaze/util/Assert.h>
64 #include <blaze/util/EnableIf.h>
66 #include <blaze/util/SelectType.h>
67 #include <blaze/util/Types.h>
69 
70 
71 namespace blaze {
72 
73 //=================================================================================================
74 //
75 // CLASS DVECDVECADDEXPR
76 //
77 //=================================================================================================
78 
79 //*************************************************************************************************
86 template< typename VT1 // Type of the left-hand side dense vector
87  , typename VT2 // Type of the right-hand side dense vector
88  , bool TF > // Transpose flag
89 class DVecDVecAddExpr : public DenseVector< DVecDVecAddExpr<VT1,VT2,TF>, TF >
90  , private VecVecAddExpr
91  , private Computation
92 {
93  private:
94  //**Type definitions****************************************************************************
95  typedef typename VT1::ResultType RE1;
96  typedef typename VT2::ResultType RE2;
97  typedef typename VT1::ReturnType RN1;
98  typedef typename VT2::ReturnType RN2;
99  typedef typename VT1::CompositeType CT1;
100  typedef typename VT2::CompositeType CT2;
101  typedef typename VT1::ElementType ET1;
102  typedef typename VT2::ElementType ET2;
103  //**********************************************************************************************
104 
105  //**Return type evaluation**********************************************************************
107 
112  enum { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
113 
116  //**********************************************************************************************
117 
118  //**Serial evaluation strategy******************************************************************
120 
126  enum { useAssign = ( RequiresEvaluation<VT1>::value || RequiresEvaluation<VT2>::value || !returnExpr ) };
127 
129  template< typename VT >
131  struct UseAssign {
132  enum { value = useAssign };
133  };
135  //**********************************************************************************************
136 
137  //**Parallel evaluation strategy****************************************************************
139 
145  template< typename VT >
146  struct UseSMPAssign {
147  enum { value = ( !VT1::smpAssignable || !VT2::smpAssignable ) && useAssign };
148  };
150  //**********************************************************************************************
151 
152  public:
153  //**Type definitions****************************************************************************
159 
162 
165 
167  typedef typename SelectType< IsExpression<VT1>::value, const VT1, const VT1& >::Type LeftOperand;
168 
170  typedef typename SelectType< IsExpression<VT2>::value, const VT2, const VT2& >::Type RightOperand;
171  //**********************************************************************************************
172 
173  //**ConstIterator class definition**************************************************************
177  {
178  public:
179  //**Type definitions*************************************************************************
180  typedef std::random_access_iterator_tag IteratorCategory;
185 
186  // STL iterator requirements
192 
195 
198  //*******************************************************************************************
199 
200  //**Constructor******************************************************************************
206  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right )
207  : left_ ( left ) // Iterator to the current left-hand side element
208  , right_( right ) // Iterator to the current right-hand side element
209  {}
210  //*******************************************************************************************
211 
212  //**Addition assignment operator*************************************************************
218  inline ConstIterator& operator+=( size_t inc ) {
219  left_ += inc;
220  right_ += inc;
221  return *this;
222  }
223  //*******************************************************************************************
224 
225  //**Subtraction assignment operator**********************************************************
231  inline ConstIterator& operator-=( size_t dec ) {
232  left_ -= dec;
233  right_ -= dec;
234  return *this;
235  }
236  //*******************************************************************************************
237 
238  //**Prefix increment operator****************************************************************
244  ++left_;
245  ++right_;
246  return *this;
247  }
248  //*******************************************************************************************
249 
250  //**Postfix increment operator***************************************************************
255  inline const ConstIterator operator++( int ) {
256  return ConstIterator( left_++, right_++ );
257  }
258  //*******************************************************************************************
259 
260  //**Prefix decrement operator****************************************************************
266  --left_;
267  --right_;
268  return *this;
269  }
270  //*******************************************************************************************
271 
272  //**Postfix decrement operator***************************************************************
277  inline const ConstIterator operator--( int ) {
278  return ConstIterator( left_--, right_-- );
279  }
280  //*******************************************************************************************
281 
282  //**Element access operator******************************************************************
287  inline ReturnType operator*() const {
288  return (*left_) + (*right_);
289  }
290  //*******************************************************************************************
291 
292  //**Load function****************************************************************************
297  inline IntrinsicType load() const {
298  return left_.load() + right_.load();
299  }
300  //*******************************************************************************************
301 
302  //**Equality operator************************************************************************
308  inline bool operator==( const ConstIterator& rhs ) const {
309  return left_ == rhs.left_;
310  }
311  //*******************************************************************************************
312 
313  //**Inequality operator**********************************************************************
319  inline bool operator!=( const ConstIterator& rhs ) const {
320  return left_ != rhs.left_;
321  }
322  //*******************************************************************************************
323 
324  //**Less-than operator***********************************************************************
330  inline bool operator<( const ConstIterator& rhs ) const {
331  return left_ < rhs.left_;
332  }
333  //*******************************************************************************************
334 
335  //**Greater-than operator********************************************************************
341  inline bool operator>( const ConstIterator& rhs ) const {
342  return left_ > rhs.left_;
343  }
344  //*******************************************************************************************
345 
346  //**Less-or-equal-than operator**************************************************************
352  inline bool operator<=( const ConstIterator& rhs ) const {
353  return left_ <= rhs.left_;
354  }
355  //*******************************************************************************************
356 
357  //**Greater-or-equal-than operator***********************************************************
363  inline bool operator>=( const ConstIterator& rhs ) const {
364  return left_ >= rhs.left_;
365  }
366  //*******************************************************************************************
367 
368  //**Subtraction operator*********************************************************************
374  inline DifferenceType operator-( const ConstIterator& rhs ) const {
375  return left_ - rhs.left_;
376  }
377  //*******************************************************************************************
378 
379  //**Addition operator************************************************************************
386  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
387  return ConstIterator( it.left_ + inc, it.right_ + inc );
388  }
389  //*******************************************************************************************
390 
391  //**Addition operator************************************************************************
398  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
399  return ConstIterator( it.left_ + inc, it.right_ + inc );
400  }
401  //*******************************************************************************************
402 
403  //**Subtraction operator*********************************************************************
410  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
411  return ConstIterator( it.left_ - dec, it.right_ - dec );
412  }
413  //*******************************************************************************************
414 
415  private:
416  //**Member variables*************************************************************************
419  //*******************************************************************************************
420  };
421  //**********************************************************************************************
422 
423  //**Compilation flags***************************************************************************
425  enum { vectorizable = VT1::vectorizable && VT2::vectorizable &&
428 
430  enum { smpAssignable = VT1::smpAssignable && VT2::smpAssignable };
431  //**********************************************************************************************
432 
433  //**Constructor*********************************************************************************
439  explicit inline DVecDVecAddExpr( const VT1& lhs, const VT2& rhs )
440  : lhs_( lhs ) // Left-hand side dense vector of the addition expression
441  , rhs_( rhs ) // Right-hand side dense vector of the addition expression
442  {
443  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
444  }
445  //**********************************************************************************************
446 
447  //**Subscript operator**************************************************************************
453  inline ReturnType operator[]( size_t index ) const {
454  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
455  return lhs_[index] + rhs_[index];
456  }
457  //**********************************************************************************************
458 
459  //**Load function*******************************************************************************
465  inline IntrinsicType load( size_t index ) const {
466  typedef IntrinsicTrait<ElementType> IT;
467  BLAZE_INTERNAL_ASSERT( index < lhs_.size() , "Invalid vector access index" );
468  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
469  const IntrinsicType xmm1( lhs_.load( index ) );
470  const IntrinsicType xmm2( rhs_.load( index ) );
471  return xmm1 + xmm2;
472  }
473  //**********************************************************************************************
474 
475  //**Begin function******************************************************************************
480  inline ConstIterator begin() const {
481  return ConstIterator( lhs_.begin(), rhs_.begin() );
482  }
483  //**********************************************************************************************
484 
485  //**End function********************************************************************************
490  inline ConstIterator end() const {
491  return ConstIterator( lhs_.end(), rhs_.end() );
492  }
493  //**********************************************************************************************
494 
495  //**Size function*******************************************************************************
500  inline size_t size() const {
501  return lhs_.size();
502  }
503  //**********************************************************************************************
504 
505  //**Left operand access*************************************************************************
510  inline LeftOperand leftOperand() const {
511  return lhs_;
512  }
513  //**********************************************************************************************
514 
515  //**Right operand access************************************************************************
520  inline RightOperand rightOperand() const {
521  return rhs_;
522  }
523  //**********************************************************************************************
524 
525  //**********************************************************************************************
531  template< typename T >
532  inline bool canAlias( const T* alias ) const {
533  return ( IsExpression<VT1>::value && ( RequiresEvaluation<VT1>::value ? lhs_.isAliased( alias ) : lhs_.canAlias( alias ) ) ) ||
534  ( IsExpression<VT2>::value && ( RequiresEvaluation<VT2>::value ? rhs_.isAliased( alias ) : rhs_.canAlias( alias ) ) );
535  }
536  //**********************************************************************************************
537 
538  //**********************************************************************************************
544  template< typename T >
545  inline bool isAliased( const T* alias ) const {
546  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
547  }
548  //**********************************************************************************************
549 
550  //**********************************************************************************************
555  inline bool isAligned() const {
556  return lhs_.isAligned() && rhs_.isAligned();
557  }
558  //**********************************************************************************************
559 
560  //**********************************************************************************************
565  inline bool canSMPAssign() const {
566  return lhs_.canSMPAssign() || rhs_.canSMPAssign() ||
568  }
569  //**********************************************************************************************
570 
571  private:
572  //**Member variables****************************************************************************
575  //**********************************************************************************************
576 
577  //**Assignment to dense vectors*****************************************************************
591  template< typename VT > // Type of the target dense vector
592  friend inline typename EnableIf< UseAssign<VT> >::Type
593  assign( DenseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
594  {
596 
597  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
598 
599  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
600  addAssign( ~lhs, rhs.rhs_ );
601  }
602  else if( !IsComputation<VT2>::value && isSame( ~lhs, rhs.rhs_ ) ) {
603  addAssign( ~lhs, rhs.lhs_ );
604  }
605  else {
606  assign ( ~lhs, rhs.lhs_ );
607  addAssign( ~lhs, rhs.rhs_ );
608  }
609  }
611  //**********************************************************************************************
612 
613  //**Assignment to sparse vectors****************************************************************
627  template< typename VT > // Type of the target sparse vector
628  friend inline typename EnableIf< UseAssign<VT> >::Type
629  assign( SparseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
630  {
632 
636 
637  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
638 
639  const ResultType tmp( serial( rhs ) );
640  assign( ~lhs, tmp );
641  }
643  //**********************************************************************************************
644 
645  //**Addition assignment to dense vectors********************************************************
659  template< typename VT > // Type of the target dense vector
660  friend inline typename EnableIf< UseAssign<VT> >::Type
661  addAssign( DenseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
662  {
664 
665  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
666 
667  addAssign( ~lhs, rhs.lhs_ );
668  addAssign( ~lhs, rhs.rhs_ );
669  }
671  //**********************************************************************************************
672 
673  //**Addition assignment to sparse vectors*******************************************************
674  // No special implementation for the addition assignment to sparse vectors.
675  //**********************************************************************************************
676 
677  //**Subtraction assignment to dense vectors*****************************************************
691  template< typename VT > // Type of the target dense vector
692  friend inline typename EnableIf< UseAssign<VT> >::Type
693  subAssign( DenseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
694  {
696 
697  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
698 
699  subAssign( ~lhs, rhs.lhs_ );
700  subAssign( ~lhs, rhs.rhs_ );
701  }
703  //**********************************************************************************************
704 
705  //**Subtraction assignment to sparse vectors****************************************************
706  // No special implementation for the subtraction assignment to sparse vectors.
707  //**********************************************************************************************
708 
709  //**Multiplication assignment to dense vectors**************************************************
723  template< typename VT > // Type of the target dense vector
724  friend inline typename EnableIf< UseAssign<VT> >::Type
725  multAssign( DenseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
726  {
728 
732 
733  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
734 
735  const ResultType tmp( serial( rhs ) );
736  multAssign( ~lhs, tmp );
737  }
739  //**********************************************************************************************
740 
741  //**Multiplication assignment to sparse vectors*************************************************
742  // No special implementation for the multiplication assignment to sparse vectors.
743  //**********************************************************************************************
744 
745  //**SMP assignment to dense vectors*************************************************************
759  template< typename VT > // Type of the target dense vector
760  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
761  smpAssign( DenseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
762  {
764 
765  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
766 
767  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
768  smpAddAssign( ~lhs, rhs.rhs_ );
769  }
770  else if( !IsComputation<VT2>::value && isSame( ~lhs, rhs.rhs_ ) ) {
771  smpAddAssign( ~lhs, rhs.lhs_ );
772  }
773  else {
774  smpAssign ( ~lhs, rhs.lhs_ );
775  smpAddAssign( ~lhs, rhs.rhs_ );
776  }
777  }
779  //**********************************************************************************************
780 
781  //**SMP assignment to sparse vectors************************************************************
795  template< typename VT > // Type of the target sparse vector
796  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
797  smpAssign( SparseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
798  {
800 
804 
805  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
806 
807  const ResultType tmp( rhs );
808  smpAssign( ~lhs, tmp );
809  }
811  //**********************************************************************************************
812 
813  //**SMP addition assignment to dense vectors****************************************************
827  template< typename VT > // Type of the target dense vector
828  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
829  smpAddAssign( DenseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
830  {
832 
833  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
834 
835  smpAddAssign( ~lhs, rhs.lhs_ );
836  smpAddAssign( ~lhs, rhs.rhs_ );
837  }
839  //**********************************************************************************************
840 
841  //**SMP addition assignment to sparse vectors***************************************************
842  // No special implementation for the SMP addition assignment to sparse vectors.
843  //**********************************************************************************************
844 
845  //**SMP subtraction assignment to dense vectors*************************************************
859  template< typename VT > // Type of the target dense vector
860  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
861  smpSubAssign( DenseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
862  {
864 
865  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
866 
867  smpSubAssign( ~lhs, rhs.lhs_ );
868  smpSubAssign( ~lhs, rhs.rhs_ );
869  }
871  //**********************************************************************************************
872 
873  //**SMP subtraction assignment to sparse vectors************************************************
874  // No special implementation for the SMP subtraction assignment to sparse vectors.
875  //**********************************************************************************************
876 
877  //**SMP multiplication assignment to dense vectors**********************************************
891  template< typename VT > // Type of the target dense vector
892  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
893  smpMultAssign( DenseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
894  {
896 
900 
901  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
902 
903  const ResultType tmp( rhs );
904  smpMultAssign( ~lhs, tmp );
905  }
907  //**********************************************************************************************
908 
909  //**SMP multiplication assignment to sparse vectors*********************************************
910  // No special implementation for the SMP multiplication assignment to sparse vectors.
911  //**********************************************************************************************
912 
913  //**Compile time checks*************************************************************************
920  //**********************************************************************************************
921 };
922 //*************************************************************************************************
923 
924 
925 
926 
927 //=================================================================================================
928 //
929 // GLOBAL BINARY ARITHMETIC OPERATORS
930 //
931 //=================================================================================================
932 
933 //*************************************************************************************************
957 template< typename T1 // Type of the left-hand side dense vector
958  , typename T2 // Type of the right-hand side dense vector
959  , bool TF > // Transpose flag
960 inline const DVecDVecAddExpr<T1,T2,TF>
962 {
964 
965  if( (~lhs).size() != (~rhs).size() )
966  throw std::invalid_argument( "Vector sizes do not match" );
967 
968  return DVecDVecAddExpr<T1,T2,TF>( ~lhs, ~rhs );
969 }
970 //*************************************************************************************************
971 
972 
973 
974 
975 //=================================================================================================
976 //
977 // EXPRESSION TRAIT SPECIALIZATIONS
978 //
979 //=================================================================================================
980 
981 //*************************************************************************************************
983 template< typename VT1, typename VT2, bool TF, bool AF >
984 struct SubvectorExprTrait< DVecDVecAddExpr<VT1,VT2,TF>, AF >
985 {
986  public:
987  //**********************************************************************************************
988  typedef typename AddExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
989  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
990  //**********************************************************************************************
991 };
993 //*************************************************************************************************
994 
995 } // namespace blaze
996 
997 #endif
VT1::ReturnType RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:97
Iterator over the elements of the dense vector.
Definition: DVecDVecAddExpr.h:176
Pointer difference type of the Blaze library.
ConstIterator(LeftIteratorType left, RightIteratorType right)
Constructor for the ConstIterator class.
Definition: DVecDVecAddExpr.h:206
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
Evaluation of the return type of an addition expression.Via this type trait it is possible to evaluat...
Definition: AddExprTrait.h:103
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecDVecAddExpr.h:374
PointerType pointer
Pointer return type.
Definition: DVecDVecAddExpr.h:189
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecAddExpr.h:532
IteratorCategory iterator_category
The iterator category.
Definition: DVecDVecAddExpr.h:187
VT2::ResultType RE2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:96
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:152
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:199
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecDVecAddExpr.h:480
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:179
Header file for the IsSame and IsStrictlySame type traits.
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecDVecAddExpr.h:500
VT1::ConstIterator LeftIteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:194
ElementType ValueType
Type of the underlying elements.
Definition: DVecDVecAddExpr.h:181
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2408
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:251
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:308
Header file for the DenseVector base class.
SelectType< IsExpression< VT1 >::value, const VT1, const VT1 & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:167
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecDVecAddExpr.h:287
Header file for the AddExprTrait class template.
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:690
DVecDVecAddExpr< VT1, VT2, TF > This
Type of this DVecDVecAddExpr instance.
Definition: DVecDVecAddExpr.h:154
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
RightOperand rhs_
Right-hand side dense vector of the addition expression.
Definition: DVecDVecAddExpr.h:574
Header file for the RequiresEvaluation type trait.
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:409
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecDVecAddExpr.h:180
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecDVecAddExpr.h:158
Constraint on the data type.
SelectType< useAssign, const ResultType, const DVecDVecAddExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecDVecAddExpr.h:164
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecDVecAddExpr.h:510
Constraint on the data type.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecDVecAddExpr.h:231
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecDVecAddExpr.h:565
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:122
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:253
AddTrait< RE1, RE2 >::Type ResultType
Result type for expression template evaluations.
Definition: DVecDVecAddExpr.h:155
VT1::ResultType RE1
Result type of the left-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:95
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecDVecAddExpr.h:398
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.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecDVecAddExpr.h:184
VT1::CompositeType CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:99
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:352
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecDVecAddExpr.h:265
Header file for the VecVecAddExpr base class.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2412
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:341
VT2::ElementType ET2
Element type of the right-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:102
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecDVecAddExpr.h:161
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecDVecAddExpr.h:555
ElementType & ReferenceType
Reference return type.
Definition: DVecDVecAddExpr.h:183
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:271
const DenseIterator< Type > operator+(const DenseIterator< Type > &it, ptrdiff_t inc)
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:556
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecDVecAddExpr.h:418
const size_t SMP_DVECDVECADD_THRESHOLD
SMP dense vector/dense vector addition threshold.This threshold specifies when a dense vector/dense v...
Definition: Thresholds.h:230
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:78
Constraint on the data type.
AddExprTrait< RN1, RN2 >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecDVecAddExpr.h:115
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecDVecAddExpr.h:218
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2406
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:361
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
VT2::ConstIterator RightIteratorType
ConstIterator type of the right-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:197
Base class for all vector/vector addition expression templates.The VecVecAddExpr class serves as a ta...
Definition: VecVecAddExpr.h:65
Header file for the EnableIf class template.
Header file for the serial shim.
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:92
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecAddExpr.h:277
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecDVecAddExpr.h:490
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:363
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2407
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:748
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:141
ElementType * PointerType
Pointer return type.
Definition: DVecDVecAddExpr.h:182
Header file for the addition trait.
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:301
RightOperand rightOperand() const
Returns the right-hand side dense vector operand.
Definition: DVecDVecAddExpr.h:520
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
VT1::ElementType ET1
Element type of the left-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:101
SelectType< IsExpression< VT2 >::value, const VT2, const VT2 & >::Type RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:170
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:331
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecDVecAddExpr.h:255
VT2::ReturnType RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:98
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecDVecAddExpr.h:417
LeftOperand lhs_
Left-hand side dense vector of the addition expression.
Definition: DVecDVecAddExpr.h:573
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecDVecAddExpr.h:410
Expression object for dense vector-dense vector additions.The DVecDVecAddExpr class represents the co...
Definition: DVecDVecAddExpr.h:89
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecAddExpr.h:386
Header file for all intrinsic functionality.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecDVecAddExpr.h:453
#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
IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecDVecAddExpr.h:465
ValueType value_type
Type of the underlying elements.
Definition: DVecDVecAddExpr.h:188
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:319
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecAddExpr.h:243
DifferenceType difference_type
Difference between two iterators.
Definition: DVecDVecAddExpr.h:191
VT2::CompositeType CT2
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:100
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
DVecDVecAddExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the DVecDVecAddExpr class.
Definition: DVecDVecAddExpr.h:439
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
#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
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecDVecAddExpr.h:156
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecDVecAddExpr.h:545
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:330
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2403
Header file for basic type definitions.
Header file for the SubvectorExprTrait class template.
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecDVecAddExpr.h:297
Constraint on the data type.
#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.
#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
ReferenceType reference
Reference return type.
Definition: DVecDVecAddExpr.h:190
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:87
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecDVecAddExpr.h:157