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>
51 #include <blaze/math/Intrinsics.h>
62 #include <blaze/util/Assert.h>
66 #include <blaze/util/EnableIf.h>
68 #include <blaze/util/mpl/Max.h>
69 #include <blaze/util/SelectType.h>
70 #include <blaze/util/Types.h>
72 
73 
74 namespace blaze {
75 
76 //=================================================================================================
77 //
78 // CLASS DVECDVECADDEXPR
79 //
80 //=================================================================================================
81 
82 //*************************************************************************************************
89 template< typename VT1 // Type of the left-hand side dense vector
90  , typename VT2 // Type of the right-hand side dense vector
91  , bool TF > // Transpose flag
92 class DVecDVecAddExpr : public DenseVector< DVecDVecAddExpr<VT1,VT2,TF>, TF >
93  , private VecVecAddExpr
94  , private Computation
95 {
96  private:
97  //**Type definitions****************************************************************************
98  typedef typename VT1::ResultType RE1;
99  typedef typename VT2::ResultType RE2;
100  typedef typename VT1::ReturnType RN1;
101  typedef typename VT2::ReturnType RN2;
102  typedef typename VT1::CompositeType CT1;
103  typedef typename VT2::CompositeType CT2;
104  typedef typename VT1::ElementType ET1;
105  typedef typename VT2::ElementType ET2;
106  //**********************************************************************************************
107 
108  //**Return type evaluation**********************************************************************
110 
115  enum { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
116 
119  //**********************************************************************************************
120 
121  //**Serial evaluation strategy******************************************************************
123 
129  enum { useAssign = ( RequiresEvaluation<VT1>::value || RequiresEvaluation<VT2>::value || !returnExpr ) };
130 
132  template< typename VT >
134  struct UseAssign {
135  enum { value = useAssign };
136  };
138  //**********************************************************************************************
139 
140  //**Parallel evaluation strategy****************************************************************
142 
148  template< typename VT >
149  struct UseSMPAssign {
150  enum { value = ( !VT1::smpAssignable || !VT2::smpAssignable ) && useAssign };
151  };
153  //**********************************************************************************************
154 
155  public:
156  //**Type definitions****************************************************************************
162 
165 
168 
170  typedef typename SelectType< IsExpression<VT1>::value, const VT1, const VT1& >::Type LeftOperand;
171 
173  typedef typename SelectType< IsExpression<VT2>::value, const VT2, const VT2& >::Type RightOperand;
174  //**********************************************************************************************
175 
176  //**ConstIterator class definition**************************************************************
180  {
181  public:
182  //**Type definitions*************************************************************************
183  typedef std::random_access_iterator_tag IteratorCategory;
188 
189  // STL iterator requirements
195 
198 
201  //*******************************************************************************************
202 
203  //**Constructor******************************************************************************
209  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right )
210  : left_ ( left ) // Iterator to the current left-hand side element
211  , right_( right ) // Iterator to the current right-hand side element
212  {}
213  //*******************************************************************************************
214 
215  //**Addition assignment operator*************************************************************
221  inline ConstIterator& operator+=( size_t inc ) {
222  left_ += inc;
223  right_ += inc;
224  return *this;
225  }
226  //*******************************************************************************************
227 
228  //**Subtraction assignment operator**********************************************************
234  inline ConstIterator& operator-=( size_t dec ) {
235  left_ -= dec;
236  right_ -= dec;
237  return *this;
238  }
239  //*******************************************************************************************
240 
241  //**Prefix increment operator****************************************************************
247  ++left_;
248  ++right_;
249  return *this;
250  }
251  //*******************************************************************************************
252 
253  //**Postfix increment operator***************************************************************
258  inline const ConstIterator operator++( int ) {
259  return ConstIterator( left_++, right_++ );
260  }
261  //*******************************************************************************************
262 
263  //**Prefix decrement operator****************************************************************
269  --left_;
270  --right_;
271  return *this;
272  }
273  //*******************************************************************************************
274 
275  //**Postfix decrement operator***************************************************************
280  inline const ConstIterator operator--( int ) {
281  return ConstIterator( left_--, right_-- );
282  }
283  //*******************************************************************************************
284 
285  //**Element access operator******************************************************************
290  inline ReturnType operator*() const {
291  return (*left_) + (*right_);
292  }
293  //*******************************************************************************************
294 
295  //**Load function****************************************************************************
300  inline IntrinsicType load() const {
301  return left_.load() + right_.load();
302  }
303  //*******************************************************************************************
304 
305  //**Equality operator************************************************************************
311  inline bool operator==( const ConstIterator& rhs ) const {
312  return left_ == rhs.left_;
313  }
314  //*******************************************************************************************
315 
316  //**Inequality operator**********************************************************************
322  inline bool operator!=( const ConstIterator& rhs ) const {
323  return left_ != rhs.left_;
324  }
325  //*******************************************************************************************
326 
327  //**Less-than operator***********************************************************************
333  inline bool operator<( const ConstIterator& rhs ) const {
334  return left_ < rhs.left_;
335  }
336  //*******************************************************************************************
337 
338  //**Greater-than operator********************************************************************
344  inline bool operator>( const ConstIterator& rhs ) const {
345  return left_ > rhs.left_;
346  }
347  //*******************************************************************************************
348 
349  //**Less-or-equal-than operator**************************************************************
355  inline bool operator<=( const ConstIterator& rhs ) const {
356  return left_ <= rhs.left_;
357  }
358  //*******************************************************************************************
359 
360  //**Greater-or-equal-than operator***********************************************************
366  inline bool operator>=( const ConstIterator& rhs ) const {
367  return left_ >= rhs.left_;
368  }
369  //*******************************************************************************************
370 
371  //**Subtraction operator*********************************************************************
377  inline DifferenceType operator-( const ConstIterator& rhs ) const {
378  return left_ - rhs.left_;
379  }
380  //*******************************************************************************************
381 
382  //**Addition operator************************************************************************
389  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
390  return ConstIterator( it.left_ + inc, it.right_ + inc );
391  }
392  //*******************************************************************************************
393 
394  //**Addition operator************************************************************************
401  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
402  return ConstIterator( it.left_ + inc, it.right_ + inc );
403  }
404  //*******************************************************************************************
405 
406  //**Subtraction operator*********************************************************************
413  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
414  return ConstIterator( it.left_ - dec, it.right_ - dec );
415  }
416  //*******************************************************************************************
417 
418  private:
419  //**Member variables*************************************************************************
422  //*******************************************************************************************
423  };
424  //**********************************************************************************************
425 
426  //**Compilation flags***************************************************************************
428  enum { vectorizable = VT1::vectorizable && VT2::vectorizable &&
431 
433  enum { smpAssignable = VT1::smpAssignable && VT2::smpAssignable };
434  //**********************************************************************************************
435 
436  //**Constructor*********************************************************************************
442  explicit inline DVecDVecAddExpr( const VT1& lhs, const VT2& rhs )
443  : lhs_( lhs ) // Left-hand side dense vector of the addition expression
444  , rhs_( rhs ) // Right-hand side dense vector of the addition expression
445  {
446  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
447  }
448  //**********************************************************************************************
449 
450  //**Subscript operator**************************************************************************
456  inline ReturnType operator[]( size_t index ) const {
457  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
458  return lhs_[index] + rhs_[index];
459  }
460  //**********************************************************************************************
461 
462  //**Load function*******************************************************************************
468  inline IntrinsicType load( size_t index ) const {
469  typedef IntrinsicTrait<ElementType> IT;
470  BLAZE_INTERNAL_ASSERT( index < lhs_.size() , "Invalid vector access index" );
471  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
472  const IntrinsicType xmm1( lhs_.load( index ) );
473  const IntrinsicType xmm2( rhs_.load( index ) );
474  return xmm1 + xmm2;
475  }
476  //**********************************************************************************************
477 
478  //**Begin function******************************************************************************
483  inline ConstIterator begin() const {
484  return ConstIterator( lhs_.begin(), rhs_.begin() );
485  }
486  //**********************************************************************************************
487 
488  //**End function********************************************************************************
493  inline ConstIterator end() const {
494  return ConstIterator( lhs_.end(), rhs_.end() );
495  }
496  //**********************************************************************************************
497 
498  //**Size function*******************************************************************************
503  inline size_t size() const {
504  return lhs_.size();
505  }
506  //**********************************************************************************************
507 
508  //**Left operand access*************************************************************************
513  inline LeftOperand leftOperand() const {
514  return lhs_;
515  }
516  //**********************************************************************************************
517 
518  //**Right operand access************************************************************************
523  inline RightOperand rightOperand() const {
524  return rhs_;
525  }
526  //**********************************************************************************************
527 
528  //**********************************************************************************************
534  template< typename T >
535  inline bool canAlias( const T* alias ) const {
536  return ( IsExpression<VT1>::value && ( RequiresEvaluation<VT1>::value ? lhs_.isAliased( alias ) : lhs_.canAlias( alias ) ) ) ||
537  ( IsExpression<VT2>::value && ( RequiresEvaluation<VT2>::value ? rhs_.isAliased( alias ) : rhs_.canAlias( alias ) ) );
538  }
539  //**********************************************************************************************
540 
541  //**********************************************************************************************
547  template< typename T >
548  inline bool isAliased( const T* alias ) const {
549  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
550  }
551  //**********************************************************************************************
552 
553  //**********************************************************************************************
558  inline bool isAligned() const {
559  return lhs_.isAligned() && rhs_.isAligned();
560  }
561  //**********************************************************************************************
562 
563  //**********************************************************************************************
568  inline bool canSMPAssign() const {
569  return lhs_.canSMPAssign() || rhs_.canSMPAssign() ||
571  }
572  //**********************************************************************************************
573 
574  private:
575  //**Member variables****************************************************************************
578  //**********************************************************************************************
579 
580  //**Assignment to dense vectors*****************************************************************
594  template< typename VT > // Type of the target dense vector
595  friend inline typename EnableIf< UseAssign<VT> >::Type
596  assign( DenseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
597  {
599 
600  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
601 
602  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
603  addAssign( ~lhs, rhs.rhs_ );
604  }
605  else if( !IsComputation<VT2>::value && isSame( ~lhs, rhs.rhs_ ) ) {
606  addAssign( ~lhs, rhs.lhs_ );
607  }
608  else {
609  assign ( ~lhs, rhs.lhs_ );
610  addAssign( ~lhs, rhs.rhs_ );
611  }
612  }
614  //**********************************************************************************************
615 
616  //**Assignment to sparse vectors****************************************************************
630  template< typename VT > // Type of the target sparse vector
631  friend inline typename EnableIf< UseAssign<VT> >::Type
632  assign( SparseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
633  {
635 
639 
640  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
641 
642  const ResultType tmp( serial( rhs ) );
643  assign( ~lhs, tmp );
644  }
646  //**********************************************************************************************
647 
648  //**Addition assignment to dense vectors********************************************************
662  template< typename VT > // Type of the target dense vector
663  friend inline typename EnableIf< UseAssign<VT> >::Type
664  addAssign( DenseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
665  {
667 
668  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
669 
670  addAssign( ~lhs, rhs.lhs_ );
671  addAssign( ~lhs, rhs.rhs_ );
672  }
674  //**********************************************************************************************
675 
676  //**Addition assignment to sparse vectors*******************************************************
677  // No special implementation for the addition assignment to sparse vectors.
678  //**********************************************************************************************
679 
680  //**Subtraction assignment to dense vectors*****************************************************
694  template< typename VT > // Type of the target dense vector
695  friend inline typename EnableIf< UseAssign<VT> >::Type
696  subAssign( DenseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
697  {
699 
700  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
701 
702  subAssign( ~lhs, rhs.lhs_ );
703  subAssign( ~lhs, rhs.rhs_ );
704  }
706  //**********************************************************************************************
707 
708  //**Subtraction assignment to sparse vectors****************************************************
709  // No special implementation for the subtraction assignment to sparse vectors.
710  //**********************************************************************************************
711 
712  //**Multiplication assignment to dense vectors**************************************************
726  template< typename VT > // Type of the target dense vector
727  friend inline typename EnableIf< UseAssign<VT> >::Type
728  multAssign( DenseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
729  {
731 
735 
736  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
737 
738  const ResultType tmp( serial( rhs ) );
739  multAssign( ~lhs, tmp );
740  }
742  //**********************************************************************************************
743 
744  //**Multiplication assignment to sparse vectors*************************************************
745  // No special implementation for the multiplication assignment to sparse vectors.
746  //**********************************************************************************************
747 
748  //**SMP assignment to dense vectors*************************************************************
762  template< typename VT > // Type of the target dense vector
763  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
764  smpAssign( DenseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
765  {
767 
768  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
769 
770  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
771  smpAddAssign( ~lhs, rhs.rhs_ );
772  }
773  else if( !IsComputation<VT2>::value && isSame( ~lhs, rhs.rhs_ ) ) {
774  smpAddAssign( ~lhs, rhs.lhs_ );
775  }
776  else {
777  smpAssign ( ~lhs, rhs.lhs_ );
778  smpAddAssign( ~lhs, rhs.rhs_ );
779  }
780  }
782  //**********************************************************************************************
783 
784  //**SMP assignment to sparse vectors************************************************************
798  template< typename VT > // Type of the target sparse vector
799  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
800  smpAssign( SparseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
801  {
803 
807 
808  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
809 
810  const ResultType tmp( rhs );
811  smpAssign( ~lhs, tmp );
812  }
814  //**********************************************************************************************
815 
816  //**SMP addition assignment to dense vectors****************************************************
830  template< typename VT > // Type of the target dense vector
831  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
832  smpAddAssign( DenseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
833  {
835 
836  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
837 
838  smpAddAssign( ~lhs, rhs.lhs_ );
839  smpAddAssign( ~lhs, rhs.rhs_ );
840  }
842  //**********************************************************************************************
843 
844  //**SMP addition assignment to sparse vectors***************************************************
845  // No special implementation for the SMP addition assignment to sparse vectors.
846  //**********************************************************************************************
847 
848  //**SMP subtraction assignment to dense vectors*************************************************
862  template< typename VT > // Type of the target dense vector
863  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
864  smpSubAssign( DenseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
865  {
867 
868  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
869 
870  smpSubAssign( ~lhs, rhs.lhs_ );
871  smpSubAssign( ~lhs, rhs.rhs_ );
872  }
874  //**********************************************************************************************
875 
876  //**SMP subtraction assignment to sparse vectors************************************************
877  // No special implementation for the SMP subtraction assignment to sparse vectors.
878  //**********************************************************************************************
879 
880  //**SMP multiplication assignment to dense vectors**********************************************
894  template< typename VT > // Type of the target dense vector
895  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
896  smpMultAssign( DenseVector<VT,TF>& lhs, const DVecDVecAddExpr& rhs )
897  {
899 
903 
904  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
905 
906  const ResultType tmp( rhs );
907  smpMultAssign( ~lhs, tmp );
908  }
910  //**********************************************************************************************
911 
912  //**SMP multiplication assignment to sparse vectors*********************************************
913  // No special implementation for the SMP multiplication assignment to sparse vectors.
914  //**********************************************************************************************
915 
916  //**Compile time checks*************************************************************************
924  //**********************************************************************************************
925 };
926 //*************************************************************************************************
927 
928 
929 
930 
931 //=================================================================================================
932 //
933 // GLOBAL BINARY ARITHMETIC OPERATORS
934 //
935 //=================================================================================================
936 
937 //*************************************************************************************************
961 template< typename T1 // Type of the left-hand side dense vector
962  , typename T2 // Type of the right-hand side dense vector
963  , bool TF > // Transpose flag
964 inline const DVecDVecAddExpr<T1,T2,TF>
966 {
968 
969  if( (~lhs).size() != (~rhs).size() )
970  throw std::invalid_argument( "Vector sizes do not match" );
971 
972  return DVecDVecAddExpr<T1,T2,TF>( ~lhs, ~rhs );
973 }
974 //*************************************************************************************************
975 
976 
977 
978 
979 //=================================================================================================
980 //
981 // SIZE SPECIALIZATIONS
982 //
983 //=================================================================================================
984 
985 //*************************************************************************************************
987 template< typename VT1, typename VT2, bool TF >
988 struct Size< DVecDVecAddExpr<VT1,VT2,TF> >
989  : public Max< Size<VT1>, Size<VT2> >::Type
990 {};
992 //*************************************************************************************************
993 
994 
995 
996 
997 //=================================================================================================
998 //
999 // EXPRESSION TRAIT SPECIALIZATIONS
1000 //
1001 //=================================================================================================
1002 
1003 //*************************************************************************************************
1005 template< typename VT1, typename VT2, bool TF, bool AF >
1006 struct SubvectorExprTrait< DVecDVecAddExpr<VT1,VT2,TF>, AF >
1007 {
1008  public:
1009  //**********************************************************************************************
1010  typedef typename AddExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
1011  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
1012  //**********************************************************************************************
1013 };
1015 //*************************************************************************************************
1016 
1017 } // namespace blaze
1018 
1019 #endif
VT1::ReturnType RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:100
Iterator over the elements of the dense vector.
Definition: DVecDVecAddExpr.h:179
Pointer difference type of the Blaze library.
ConstIterator(LeftIteratorType left, RightIteratorType right)
Constructor for the ConstIterator class.
Definition: DVecDVecAddExpr.h:209
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
BLAZE_ALWAYS_INLINE 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:879
Evaluation of the return type of an addition expression.Via this type trait it is possible to evaluat...
Definition: AddExprTrait.h:104
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:377
PointerType pointer
Pointer return type.
Definition: DVecDVecAddExpr.h:192
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecAddExpr.h:535
IteratorCategory iterator_category
The iterator category.
Definition: DVecDVecAddExpr.h:190
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
VT2::ResultType RE2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:99
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecDVecAddExpr.h:483
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:946
Header file for the IsSame and IsStrictlySame type traits.
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecDVecAddExpr.h:503
VT1::ConstIterator LeftIteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:197
ElementType ValueType
Type of the underlying elements.
Definition: DVecDVecAddExpr.h:184
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2478
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:257
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:311
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:170
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecDVecAddExpr.h:290
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:695
DVecDVecAddExpr< VT1, VT2, TF > This
Type of this DVecDVecAddExpr instance.
Definition: DVecDVecAddExpr.h:157
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:577
Header file for the RequiresEvaluation type trait.
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecDVecAddExpr.h:183
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecDVecAddExpr.h:161
Constraint on the data type.
SelectType< useAssign, const ResultType, const DVecDVecAddExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecDVecAddExpr.h:167
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecDVecAddExpr.h:513
Constraint on the data type.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecDVecAddExpr.h:234
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecDVecAddExpr.h:568
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:259
AddTrait< RE1, RE2 >::Type ResultType
Result type for expression template evaluations.
Definition: DVecDVecAddExpr.h:158
VT1::ResultType RE1
Result type of the left-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:98
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecDVecAddExpr.h:401
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:187
VT1::CompositeType CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:102
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:355
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecDVecAddExpr.h:268
Header file for the VecVecAddExpr base class.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:344
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_VECVECADDEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid vector/vector ...
Definition: VecVecAddExpr.h:165
BLAZE_ALWAYS_INLINE 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:635
VT2::ElementType ET2
Element type of the right-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:105
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecDVecAddExpr.h:164
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecDVecAddExpr.h:558
ElementType & ReferenceType
Reference return type.
Definition: DVecDVecAddExpr.h:186
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:421
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:118
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecDVecAddExpr.h:221
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
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:200
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.
Constraint on the data type.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecAddExpr.h:280
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecDVecAddExpr.h:493
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
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:366
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2477
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:749
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:142
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
ElementType * PointerType
Pointer return type.
Definition: DVecDVecAddExpr.h:185
Header file for the addition trait.
BLAZE_ALWAYS_INLINE 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:742
RightOperand rightOperand() const
Returns the right-hand side dense vector operand.
Definition: DVecDVecAddExpr.h:523
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:104
SelectType< IsExpression< VT2 >::value, const VT2, const VT2 & >::Type RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:173
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecDVecAddExpr.h:258
VT2::ReturnType RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:101
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecDVecAddExpr.h:420
LeftOperand lhs_
Left-hand side dense vector of the addition expression.
Definition: DVecDVecAddExpr.h:576
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecDVecAddExpr.h:413
Expression object for dense vector-dense vector additions.The DVecDVecAddExpr class represents the co...
Definition: DVecDVecAddExpr.h:92
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecAddExpr.h:389
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:456
#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:468
ValueType value_type
Type of the underlying elements.
Definition: DVecDVecAddExpr.h:191
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:322
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecAddExpr.h:246
DifferenceType difference_type
Difference between two iterators.
Definition: DVecDVecAddExpr.h:194
VT2::CompositeType CT2
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:103
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
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
DVecDVecAddExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the DVecDVecAddExpr class.
Definition: DVecDVecAddExpr.h:442
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:159
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecDVecAddExpr.h:548
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:333
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
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:300
Constraint on the data type.
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.
#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:193
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.
BLAZE_ALWAYS_INLINE 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:849
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecDVecAddExpr.h:160