All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DVecDVecMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECDVECMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECDVECMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <stdexcept>
50 #include <blaze/math/Intrinsics.h>
60 #include <blaze/util/Assert.h>
62 #include <blaze/util/EnableIf.h>
64 #include <blaze/util/SelectType.h>
65 #include <blaze/util/Types.h>
67 
68 
69 namespace blaze {
70 
71 //=================================================================================================
72 //
73 // CLASS DVECDVECMULTEXPR
74 //
75 //=================================================================================================
76 
77 //*************************************************************************************************
84 template< typename VT1 // Type of the left-hand side dense vector
85  , typename VT2 // Type of the right-hand side dense vector
86  , bool TF > // Transpose flag
87 class DVecDVecMultExpr : public DenseVector< DVecDVecMultExpr<VT1,VT2,TF>, TF >
88  , private VecVecMultExpr
89  , private Computation
90 {
91  private:
92  //**Type definitions****************************************************************************
93  typedef typename VT1::ResultType RT1;
94  typedef typename VT2::ResultType RT2;
95  typedef typename VT1::ReturnType RN1;
96  typedef typename VT2::ReturnType RN2;
97  typedef typename VT1::CompositeType CT1;
98  typedef typename VT2::CompositeType CT2;
99  typedef typename VT1::ElementType ET1;
100  typedef typename VT2::ElementType ET2;
101  //**********************************************************************************************
102 
103  //**Return type evaluation**********************************************************************
105 
110  enum { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
111 
114  //**********************************************************************************************
115 
116  //**Serial evaluation strategy******************************************************************
118 
124  enum { useAssign = ( RequiresEvaluation<VT1>::value || RequiresEvaluation<VT2>::value || !returnExpr ) };
125 
127  template< typename VT >
129  struct UseAssign {
130  enum { value = useAssign };
131  };
133  //**********************************************************************************************
134 
135  //**Parallel evaluation strategy****************************************************************
137 
143  template< typename VT >
144  struct UseSMPAssign {
145  enum { value = ( !VT1::smpAssignable || !VT2::smpAssignable ) && useAssign };
146  };
148  //**********************************************************************************************
149 
150  public:
151  //**Type definitions****************************************************************************
157 
160 
163 
165  typedef typename SelectType< IsExpression<VT1>::value, const VT1, const VT1& >::Type LeftOperand;
166 
168  typedef typename SelectType< IsExpression<VT2>::value, const VT2, const VT2& >::Type RightOperand;
169  //**********************************************************************************************
170 
171  //**ConstIterator class definition**************************************************************
175  {
176  public:
177  //**Type definitions*************************************************************************
178  typedef std::random_access_iterator_tag IteratorCategory;
183 
184  // STL iterator requirements
190 
193 
196  //*******************************************************************************************
197 
198  //**Constructor******************************************************************************
204  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right )
205  : left_ ( left ) // Iterator to the current left-hand side element
206  , right_( right ) // Iterator to the current right-hand side element
207  {}
208  //*******************************************************************************************
209 
210  //**Addition assignment operator*************************************************************
216  inline ConstIterator& operator+=( size_t inc ) {
217  left_ += inc;
218  right_ += inc;
219  return *this;
220  }
221  //*******************************************************************************************
222 
223  //**Subtraction assignment operator**********************************************************
229  inline ConstIterator& operator-=( size_t dec ) {
230  left_ -= dec;
231  right_ -= dec;
232  return *this;
233  }
234  //*******************************************************************************************
235 
236  //**Prefix increment operator****************************************************************
242  ++left_;
243  ++right_;
244  return *this;
245  }
246  //*******************************************************************************************
247 
248  //**Postfix increment operator***************************************************************
253  inline const ConstIterator operator++( int ) {
254  return ConstIterator( left_++, right_++ );
255  }
256  //*******************************************************************************************
257 
258  //**Prefix decrement operator****************************************************************
264  --left_;
265  --right_;
266  return *this;
267  }
268  //*******************************************************************************************
269 
270  //**Postfix decrement operator***************************************************************
275  inline const ConstIterator operator--( int ) {
276  return ConstIterator( left_--, right_-- );
277  }
278  //*******************************************************************************************
279 
280  //**Element access operator******************************************************************
285  inline ReturnType operator*() const {
286  return (*left_) * (*right_);
287  }
288  //*******************************************************************************************
289 
290  //**Load function****************************************************************************
295  inline IntrinsicType load() const {
296  return left_.load() * right_.load();
297  }
298  //*******************************************************************************************
299 
300  //**Equality operator************************************************************************
306  inline bool operator==( const ConstIterator& rhs ) const {
307  return left_ == rhs.left_;
308  }
309  //*******************************************************************************************
310 
311  //**Inequality operator**********************************************************************
317  inline bool operator!=( const ConstIterator& rhs ) const {
318  return left_ != rhs.left_;
319  }
320  //*******************************************************************************************
321 
322  //**Less-than operator***********************************************************************
328  inline bool operator<( const ConstIterator& rhs ) const {
329  return left_ < rhs.left_;
330  }
331  //*******************************************************************************************
332 
333  //**Greater-than operator********************************************************************
339  inline bool operator>( const ConstIterator& rhs ) const {
340  return left_ > rhs.left_;
341  }
342  //*******************************************************************************************
343 
344  //**Less-or-equal-than operator**************************************************************
350  inline bool operator<=( const ConstIterator& rhs ) const {
351  return left_ <= rhs.left_;
352  }
353  //*******************************************************************************************
354 
355  //**Greater-or-equal-than operator***********************************************************
361  inline bool operator>=( const ConstIterator& rhs ) const {
362  return left_ >= rhs.left_;
363  }
364  //*******************************************************************************************
365 
366  //**Subtraction operator*********************************************************************
372  inline DifferenceType operator-( const ConstIterator& rhs ) const {
373  return left_ - rhs.left_;
374  }
375  //*******************************************************************************************
376 
377  //**Addition operator************************************************************************
384  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
385  return ConstIterator( it.left_ + inc, it.right_ + inc );
386  }
387  //*******************************************************************************************
388 
389  //**Addition operator************************************************************************
396  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
397  return ConstIterator( it.left_ + inc, it.right_ + inc );
398  }
399  //*******************************************************************************************
400 
401  //**Subtraction operator*********************************************************************
408  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
409  return ConstIterator( it.left_ - dec, it.right_ - dec );
410  }
411  //*******************************************************************************************
412 
413  private:
414  //**Member variables*************************************************************************
417  //*******************************************************************************************
418  };
419  //**********************************************************************************************
420 
421  //**Compilation flags***************************************************************************
423  enum { vectorizable = VT1::vectorizable && VT2::vectorizable &&
426 
428  enum { smpAssignable = VT1::smpAssignable && VT2::smpAssignable };
429  //**********************************************************************************************
430 
431  //**Constructor*********************************************************************************
437  explicit inline DVecDVecMultExpr( const VT1& lhs, const VT2& rhs )
438  : lhs_( lhs ) // Left-hand side dense vector of the multiplication expression
439  , rhs_( rhs ) // Right-hand side dense vector of the multiplication expression
440  {
441  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
442  }
443  //**********************************************************************************************
444 
445  //**Subscript operator**************************************************************************
451  inline ReturnType operator[]( size_t index ) const {
452  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
453  return lhs_[index] * rhs_[index];
454  }
455  //**********************************************************************************************
456 
457  //**Load function*******************************************************************************
463  inline IntrinsicType load( size_t index ) const {
464  typedef IntrinsicTrait<ElementType> IT;
465  BLAZE_INTERNAL_ASSERT( index < lhs_.size() , "Invalid vector access index" );
466  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
467  const IntrinsicType xmm1( lhs_.load( index ) );
468  const IntrinsicType xmm2( rhs_.load( index ) );
469  return xmm1 * xmm2;
470  }
471  //**********************************************************************************************
472 
473  //**Begin function******************************************************************************
478  inline ConstIterator begin() const {
479  return ConstIterator( lhs_.begin(), rhs_.begin() );
480  }
481  //**********************************************************************************************
482 
483  //**End function********************************************************************************
488  inline ConstIterator end() const {
489  return ConstIterator( lhs_.end(), rhs_.end() );
490  }
491  //**********************************************************************************************
492 
493  //**Size function*******************************************************************************
498  inline size_t size() const {
499  return lhs_.size();
500  }
501  //**********************************************************************************************
502 
503  //**Left operand access*************************************************************************
508  inline LeftOperand leftOperand() const {
509  return lhs_;
510  }
511  //**********************************************************************************************
512 
513  //**Right operand access************************************************************************
518  inline RightOperand rightOperand() const {
519  return rhs_;
520  }
521  //**********************************************************************************************
522 
523  //**********************************************************************************************
529  template< typename T >
530  inline bool canAlias( const T* alias ) const {
531  return ( IsExpression<VT1>::value && ( RequiresEvaluation<VT1>::value ? lhs_.isAliased( alias ) : lhs_.canAlias( alias ) ) ) ||
532  ( IsExpression<VT2>::value && ( RequiresEvaluation<VT2>::value ? rhs_.isAliased( alias ) : rhs_.canAlias( alias ) ) );
533  }
534  //**********************************************************************************************
535 
536  //**********************************************************************************************
542  template< typename T >
543  inline bool isAliased( const T* alias ) const {
544  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
545  }
546  //**********************************************************************************************
547 
548  //**********************************************************************************************
553  inline bool isAligned() const {
554  return lhs_.isAligned() && rhs_.isAligned();
555  }
556  //**********************************************************************************************
557 
558  //**********************************************************************************************
563  inline bool canSMPAssign() const {
564  return lhs_.canSMPAssign() || rhs_.canSMPAssign() ||
566  }
567  //**********************************************************************************************
568 
569  private:
570  //**Member variables****************************************************************************
573  //**********************************************************************************************
574 
575  //**Assignment to dense vectors*****************************************************************
589  template< typename VT > // Type of the target dense vector
590  friend inline typename EnableIf< UseAssign<VT> >::Type
591  assign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
592  {
594 
595  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
596 
597  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
598  multAssign( ~lhs, rhs.rhs_ );
599  }
600  else if( !IsComputation<VT2>::value && isSame( ~lhs, rhs.rhs_ ) ) {
601  multAssign( ~lhs, rhs.lhs_ );
602  }
603  else {
604  assign ( ~lhs, rhs.lhs_ );
605  multAssign( ~lhs, rhs.rhs_ );
606  }
607  }
609  //**********************************************************************************************
610 
611  //**Assignment to sparse vectors****************************************************************
625  template< typename VT > // Type of the target sparse vector
626  friend inline typename EnableIf< UseAssign<VT> >::Type
627  assign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
628  {
630 
634 
635  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
636 
637  const ResultType tmp( serial( rhs ) );
638  assign( ~lhs, tmp );
639  }
641  //**********************************************************************************************
642 
643  //**Addition assignment to dense vectors********************************************************
657  template< typename VT > // Type of the target dense vector
658  friend inline typename EnableIf< UseAssign<VT> >::Type
659  addAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
660  {
662 
666 
667  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
668 
669  const ResultType tmp( serial( rhs ) );
670  addAssign( ~lhs, tmp );
671  }
673  //**********************************************************************************************
674 
675  //**Addition assignment to sparse vectors*******************************************************
676  // No special implementation for the addition assignment to sparse vectors.
677  //**********************************************************************************************
678 
679  //**Subtraction assignment to dense vectors*****************************************************
693  template< typename VT > // Type of the target dense vector
694  friend inline typename EnableIf< UseAssign<VT> >::Type
695  subAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
696  {
698 
702 
703  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
704 
705  const ResultType tmp( serial( rhs ) );
706  subAssign( ~lhs, tmp );
707  }
709  //**********************************************************************************************
710 
711  //**Subtraction assignment to sparse vectors****************************************************
712  // No special implementation for the subtraction assignment to sparse vectors.
713  //**********************************************************************************************
714 
715  //**Multiplication assignment to dense vectors**************************************************
729  template< typename VT > // Type of the target dense vector
730  friend inline typename EnableIf< UseAssign<VT> >::Type
731  multAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
732  {
734 
735  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
736 
737  multAssign( ~lhs, rhs.lhs_ );
738  multAssign( ~lhs, rhs.rhs_ );
739  }
741  //**********************************************************************************************
742 
743  //**Multiplication assignment to sparse vectors*************************************************
757  template< typename VT > // Type of the target sparse vector
758  friend inline typename EnableIf< UseAssign<VT> >::Type
759  multAssign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
760  {
762 
763  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
764 
765  multAssign( ~lhs, rhs.lhs_ );
766  multAssign( ~lhs, rhs.rhs_ );
767  }
769  //**********************************************************************************************
770 
771  //**SMP assignment to dense vectors*************************************************************
785  template< typename VT > // Type of the target dense vector
786  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
787  smpAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
788  {
790 
791  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
792 
793  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
794  smpMultAssign( ~lhs, rhs.rhs_ );
795  }
796  else if( !IsComputation<VT2>::value && isSame( ~lhs, rhs.rhs_ ) ) {
797  smpMultAssign( ~lhs, rhs.lhs_ );
798  }
799  else {
800  smpAssign ( ~lhs, rhs.lhs_ );
801  smpMultAssign( ~lhs, rhs.rhs_ );
802  }
803  }
805  //**********************************************************************************************
806 
807  //**SMP assignment to sparse vectors************************************************************
821  template< typename VT > // Type of the target sparse vector
822  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
823  smpAssign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
824  {
826 
830 
831  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
832 
833  const ResultType tmp( rhs );
834  smpAssign( ~lhs, tmp );
835  }
837  //**********************************************************************************************
838 
839  //**SMP addition assignment to dense vectors****************************************************
853  template< typename VT > // Type of the target dense vector
854  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
855  smpAddAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
856  {
858 
862 
863  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
864 
865  const ResultType tmp( rhs );
866  smpAddAssign( ~lhs, tmp );
867  }
869  //**********************************************************************************************
870 
871  //**SMP addition assignment to sparse vectors***************************************************
872  // No special implementation for the SMP addition assignment to sparse vectors.
873  //**********************************************************************************************
874 
875  //**SMP subtraction assignment to dense vectors*************************************************
890  template< typename VT > // Type of the target dense vector
891  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
892  smpSubAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
893  {
895 
899 
900  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
901 
902  const ResultType tmp( rhs );
903  smpSubAssign( ~lhs, tmp );
904  }
906  //**********************************************************************************************
907 
908  //**SMP subtraction assignment to sparse vectors************************************************
909  // No special implementation for the SMP subtraction assignment to sparse vectors.
910  //**********************************************************************************************
911 
912  //**SMP multiplication assignment to dense vectors**********************************************
927  template< typename VT > // Type of the target dense vector
928  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
929  smpMultAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
930  {
932 
933  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
934 
935  smpMultAssign( ~lhs, rhs.lhs_ );
936  smpMultAssign( ~lhs, rhs.rhs_ );
937  }
939  //**********************************************************************************************
940 
941  //**SMP multiplication assignment to sparse vectors*********************************************
956  template< typename VT > // Type of the target sparse vector
957  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
958  smpMultAssign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
959  {
961 
962  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
963 
964  smpMultAssign( ~lhs, rhs.lhs_ );
965  smpMultAssign( ~lhs, rhs.rhs_ );
966  }
968  //**********************************************************************************************
969 
970  //**Compile time checks*************************************************************************
977  //**********************************************************************************************
978 };
979 //*************************************************************************************************
980 
981 
982 
983 
984 //=================================================================================================
985 //
986 // GLOBAL BINARY ARITHMETIC OPERATORS
987 //
988 //=================================================================================================
989 
990 //*************************************************************************************************
1015 template< typename T1 // Type of the left-hand side dense vector
1016  , typename T2 // Type of the right-hand side dense vector
1017  , bool TF > // Transpose flag
1018 inline const DVecDVecMultExpr<T1,T2,TF>
1020 {
1022 
1023  if( (~lhs).size() != (~rhs).size() )
1024  throw std::invalid_argument( "Vector sizes do not match" );
1025 
1026  return DVecDVecMultExpr<T1,T2,TF>( ~lhs, ~rhs );
1027 }
1028 //*************************************************************************************************
1029 
1030 
1031 
1032 
1033 //=================================================================================================
1034 //
1035 // EXPRESSION TRAIT SPECIALIZATIONS
1036 //
1037 //=================================================================================================
1038 
1039 //*************************************************************************************************
1041 template< typename VT1, typename VT2, bool TF, bool AF >
1042 struct SubvectorExprTrait< DVecDVecMultExpr<VT1,VT2,TF>, AF >
1043 {
1044  public:
1045  //**********************************************************************************************
1046  typedef typename MultExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
1047  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
1048  //**********************************************************************************************
1049 };
1051 //*************************************************************************************************
1052 
1053 } // namespace blaze
1054 
1055 #endif
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecDVecMultExpr.h:416
Pointer difference type of the Blaze library.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecDVecMultExpr.h:156
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:4329
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecMultExpr.h:241
ConstIterator(LeftIteratorType left, RightIteratorType right)
Constructor for the ConstIterator class.
Definition: DVecDVecMultExpr.h:204
DifferenceType difference_type
Difference between two iterators.
Definition: DVecDVecMultExpr.h:189
Iterator over the elements of the dense vector.
Definition: DVecDVecMultExpr.h:174
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
ReferenceType reference
Reference return type.
Definition: DVecDVecMultExpr.h:188
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:199
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecMultExpr.h:530
LeftOperand lhs_
Left-hand side dense vector of the multiplication expression.
Definition: DVecDVecMultExpr.h:571
VT2::ResultType RT2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:94
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:350
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
VT2::ConstIterator RightIteratorType
ConstIterator type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:195
Header file for the IsSame and IsStrictlySame type traits.
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:328
VT1::ReturnType RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:95
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
Header file for the DenseVector base class.
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecDVecMultExpr.h:415
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
Header file for the Computation base class.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:158
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecDVecMultExpr.h:285
Header file for the RequiresEvaluation type trait.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:317
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecDVecMultExpr.h:372
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
Constraint on the data type.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecDVecMultExpr.h:182
Header file for the MultExprTrait class template.
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
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the IsTemporary type trait class.
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecDVecMultExpr.h:253
Header file for the multiplication trait.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecDVecMultExpr.h:543
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecDVecMultExpr.h:155
PointerType pointer
Pointer return type.
Definition: DVecDVecMultExpr.h:187
IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecDVecMultExpr.h:463
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecDVecMultExpr.h:178
RightOperand rightOperand() const
Returns the right-hand side dense vector operand.
Definition: DVecDVecMultExpr.h:518
SelectType< IsExpression< VT2 >::value, const VT2, const VT2 & >::Type RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:168
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2412
VT2::ReturnType RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:96
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecDVecMultExpr.h:229
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
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecDVecMultExpr.h:498
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecDVecMultExpr.h:295
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
SelectType< useAssign, const ResultType, const DVecDVecMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecDVecMultExpr.h:162
SelectType< IsExpression< VT1 >::value, const VT1, const VT1 & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:165
Constraint on the data type.
VT1::ResultType RT1
Result type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:93
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:339
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:78
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:361
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecDVecMultExpr.h:488
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecMultExpr.h:275
Constraint on the data type.
Header file for the VecVecMultExpr base class.
VT2::CompositeType CT2
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:98
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.
DVecDVecMultExpr< VT1, VT2, TF > This
Type of this DVecDVecMultExpr instance.
Definition: DVecDVecMultExpr.h:152
Expression object for dense vector-dense vector multiplications.The DVecDVecMultExpr class represents...
Definition: DVecDVecMultExpr.h:87
Header file for the EnableIf class template.
Header file for the serial shim.
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecDVecMultExpr.h:478
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 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
ElementType ValueType
Type of the underlying elements.
Definition: DVecDVecMultExpr.h:179
Header file for run time assertion macros.
ValueType value_type
Type of the underlying elements.
Definition: DVecDVecMultExpr.h:186
Base template for the MultTrait class.
Definition: MultTrait.h:141
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
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
IteratorCategory iterator_category
The iterator category.
Definition: DVecDVecMultExpr.h:185
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:306
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
VT2::ElementType ET2
Element type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:100
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecDVecMultExpr.h:451
MultExprTrait< RN1, RN2 >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecDVecMultExpr.h:113
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecDVecMultExpr.h:263
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecMultExpr.h:384
ElementType * PointerType
Pointer return type.
Definition: DVecDVecMultExpr.h:180
DVecDVecMultExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the DVecDVecMultExpr class.
Definition: DVecDVecMultExpr.h:437
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecDVecMultExpr.h:508
VT1::CompositeType CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:97
Header file for all intrinsic functionality.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecDVecMultExpr.h:563
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:79
VT1::ElementType ET1
Element type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:99
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: DVecDVecMultExpr.h:153
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecDVecMultExpr.h:408
Header file for the IsComputation type trait class.
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecDVecMultExpr.h:553
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
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
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.
const size_t SMP_DVECDVECMULT_THRESHOLD
SMP dense vector/dense vector multiplication threshold.This threshold specifies when a dense vector/d...
Definition: Thresholds.h:276
RightOperand rhs_
Right-hand side dense vector of the multiplication expression.
Definition: DVecDVecMultExpr.h:572
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecDVecMultExpr.h:216
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecDVecMultExpr.h:396
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecDVecMultExpr.h:159
Evaluation of the resulting expression type of a multiplication.Via this type trait it is possible to...
Definition: MultExprTrait.h:137
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:238
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
Base class for all vector/vector multiplication expression templates.The VecVecMultExpr class serves ...
Definition: VecVecMultExpr.h:65
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:87
VT1::ConstIterator LeftIteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:192
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecDVecMultExpr.h:154
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
ElementType & ReferenceType
Reference return type.
Definition: DVecDVecMultExpr.h:181