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>
61 #include <blaze/util/Assert.h>
65 #include <blaze/util/EnableIf.h>
67 #include <blaze/util/SelectType.h>
68 #include <blaze/util/Types.h>
70 
71 
72 namespace blaze {
73 
74 //=================================================================================================
75 //
76 // CLASS DVECDVECADDEXPR
77 //
78 //=================================================================================================
79 
80 //*************************************************************************************************
87 template< typename VT1 // Type of the left-hand side dense vector
88  , typename VT2 // Type of the right-hand side dense vector
89  , bool TF > // Transpose flag
90 class DVecDVecAddExpr : public DenseVector< DVecDVecAddExpr<VT1,VT2,TF>, TF >
91  , private VecVecAddExpr
92  , private Computation
93 {
94  private:
95  //**Type definitions****************************************************************************
96  typedef typename VT1::ResultType RE1;
97  typedef typename VT2::ResultType RE2;
98  typedef typename VT1::ReturnType RN1;
99  typedef typename VT2::ReturnType RN2;
100  typedef typename VT1::CompositeType CT1;
101  typedef typename VT2::CompositeType CT2;
102  typedef typename VT1::ElementType ET1;
103  typedef typename VT2::ElementType ET2;
104  //**********************************************************************************************
105 
106  //**Return type evaluation**********************************************************************
108 
113  enum { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
114 
117  //**********************************************************************************************
118 
119  //**Evaluation strategy*************************************************************************
121 
127  enum { useAssign = ( RequiresEvaluation<VT1>::value || RequiresEvaluation<VT2>::value || !returnExpr ) };
128 
130  template< typename VT >
132  struct UseAssign {
133  enum { value = useAssign };
134  };
136  //**********************************************************************************************
137 
138  public:
139  //**Type definitions****************************************************************************
145 
148 
151 
153  typedef typename SelectType< IsExpression<VT1>::value, const VT1, const VT1& >::Type LeftOperand;
154 
156  typedef typename SelectType< IsExpression<VT2>::value, const VT2, const VT2& >::Type RightOperand;
157  //**********************************************************************************************
158 
159  //**ConstIterator class definition**************************************************************
163  {
164  public:
165  //**Type definitions*************************************************************************
166  typedef std::random_access_iterator_tag IteratorCategory;
167  typedef ElementType ValueType;
168  typedef ElementType* PointerType;
169  typedef ElementType& ReferenceType;
171 
172  // STL iterator requirements
178 
181 
184  //*******************************************************************************************
185 
186  //**Constructor******************************************************************************
192  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right )
193  : left_ ( left ) // Iterator to the current left-hand side element
194  , right_( right ) // Iterator to the current right-hand side element
195  {}
196  //*******************************************************************************************
197 
198  //**Addition assignment operator*************************************************************
204  inline ConstIterator& operator+=( size_t inc ) {
205  left_ += inc;
206  right_ += inc;
207  return *this;
208  }
209  //*******************************************************************************************
210 
211  //**Subtraction assignment operator**********************************************************
217  inline ConstIterator& operator-=( size_t dec ) {
218  left_ -= dec;
219  right_ -= dec;
220  return *this;
221  }
222  //*******************************************************************************************
223 
224  //**Prefix increment operator****************************************************************
230  ++left_;
231  ++right_;
232  return *this;
233  }
234  //*******************************************************************************************
235 
236  //**Postfix increment operator***************************************************************
241  inline const ConstIterator operator++( int ) {
242  return ConstIterator( left_++, right_++ );
243  }
244  //*******************************************************************************************
245 
246  //**Prefix decrement operator****************************************************************
252  --left_;
253  --right_;
254  return *this;
255  }
256  //*******************************************************************************************
257 
258  //**Postfix decrement operator***************************************************************
263  inline const ConstIterator operator--( int ) {
264  return ConstIterator( left_--, right_-- );
265  }
266  //*******************************************************************************************
267 
268  //**Element access operator******************************************************************
273  inline ReturnType operator*() const {
274  return (*left_) + (*right_);
275  }
276  //*******************************************************************************************
277 
278  //**Load function****************************************************************************
283  inline IntrinsicType load() const {
284  return left_.load() + right_.load();
285  }
286  //*******************************************************************************************
287 
288  //**Equality operator************************************************************************
294  inline bool operator==( const ConstIterator& rhs ) const {
295  return left_ == rhs.left_;
296  }
297  //*******************************************************************************************
298 
299  //**Inequality operator**********************************************************************
305  inline bool operator!=( const ConstIterator& rhs ) const {
306  return left_ != rhs.left_;
307  }
308  //*******************************************************************************************
309 
310  //**Less-than operator***********************************************************************
316  inline bool operator<( const ConstIterator& rhs ) const {
317  return left_ < rhs.left_;
318  }
319  //*******************************************************************************************
320 
321  //**Greater-than operator********************************************************************
327  inline bool operator>( const ConstIterator& rhs ) const {
328  return left_ > rhs.left_;
329  }
330  //*******************************************************************************************
331 
332  //**Less-or-equal-than operator**************************************************************
338  inline bool operator<=( const ConstIterator& rhs ) const {
339  return left_ <= rhs.left_;
340  }
341  //*******************************************************************************************
342 
343  //**Greater-or-equal-than operator***********************************************************
349  inline bool operator>=( const ConstIterator& rhs ) const {
350  return left_ >= rhs.left_;
351  }
352  //*******************************************************************************************
353 
354  //**Subtraction operator*********************************************************************
360  inline DifferenceType operator-( const ConstIterator& rhs ) const {
361  return left_ - rhs.left_;
362  }
363  //*******************************************************************************************
364 
365  //**Addition operator************************************************************************
372  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
373  return ConstIterator( it.left_ + inc, it.right_ + inc );
374  }
375  //*******************************************************************************************
376 
377  //**Addition operator************************************************************************
384  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
385  return ConstIterator( it.left_ + inc, it.right_ + inc );
386  }
387  //*******************************************************************************************
388 
389  //**Subtraction operator*********************************************************************
396  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
397  return ConstIterator( it.left_ - dec, it.right_ - dec );
398  }
399  //*******************************************************************************************
400 
401  private:
402  //**Member variables*************************************************************************
405  //*******************************************************************************************
406  };
407  //**********************************************************************************************
408 
409  //**Compilation flags***************************************************************************
411  enum { vectorizable = VT1::vectorizable && VT2::vectorizable &&
414 
416  enum { smpAssignable = VT1::smpAssignable && VT2::smpAssignable };
417  //**********************************************************************************************
418 
419  //**Constructor*********************************************************************************
425  explicit inline DVecDVecAddExpr( const VT1& lhs, const VT2& rhs )
426  : lhs_( lhs ) // Left-hand side dense vector of the addition expression
427  , rhs_( rhs ) // Right-hand side dense vector of the addition expression
428  {
429  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
430  }
431  //**********************************************************************************************
432 
433  //**Subscript operator**************************************************************************
439  inline ReturnType operator[]( size_t index ) const {
440  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
441  return lhs_[index] + rhs_[index];
442  }
443  //**********************************************************************************************
444 
445  //**Load function*******************************************************************************
451  inline IntrinsicType load( size_t index ) const {
452  typedef IntrinsicTrait<ElementType> IT;
453  BLAZE_INTERNAL_ASSERT( index < lhs_.size() , "Invalid vector access index" );
454  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
455  const IntrinsicType xmm1( lhs_.load( index ) );
456  const IntrinsicType xmm2( rhs_.load( index ) );
457  return xmm1 + xmm2;
458  }
459  //**********************************************************************************************
460 
461  //**Begin function******************************************************************************
466  inline ConstIterator begin() const {
467  return ConstIterator( lhs_.begin(), rhs_.begin() );
468  }
469  //**********************************************************************************************
470 
471  //**End function********************************************************************************
476  inline ConstIterator end() const {
477  return ConstIterator( lhs_.end(), rhs_.end() );
478  }
479  //**********************************************************************************************
480 
481  //**Size function*******************************************************************************
486  inline size_t size() const {
487  return lhs_.size();
488  }
489  //**********************************************************************************************
490 
491  //**Left operand access*************************************************************************
496  inline LeftOperand leftOperand() const {
497  return lhs_;
498  }
499  //**********************************************************************************************
500 
501  //**Right operand access************************************************************************
506  inline RightOperand rightOperand() const {
507  return rhs_;
508  }
509  //**********************************************************************************************
510 
511  //**********************************************************************************************
517  template< typename T >
518  inline bool canAlias( const T* alias ) const {
519  return ( IsComputation<VT1>::value && ( RequiresEvaluation<VT1>::value ? lhs_.isAliased( alias ) : lhs_.canAlias( alias ) ) ) ||
520  ( IsComputation<VT2>::value && ( RequiresEvaluation<VT2>::value ? rhs_.isAliased( alias ) : rhs_.canAlias( alias ) ) );
521  }
522  //**********************************************************************************************
523 
524  //**********************************************************************************************
530  template< typename T >
531  inline bool isAliased( const T* alias ) const {
532  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
533  }
534  //**********************************************************************************************
535 
536  //**********************************************************************************************
541  inline bool isAligned() const {
542  return lhs_.isAligned() && rhs_.isAligned();
543  }
544  //**********************************************************************************************
545 
546  //**********************************************************************************************
551  inline bool canSMPAssign() const {
552  return lhs_.canSMPAssign() || rhs_.canSMPAssign() ||
554  }
555  //**********************************************************************************************
556 
557  private:
558  //**Member variables****************************************************************************
559  LeftOperand lhs_;
560  RightOperand rhs_;
561  //**********************************************************************************************
562 
563  //**Assignment to dense vectors*****************************************************************
577  template< typename VT3 > // Type of the target dense vector
578  friend inline typename EnableIf< UseAssign<VT3> >::Type
579  assign( DenseVector<VT3,TF>& lhs, const DVecDVecAddExpr& rhs )
580  {
582 
583  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
584 
585  if( !IsComputation<VT1>::value && (~lhs).isAliased( &rhs.lhs_ ) ) {
586  smpAddAssign( ~lhs, rhs.rhs_ );
587  }
588  else if( !IsComputation<VT2>::value && (~lhs).isAliased( &rhs.rhs_ ) ) {
589  smpAddAssign( ~lhs, rhs.lhs_ );
590  }
591  else {
592  smpAssign ( ~lhs, rhs.lhs_ );
593  smpAddAssign( ~lhs, rhs.rhs_ );
594  }
595  }
597  //**********************************************************************************************
598 
599  //**Assignment to sparse vectors****************************************************************
613  template< typename VT3 > // Type of the target sparse vector
614  friend inline typename EnableIf< UseAssign<VT3> >::Type
615  assign( SparseVector<VT3,TF>& lhs, const DVecDVecAddExpr& rhs )
616  {
618 
622 
623  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
624 
625  const ResultType tmp( rhs );
626  smpAssign( ~lhs, tmp );
627  }
629  //**********************************************************************************************
630 
631  //**Addition assignment to dense vectors********************************************************
645  template< typename VT3 > // Type of the target dense vector
646  friend inline typename EnableIf< UseAssign<VT3> >::Type
647  addAssign( DenseVector<VT3,TF>& lhs, const DVecDVecAddExpr& rhs )
648  {
650 
651  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
652 
653  smpAddAssign( ~lhs, rhs.lhs_ );
654  smpAddAssign( ~lhs, rhs.rhs_ );
655  }
657  //**********************************************************************************************
658 
659  //**Addition assignment to sparse vectors*******************************************************
660  // No special implementation for the addition assignment to sparse vectors.
661  //**********************************************************************************************
662 
663  //**Subtraction assignment to dense vectors*****************************************************
677  template< typename VT3 > // Type of the target dense vector
678  friend inline typename EnableIf< UseAssign<VT3> >::Type
679  subAssign( DenseVector<VT3,TF>& lhs, const DVecDVecAddExpr& rhs )
680  {
682 
683  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
684 
685  smpSubAssign( ~lhs, rhs.lhs_ );
686  smpSubAssign( ~lhs, rhs.rhs_ );
687  }
689  //**********************************************************************************************
690 
691  //**Subtraction assignment to sparse vectors****************************************************
692  // No special implementation for the subtraction assignment to sparse vectors.
693  //**********************************************************************************************
694 
695  //**Multiplication assignment to dense vectors**************************************************
709  template< typename VT3 > // Type of the target dense vector
710  friend inline typename EnableIf< UseAssign<VT3> >::Type
711  multAssign( DenseVector<VT3,TF>& lhs, const DVecDVecAddExpr& rhs )
712  {
714 
718 
719  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
720 
721  const ResultType tmp( rhs );
722  smpMultAssign( ~lhs, tmp );
723  }
725  //**********************************************************************************************
726 
727  //**Multiplication assignment to sparse vectors*************************************************
728  // No special implementation for the multiplication assignment to sparse vectors.
729  //**********************************************************************************************
730 
731  //**Compile time checks*************************************************************************
738  //**********************************************************************************************
739 };
740 //*************************************************************************************************
741 
742 
743 
744 
745 //=================================================================================================
746 //
747 // GLOBAL BINARY ARITHMETIC OPERATORS
748 //
749 //=================================================================================================
750 
751 //*************************************************************************************************
775 template< typename T1 // Type of the left-hand side dense vector
776  , typename T2 // Type of the right-hand side dense vector
777  , bool TF > // Transpose flag
778 inline const DVecDVecAddExpr<T1,T2,TF>
780 {
782 
783  if( (~lhs).size() != (~rhs).size() )
784  throw std::invalid_argument( "Vector sizes do not match" );
785 
786  return DVecDVecAddExpr<T1,T2,TF>( ~lhs, ~rhs );
787 }
788 //*************************************************************************************************
789 
790 
791 
792 
793 //=================================================================================================
794 //
795 // EXPRESSION TRAIT SPECIALIZATIONS
796 //
797 //=================================================================================================
798 
799 //*************************************************************************************************
801 template< typename VT1, typename VT2, bool TF, bool AF >
802 struct SubvectorExprTrait< DVecDVecAddExpr<VT1,VT2,TF>, AF >
803 {
804  public:
805  //**********************************************************************************************
806  typedef typename AddExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
807  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
808  //**********************************************************************************************
809 };
811 //*************************************************************************************************
812 
813 } // namespace blaze
814 
815 #endif
VT1::ReturnType RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:98
Iterator over the elements of the dense vector.
Definition: DVecDVecAddExpr.h:162
Pointer difference type of the Blaze library.
ConstIterator(LeftIteratorType left, RightIteratorType right)
Constructor for the ConstIterator class.
Definition: DVecDVecAddExpr.h:192
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:360
PointerType pointer
Pointer return type.
Definition: DVecDVecAddExpr.h:175
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecAddExpr.h:518
IteratorCategory iterator_category
The iterator category.
Definition: DVecDVecAddExpr.h:173
VT2::ResultType RE2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:97
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
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:197
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecDVecAddExpr.h:466
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.
const size_t SMP_DVECDVECADD_THRESHOLD
SMP dense vector/dense vector addition threshold.This threshold represents the system-specific thresh...
Definition: Thresholds.h:87
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecDVecAddExpr.h:486
VT1::ConstIterator LeftIteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:180
ElementType ValueType
Type of the underlying elements.
Definition: DVecDVecAddExpr.h:167
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
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:294
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:153
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecDVecAddExpr.h:273
Header file for the AddExprTrait class template.
DVecDVecAddExpr< VT1, VT2, TF > This
Type of this DVecDVecAddExpr instance.
Definition: DVecDVecAddExpr.h:140
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:560
Header file for the RequiresEvaluation type trait.
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecDVecAddExpr.h:166
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecDVecAddExpr.h:144
Constraint on the data type.
SelectType< useAssign, const ResultType, const DVecDVecAddExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecDVecAddExpr.h:150
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecDVecAddExpr.h:496
Constraint on the data type.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecDVecAddExpr.h:217
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecDVecAddExpr.h:551
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
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:251
AddTrait< RE1, RE2 >::Type ResultType
Result type for expression template evaluations.
Definition: DVecDVecAddExpr.h:141
VT1::ResultType RE1
Result type of the left-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:96
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecDVecAddExpr.h:384
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:170
VT1::CompositeType CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:100
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:338
Header file for the dense vector SMP implementation.
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecDVecAddExpr.h:251
Header file for the VecVecAddExpr base class.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2388
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:327
VT2::ElementType ET2
Element type of the right-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:103
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecDVecAddExpr.h:147
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecDVecAddExpr.h:541
ElementType & ReferenceType
Reference return type.
Definition: DVecDVecAddExpr.h:169
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
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:404
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:116
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecDVecAddExpr.h:204
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2382
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 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:183
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.
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
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecAddExpr.h:263
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecDVecAddExpr.h:476
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:349
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.
Base template for the AddTrait class.
Definition: AddTrait.h:141
ElementType * PointerType
Pointer return type.
Definition: DVecDVecAddExpr.h:168
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:209
RightOperand rightOperand() const
Returns the right-hand side dense vector operand.
Definition: DVecDVecAddExpr.h:506
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:102
SelectType< IsExpression< VT2 >::value, const VT2, const VT2 & >::Type RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:156
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
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecDVecAddExpr.h:241
VT2::ReturnType RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:99
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecDVecAddExpr.h:403
LeftOperand lhs_
Left-hand side dense vector of the addition expression.
Definition: DVecDVecAddExpr.h:559
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecDVecAddExpr.h:396
Expression object for dense vector-dense vector additions.The DVecDVecAddExpr class represents the co...
Definition: DVecDVecAddExpr.h:90
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecAddExpr.h:372
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:439
#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:451
ValueType value_type
Type of the underlying elements.
Definition: DVecDVecAddExpr.h:174
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:305
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecAddExpr.h:229
DifferenceType difference_type
Difference between two iterators.
Definition: DVecDVecAddExpr.h:177
VT2::CompositeType CT2
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecAddExpr.h:101
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.
DVecDVecAddExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the DVecDVecAddExpr class.
Definition: DVecDVecAddExpr.h:425
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
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecDVecAddExpr.h:142
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecDVecAddExpr.h:531
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecAddExpr.h:316
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2379
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:283
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:176
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecDVecAddExpr.h:143