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>
51 #include <blaze/math/Intrinsics.h>
62 #include <blaze/util/Assert.h>
64 #include <blaze/util/EnableIf.h>
66 #include <blaze/util/mpl/Max.h>
67 #include <blaze/util/SelectType.h>
68 #include <blaze/util/Types.h>
70 
71 
72 namespace blaze {
73 
74 //=================================================================================================
75 //
76 // CLASS DVECDVECMULTEXPR
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 DVecDVecMultExpr : public DenseVector< DVecDVecMultExpr<VT1,VT2,TF>, TF >
91  , private VecVecMultExpr
92  , private Computation
93 {
94  private:
95  //**Type definitions****************************************************************************
96  typedef typename VT1::ResultType RT1;
97  typedef typename VT2::ResultType RT2;
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  //**Serial 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  //**Parallel evaluation strategy****************************************************************
140 
146  template< typename VT >
147  struct UseSMPAssign {
148  enum { value = ( !VT1::smpAssignable || !VT2::smpAssignable ) && useAssign };
149  };
151  //**********************************************************************************************
152 
153  public:
154  //**Type definitions****************************************************************************
160 
163 
166 
168  typedef typename SelectType< IsExpression<VT1>::value, const VT1, const VT1& >::Type LeftOperand;
169 
171  typedef typename SelectType< IsExpression<VT2>::value, const VT2, const VT2& >::Type RightOperand;
172  //**********************************************************************************************
173 
174  //**ConstIterator class definition**************************************************************
178  {
179  public:
180  //**Type definitions*************************************************************************
181  typedef std::random_access_iterator_tag IteratorCategory;
186 
187  // STL iterator requirements
193 
196 
199  //*******************************************************************************************
200 
201  //**Constructor******************************************************************************
207  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right )
208  : left_ ( left ) // Iterator to the current left-hand side element
209  , right_( right ) // Iterator to the current right-hand side element
210  {}
211  //*******************************************************************************************
212 
213  //**Addition assignment operator*************************************************************
219  inline ConstIterator& operator+=( size_t inc ) {
220  left_ += inc;
221  right_ += inc;
222  return *this;
223  }
224  //*******************************************************************************************
225 
226  //**Subtraction assignment operator**********************************************************
232  inline ConstIterator& operator-=( size_t dec ) {
233  left_ -= dec;
234  right_ -= dec;
235  return *this;
236  }
237  //*******************************************************************************************
238 
239  //**Prefix increment operator****************************************************************
245  ++left_;
246  ++right_;
247  return *this;
248  }
249  //*******************************************************************************************
250 
251  //**Postfix increment operator***************************************************************
256  inline const ConstIterator operator++( int ) {
257  return ConstIterator( left_++, right_++ );
258  }
259  //*******************************************************************************************
260 
261  //**Prefix decrement operator****************************************************************
267  --left_;
268  --right_;
269  return *this;
270  }
271  //*******************************************************************************************
272 
273  //**Postfix decrement operator***************************************************************
278  inline const ConstIterator operator--( int ) {
279  return ConstIterator( left_--, right_-- );
280  }
281  //*******************************************************************************************
282 
283  //**Element access operator******************************************************************
288  inline ReturnType operator*() const {
289  return (*left_) * (*right_);
290  }
291  //*******************************************************************************************
292 
293  //**Load function****************************************************************************
298  inline IntrinsicType load() const {
299  return left_.load() * right_.load();
300  }
301  //*******************************************************************************************
302 
303  //**Equality operator************************************************************************
309  inline bool operator==( const ConstIterator& rhs ) const {
310  return left_ == rhs.left_;
311  }
312  //*******************************************************************************************
313 
314  //**Inequality operator**********************************************************************
320  inline bool operator!=( const ConstIterator& rhs ) const {
321  return left_ != rhs.left_;
322  }
323  //*******************************************************************************************
324 
325  //**Less-than operator***********************************************************************
331  inline bool operator<( const ConstIterator& rhs ) const {
332  return left_ < rhs.left_;
333  }
334  //*******************************************************************************************
335 
336  //**Greater-than operator********************************************************************
342  inline bool operator>( const ConstIterator& rhs ) const {
343  return left_ > rhs.left_;
344  }
345  //*******************************************************************************************
346 
347  //**Less-or-equal-than operator**************************************************************
353  inline bool operator<=( const ConstIterator& rhs ) const {
354  return left_ <= rhs.left_;
355  }
356  //*******************************************************************************************
357 
358  //**Greater-or-equal-than operator***********************************************************
364  inline bool operator>=( const ConstIterator& rhs ) const {
365  return left_ >= rhs.left_;
366  }
367  //*******************************************************************************************
368 
369  //**Subtraction operator*********************************************************************
375  inline DifferenceType operator-( const ConstIterator& rhs ) const {
376  return left_ - rhs.left_;
377  }
378  //*******************************************************************************************
379 
380  //**Addition operator************************************************************************
387  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
388  return ConstIterator( it.left_ + inc, it.right_ + inc );
389  }
390  //*******************************************************************************************
391 
392  //**Addition operator************************************************************************
399  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
400  return ConstIterator( it.left_ + inc, it.right_ + inc );
401  }
402  //*******************************************************************************************
403 
404  //**Subtraction operator*********************************************************************
411  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
412  return ConstIterator( it.left_ - dec, it.right_ - dec );
413  }
414  //*******************************************************************************************
415 
416  private:
417  //**Member variables*************************************************************************
420  //*******************************************************************************************
421  };
422  //**********************************************************************************************
423 
424  //**Compilation flags***************************************************************************
426  enum { vectorizable = VT1::vectorizable && VT2::vectorizable &&
429 
431  enum { smpAssignable = VT1::smpAssignable && VT2::smpAssignable };
432  //**********************************************************************************************
433 
434  //**Constructor*********************************************************************************
440  explicit inline DVecDVecMultExpr( const VT1& lhs, const VT2& rhs )
441  : lhs_( lhs ) // Left-hand side dense vector of the multiplication expression
442  , rhs_( rhs ) // Right-hand side dense vector of the multiplication expression
443  {
444  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
445  }
446  //**********************************************************************************************
447 
448  //**Subscript operator**************************************************************************
454  inline ReturnType operator[]( size_t index ) const {
455  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
456  return lhs_[index] * rhs_[index];
457  }
458  //**********************************************************************************************
459 
460  //**Load function*******************************************************************************
466  inline IntrinsicType load( size_t index ) const {
467  typedef IntrinsicTrait<ElementType> IT;
468  BLAZE_INTERNAL_ASSERT( index < lhs_.size() , "Invalid vector access index" );
469  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
470  const IntrinsicType xmm1( lhs_.load( index ) );
471  const IntrinsicType xmm2( rhs_.load( index ) );
472  return xmm1 * xmm2;
473  }
474  //**********************************************************************************************
475 
476  //**Begin function******************************************************************************
481  inline ConstIterator begin() const {
482  return ConstIterator( lhs_.begin(), rhs_.begin() );
483  }
484  //**********************************************************************************************
485 
486  //**End function********************************************************************************
491  inline ConstIterator end() const {
492  return ConstIterator( lhs_.end(), rhs_.end() );
493  }
494  //**********************************************************************************************
495 
496  //**Size function*******************************************************************************
501  inline size_t size() const {
502  return lhs_.size();
503  }
504  //**********************************************************************************************
505 
506  //**Left operand access*************************************************************************
511  inline LeftOperand leftOperand() const {
512  return lhs_;
513  }
514  //**********************************************************************************************
515 
516  //**Right operand access************************************************************************
521  inline RightOperand rightOperand() const {
522  return rhs_;
523  }
524  //**********************************************************************************************
525 
526  //**********************************************************************************************
532  template< typename T >
533  inline bool canAlias( const T* alias ) const {
534  return ( IsExpression<VT1>::value && ( RequiresEvaluation<VT1>::value ? lhs_.isAliased( alias ) : lhs_.canAlias( alias ) ) ) ||
535  ( IsExpression<VT2>::value && ( RequiresEvaluation<VT2>::value ? rhs_.isAliased( alias ) : rhs_.canAlias( alias ) ) );
536  }
537  //**********************************************************************************************
538 
539  //**********************************************************************************************
545  template< typename T >
546  inline bool isAliased( const T* alias ) const {
547  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
548  }
549  //**********************************************************************************************
550 
551  //**********************************************************************************************
556  inline bool isAligned() const {
557  return lhs_.isAligned() && rhs_.isAligned();
558  }
559  //**********************************************************************************************
560 
561  //**********************************************************************************************
566  inline bool canSMPAssign() const {
567  return lhs_.canSMPAssign() || rhs_.canSMPAssign() ||
569  }
570  //**********************************************************************************************
571 
572  private:
573  //**Member variables****************************************************************************
576  //**********************************************************************************************
577 
578  //**Assignment to dense vectors*****************************************************************
592  template< typename VT > // Type of the target dense vector
593  friend inline typename EnableIf< UseAssign<VT> >::Type
594  assign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
595  {
597 
598  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
599 
600  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
601  multAssign( ~lhs, rhs.rhs_ );
602  }
603  else if( !IsComputation<VT2>::value && isSame( ~lhs, rhs.rhs_ ) ) {
604  multAssign( ~lhs, rhs.lhs_ );
605  }
606  else {
607  assign ( ~lhs, rhs.lhs_ );
608  multAssign( ~lhs, rhs.rhs_ );
609  }
610  }
612  //**********************************************************************************************
613 
614  //**Assignment to sparse vectors****************************************************************
628  template< typename VT > // Type of the target sparse vector
629  friend inline typename EnableIf< UseAssign<VT> >::Type
630  assign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
631  {
633 
637 
638  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
639 
640  const ResultType tmp( serial( rhs ) );
641  assign( ~lhs, tmp );
642  }
644  //**********************************************************************************************
645 
646  //**Addition assignment to dense vectors********************************************************
660  template< typename VT > // Type of the target dense vector
661  friend inline typename EnableIf< UseAssign<VT> >::Type
662  addAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
663  {
665 
669 
670  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
671 
672  const ResultType tmp( serial( rhs ) );
673  addAssign( ~lhs, tmp );
674  }
676  //**********************************************************************************************
677 
678  //**Addition assignment to sparse vectors*******************************************************
679  // No special implementation for the addition assignment to sparse vectors.
680  //**********************************************************************************************
681 
682  //**Subtraction assignment to dense vectors*****************************************************
696  template< typename VT > // Type of the target dense vector
697  friend inline typename EnableIf< UseAssign<VT> >::Type
698  subAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
699  {
701 
705 
706  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
707 
708  const ResultType tmp( serial( rhs ) );
709  subAssign( ~lhs, tmp );
710  }
712  //**********************************************************************************************
713 
714  //**Subtraction assignment to sparse vectors****************************************************
715  // No special implementation for the subtraction assignment to sparse vectors.
716  //**********************************************************************************************
717 
718  //**Multiplication assignment to dense vectors**************************************************
732  template< typename VT > // Type of the target dense vector
733  friend inline typename EnableIf< UseAssign<VT> >::Type
734  multAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
735  {
737 
738  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
739 
740  multAssign( ~lhs, rhs.lhs_ );
741  multAssign( ~lhs, rhs.rhs_ );
742  }
744  //**********************************************************************************************
745 
746  //**Multiplication assignment to sparse vectors*************************************************
760  template< typename VT > // Type of the target sparse vector
761  friend inline typename EnableIf< UseAssign<VT> >::Type
762  multAssign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
763  {
765 
766  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
767 
768  multAssign( ~lhs, rhs.lhs_ );
769  multAssign( ~lhs, rhs.rhs_ );
770  }
772  //**********************************************************************************************
773 
774  //**SMP assignment to dense vectors*************************************************************
788  template< typename VT > // Type of the target dense vector
789  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
790  smpAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
791  {
793 
794  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
795 
796  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
797  smpMultAssign( ~lhs, rhs.rhs_ );
798  }
799  else if( !IsComputation<VT2>::value && isSame( ~lhs, rhs.rhs_ ) ) {
800  smpMultAssign( ~lhs, rhs.lhs_ );
801  }
802  else {
803  smpAssign ( ~lhs, rhs.lhs_ );
804  smpMultAssign( ~lhs, rhs.rhs_ );
805  }
806  }
808  //**********************************************************************************************
809 
810  //**SMP assignment to sparse vectors************************************************************
824  template< typename VT > // Type of the target sparse vector
825  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
826  smpAssign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
827  {
829 
833 
834  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
835 
836  const ResultType tmp( rhs );
837  smpAssign( ~lhs, tmp );
838  }
840  //**********************************************************************************************
841 
842  //**SMP addition assignment to dense vectors****************************************************
856  template< typename VT > // Type of the target dense vector
857  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
858  smpAddAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
859  {
861 
865 
866  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
867 
868  const ResultType tmp( rhs );
869  smpAddAssign( ~lhs, tmp );
870  }
872  //**********************************************************************************************
873 
874  //**SMP addition assignment to sparse vectors***************************************************
875  // No special implementation for the SMP addition assignment to sparse vectors.
876  //**********************************************************************************************
877 
878  //**SMP subtraction assignment to dense vectors*************************************************
893  template< typename VT > // Type of the target dense vector
894  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
895  smpSubAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
896  {
898 
902 
903  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
904 
905  const ResultType tmp( rhs );
906  smpSubAssign( ~lhs, tmp );
907  }
909  //**********************************************************************************************
910 
911  //**SMP subtraction assignment to sparse vectors************************************************
912  // No special implementation for the SMP subtraction assignment to sparse vectors.
913  //**********************************************************************************************
914 
915  //**SMP multiplication assignment to dense vectors**********************************************
930  template< typename VT > // Type of the target dense vector
931  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
932  smpMultAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
933  {
935 
936  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
937 
938  smpMultAssign( ~lhs, rhs.lhs_ );
939  smpMultAssign( ~lhs, rhs.rhs_ );
940  }
942  //**********************************************************************************************
943 
944  //**SMP multiplication assignment to sparse vectors*********************************************
959  template< typename VT > // Type of the target sparse vector
960  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
961  smpMultAssign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
962  {
964 
965  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
966 
967  smpMultAssign( ~lhs, rhs.lhs_ );
968  smpMultAssign( ~lhs, rhs.rhs_ );
969  }
971  //**********************************************************************************************
972 
973  //**Compile time checks*************************************************************************
981  //**********************************************************************************************
982 };
983 //*************************************************************************************************
984 
985 
986 
987 
988 //=================================================================================================
989 //
990 // GLOBAL BINARY ARITHMETIC OPERATORS
991 //
992 //=================================================================================================
993 
994 //*************************************************************************************************
1019 template< typename T1 // Type of the left-hand side dense vector
1020  , typename T2 // Type of the right-hand side dense vector
1021  , bool TF > // Transpose flag
1022 inline const DVecDVecMultExpr<T1,T2,TF>
1024 {
1026 
1027  if( (~lhs).size() != (~rhs).size() )
1028  throw std::invalid_argument( "Vector sizes do not match" );
1029 
1030  return DVecDVecMultExpr<T1,T2,TF>( ~lhs, ~rhs );
1031 }
1032 //*************************************************************************************************
1033 
1034 
1035 
1036 
1037 //=================================================================================================
1038 //
1039 // SIZE SPECIALIZATIONS
1040 //
1041 //=================================================================================================
1042 
1043 //*************************************************************************************************
1045 template< typename VT1, typename VT2, bool TF >
1046 struct Size< DVecDVecMultExpr<VT1,VT2,TF> >
1047  : public Max< Size<VT1>, Size<VT2> >::Type
1048 {};
1050 //*************************************************************************************************
1051 
1052 
1053 
1054 
1055 //=================================================================================================
1056 //
1057 // EXPRESSION TRAIT SPECIALIZATIONS
1058 //
1059 //=================================================================================================
1060 
1061 //*************************************************************************************************
1063 template< typename VT1, typename VT2, bool TF, bool AF >
1064 struct SubvectorExprTrait< DVecDVecMultExpr<VT1,VT2,TF>, AF >
1065 {
1066  public:
1067  //**********************************************************************************************
1068  typedef typename MultExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
1069  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
1070  //**********************************************************************************************
1071 };
1073 //*************************************************************************************************
1074 
1075 } // namespace blaze
1076 
1077 #endif
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecDVecMultExpr.h:419
Pointer difference type of the Blaze library.
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
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecDVecMultExpr.h:159
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
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:4838
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecMultExpr.h:244
ConstIterator(LeftIteratorType left, RightIteratorType right)
Constructor for the ConstIterator class.
Definition: DVecDVecMultExpr.h:207
DifferenceType difference_type
Difference between two iterators.
Definition: DVecDVecMultExpr.h:192
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
Iterator over the elements of the dense vector.
Definition: DVecDVecMultExpr.h:177
ReferenceType reference
Reference return type.
Definition: DVecDVecMultExpr.h:191
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecMultExpr.h:533
LeftOperand lhs_
Left-hand side dense vector of the multiplication expression.
Definition: DVecDVecMultExpr.h:574
VT2::ResultType RT2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:97
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:353
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
VT2::ConstIterator RightIteratorType
ConstIterator type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:198
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:331
VT1::ReturnType RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:98
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
Header file for the DenseVector base class.
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecDVecMultExpr.h:418
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
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:288
Header file for the RequiresEvaluation type trait.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:320
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecDVecMultExpr.h:375
Constraint on the data type.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecDVecMultExpr.h:185
Header file for the MultExprTrait class template.
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
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:256
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:546
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecDVecMultExpr.h:158
PointerType pointer
Pointer return type.
Definition: DVecDVecMultExpr.h:190
IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecDVecMultExpr.h:466
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecDVecMultExpr.h:181
RightOperand rightOperand() const
Returns the right-hand side dense vector operand.
Definition: DVecDVecMultExpr.h:521
SelectType< IsExpression< VT2 >::value, const VT2, const VT2 & >::Type RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:171
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
VT2::ReturnType RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:99
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
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecDVecMultExpr.h:232
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecDVecMultExpr.h:501
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecDVecMultExpr.h:298
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:165
SelectType< IsExpression< VT1 >::value, const VT1, const VT1 & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:168
Constraint on the data type.
VT1::ResultType RT1
Result type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:96
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:342
#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:364
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecDVecMultExpr.h:491
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecMultExpr.h:278
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:101
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.
DVecDVecMultExpr< VT1, VT2, TF > This
Type of this DVecDVecMultExpr instance.
Definition: DVecDVecMultExpr.h:155
Expression object for dense vector-dense vector multiplications.The DVecDVecMultExpr class represents...
Definition: DVecDVecMultExpr.h:90
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:481
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
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
ElementType ValueType
Type of the underlying elements.
Definition: DVecDVecMultExpr.h:182
Header file for run time assertion macros.
ValueType value_type
Type of the underlying elements.
Definition: DVecDVecMultExpr.h:189
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
Base template for the MultTrait class.
Definition: MultTrait.h:142
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
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:188
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:309
VT2::ElementType ET2
Element type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:103
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecDVecMultExpr.h:454
MultExprTrait< RN1, RN2 >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecDVecMultExpr.h:116
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecDVecMultExpr.h:266
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecMultExpr.h:387
ElementType * PointerType
Pointer return type.
Definition: DVecDVecMultExpr.h:183
DVecDVecMultExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the DVecDVecMultExpr class.
Definition: DVecDVecMultExpr.h:440
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecDVecMultExpr.h:511
VT1::CompositeType CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:100
Header file for all intrinsic functionality.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecDVecMultExpr.h:566
#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:102
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: DVecDVecMultExpr.h:156
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_VECVECMULTEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid vector/vector ...
Definition: VecVecMultExpr.h:165
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecDVecMultExpr.h:411
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:556
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
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:2473
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:575
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecDVecMultExpr.h:219
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecDVecMultExpr.h:399
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecDVecMultExpr.h:162
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.
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:195
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecDVecMultExpr.h:157
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
ElementType & ReferenceType
Reference return type.
Definition: DVecDVecMultExpr.h:184