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>
61 #include <blaze/system/Inline.h>
63 #include <blaze/util/Assert.h>
65 #include <blaze/util/EnableIf.h>
67 #include <blaze/util/mpl/Max.h>
68 #include <blaze/util/SelectType.h>
69 #include <blaze/util/Types.h>
71 
72 
73 namespace blaze {
74 
75 //=================================================================================================
76 //
77 // CLASS DVECDVECMULTEXPR
78 //
79 //=================================================================================================
80 
81 //*************************************************************************************************
88 template< typename VT1 // Type of the left-hand side dense vector
89  , typename VT2 // Type of the right-hand side dense vector
90  , bool TF > // Transpose flag
91 class DVecDVecMultExpr : public DenseVector< DVecDVecMultExpr<VT1,VT2,TF>, TF >
92  , private VecVecMultExpr
93  , private Computation
94 {
95  private:
96  //**Type definitions****************************************************************************
97  typedef typename VT1::ResultType RT1;
98  typedef typename VT2::ResultType RT2;
99  typedef typename VT1::ReturnType RN1;
100  typedef typename VT2::ReturnType RN2;
101  typedef typename VT1::CompositeType CT1;
102  typedef typename VT2::CompositeType CT2;
103  typedef typename VT1::ElementType ET1;
104  typedef typename VT2::ElementType ET2;
105  //**********************************************************************************************
106 
107  //**Return type evaluation**********************************************************************
109 
114  enum { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
115 
118  //**********************************************************************************************
119 
120  //**Serial evaluation strategy******************************************************************
122 
128  enum { useAssign = ( RequiresEvaluation<VT1>::value || RequiresEvaluation<VT2>::value || !returnExpr ) };
129 
131  template< typename VT >
133  struct UseAssign {
134  enum { value = useAssign };
135  };
137  //**********************************************************************************************
138 
139  //**Parallel evaluation strategy****************************************************************
141 
147  template< typename VT >
148  struct UseSMPAssign {
149  enum { value = ( !VT1::smpAssignable || !VT2::smpAssignable ) && useAssign };
150  };
152  //**********************************************************************************************
153 
154  public:
155  //**Type definitions****************************************************************************
161 
164 
167 
169  typedef typename SelectType< IsExpression<VT1>::value, const VT1, const VT1& >::Type LeftOperand;
170 
172  typedef typename SelectType< IsExpression<VT2>::value, const VT2, const VT2& >::Type RightOperand;
173  //**********************************************************************************************
174 
175  //**ConstIterator class definition**************************************************************
179  {
180  public:
181  //**Type definitions*************************************************************************
182  typedef std::random_access_iterator_tag IteratorCategory;
183  typedef ElementType ValueType;
184  typedef ElementType* PointerType;
185  typedef ElementType& ReferenceType;
187 
188  // STL iterator requirements
189  typedef IteratorCategory iterator_category;
190  typedef ValueType value_type;
191  typedef PointerType pointer;
192  typedef ReferenceType reference;
193  typedef DifferenceType difference_type;
194 
197 
200  //*******************************************************************************************
201 
202  //**Constructor******************************************************************************
208  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right )
209  : left_ ( left ) // Iterator to the current left-hand side element
210  , right_( right ) // Iterator to the current right-hand side element
211  {}
212  //*******************************************************************************************
213 
214  //**Addition assignment operator*************************************************************
220  inline ConstIterator& operator+=( size_t inc ) {
221  left_ += inc;
222  right_ += inc;
223  return *this;
224  }
225  //*******************************************************************************************
226 
227  //**Subtraction assignment operator**********************************************************
233  inline ConstIterator& operator-=( size_t dec ) {
234  left_ -= dec;
235  right_ -= dec;
236  return *this;
237  }
238  //*******************************************************************************************
239 
240  //**Prefix increment operator****************************************************************
246  ++left_;
247  ++right_;
248  return *this;
249  }
250  //*******************************************************************************************
251 
252  //**Postfix increment operator***************************************************************
257  inline const ConstIterator operator++( int ) {
258  return ConstIterator( left_++, right_++ );
259  }
260  //*******************************************************************************************
261 
262  //**Prefix decrement operator****************************************************************
268  --left_;
269  --right_;
270  return *this;
271  }
272  //*******************************************************************************************
273 
274  //**Postfix decrement operator***************************************************************
279  inline const ConstIterator operator--( int ) {
280  return ConstIterator( left_--, right_-- );
281  }
282  //*******************************************************************************************
283 
284  //**Element access operator******************************************************************
289  inline ReturnType operator*() const {
290  return (*left_) * (*right_);
291  }
292  //*******************************************************************************************
293 
294  //**Load function****************************************************************************
299  inline IntrinsicType load() const {
300  return left_.load() * right_.load();
301  }
302  //*******************************************************************************************
303 
304  //**Equality operator************************************************************************
310  inline bool operator==( const ConstIterator& rhs ) const {
311  return left_ == rhs.left_;
312  }
313  //*******************************************************************************************
314 
315  //**Inequality operator**********************************************************************
321  inline bool operator!=( const ConstIterator& rhs ) const {
322  return left_ != rhs.left_;
323  }
324  //*******************************************************************************************
325 
326  //**Less-than operator***********************************************************************
332  inline bool operator<( const ConstIterator& rhs ) const {
333  return left_ < rhs.left_;
334  }
335  //*******************************************************************************************
336 
337  //**Greater-than operator********************************************************************
343  inline bool operator>( const ConstIterator& rhs ) const {
344  return left_ > rhs.left_;
345  }
346  //*******************************************************************************************
347 
348  //**Less-or-equal-than operator**************************************************************
354  inline bool operator<=( const ConstIterator& rhs ) const {
355  return left_ <= rhs.left_;
356  }
357  //*******************************************************************************************
358 
359  //**Greater-or-equal-than operator***********************************************************
365  inline bool operator>=( const ConstIterator& rhs ) const {
366  return left_ >= rhs.left_;
367  }
368  //*******************************************************************************************
369 
370  //**Subtraction operator*********************************************************************
376  inline DifferenceType operator-( const ConstIterator& rhs ) const {
377  return left_ - rhs.left_;
378  }
379  //*******************************************************************************************
380 
381  //**Addition operator************************************************************************
388  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
389  return ConstIterator( it.left_ + inc, it.right_ + inc );
390  }
391  //*******************************************************************************************
392 
393  //**Addition operator************************************************************************
400  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
401  return ConstIterator( it.left_ + inc, it.right_ + inc );
402  }
403  //*******************************************************************************************
404 
405  //**Subtraction operator*********************************************************************
412  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
413  return ConstIterator( it.left_ - dec, it.right_ - dec );
414  }
415  //*******************************************************************************************
416 
417  private:
418  //**Member variables*************************************************************************
419  LeftIteratorType left_;
420  RightIteratorType right_;
421  //*******************************************************************************************
422  };
423  //**********************************************************************************************
424 
425  //**Compilation flags***************************************************************************
427  enum { vectorizable = VT1::vectorizable && VT2::vectorizable &&
430 
432  enum { smpAssignable = VT1::smpAssignable && VT2::smpAssignable };
433  //**********************************************************************************************
434 
435  //**Constructor*********************************************************************************
441  explicit inline DVecDVecMultExpr( const VT1& lhs, const VT2& rhs )
442  : lhs_( lhs ) // Left-hand side dense vector of the multiplication expression
443  , rhs_( rhs ) // Right-hand side dense vector of the multiplication expression
444  {
445  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
446  }
447  //**********************************************************************************************
448 
449  //**Subscript operator**************************************************************************
455  inline ReturnType operator[]( size_t index ) const {
456  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
457  return lhs_[index] * rhs_[index];
458  }
459  //**********************************************************************************************
460 
461  //**Load function*******************************************************************************
467  BLAZE_ALWAYS_INLINE IntrinsicType load( size_t index ) const {
468  typedef IntrinsicTrait<ElementType> IT;
469  BLAZE_INTERNAL_ASSERT( index < lhs_.size() , "Invalid vector access index" );
470  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
471  const IntrinsicType xmm1( lhs_.load( index ) );
472  const IntrinsicType xmm2( rhs_.load( index ) );
473  return xmm1 * xmm2;
474  }
475  //**********************************************************************************************
476 
477  //**Begin function******************************************************************************
482  inline ConstIterator begin() const {
483  return ConstIterator( lhs_.begin(), rhs_.begin() );
484  }
485  //**********************************************************************************************
486 
487  //**End function********************************************************************************
492  inline ConstIterator end() const {
493  return ConstIterator( lhs_.end(), rhs_.end() );
494  }
495  //**********************************************************************************************
496 
497  //**Size function*******************************************************************************
502  inline size_t size() const {
503  return lhs_.size();
504  }
505  //**********************************************************************************************
506 
507  //**Left operand access*************************************************************************
512  inline LeftOperand leftOperand() const {
513  return lhs_;
514  }
515  //**********************************************************************************************
516 
517  //**Right operand access************************************************************************
522  inline RightOperand rightOperand() const {
523  return rhs_;
524  }
525  //**********************************************************************************************
526 
527  //**********************************************************************************************
533  template< typename T >
534  inline bool canAlias( const T* alias ) const {
535  return ( IsExpression<VT1>::value && ( RequiresEvaluation<VT1>::value ? lhs_.isAliased( alias ) : lhs_.canAlias( alias ) ) ) ||
536  ( IsExpression<VT2>::value && ( RequiresEvaluation<VT2>::value ? rhs_.isAliased( alias ) : rhs_.canAlias( alias ) ) );
537  }
538  //**********************************************************************************************
539 
540  //**********************************************************************************************
546  template< typename T >
547  inline bool isAliased( const T* alias ) const {
548  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
549  }
550  //**********************************************************************************************
551 
552  //**********************************************************************************************
557  inline bool isAligned() const {
558  return lhs_.isAligned() && rhs_.isAligned();
559  }
560  //**********************************************************************************************
561 
562  //**********************************************************************************************
567  inline bool canSMPAssign() const {
568  return lhs_.canSMPAssign() || rhs_.canSMPAssign() ||
570  }
571  //**********************************************************************************************
572 
573  private:
574  //**Member variables****************************************************************************
575  LeftOperand lhs_;
576  RightOperand rhs_;
577  //**********************************************************************************************
578 
579  //**Assignment to dense vectors*****************************************************************
593  template< typename VT > // Type of the target dense vector
594  friend inline typename EnableIf< UseAssign<VT> >::Type
595  assign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
596  {
598 
599  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
600 
601  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
602  multAssign( ~lhs, rhs.rhs_ );
603  }
604  else if( !IsComputation<VT2>::value && isSame( ~lhs, rhs.rhs_ ) ) {
605  multAssign( ~lhs, rhs.lhs_ );
606  }
607  else {
608  assign ( ~lhs, rhs.lhs_ );
609  multAssign( ~lhs, rhs.rhs_ );
610  }
611  }
613  //**********************************************************************************************
614 
615  //**Assignment to sparse vectors****************************************************************
629  template< typename VT > // Type of the target sparse vector
630  friend inline typename EnableIf< UseAssign<VT> >::Type
631  assign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
632  {
634 
638 
639  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
640 
641  const ResultType tmp( serial( rhs ) );
642  assign( ~lhs, tmp );
643  }
645  //**********************************************************************************************
646 
647  //**Addition assignment to dense vectors********************************************************
661  template< typename VT > // Type of the target dense vector
662  friend inline typename EnableIf< UseAssign<VT> >::Type
663  addAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
664  {
666 
670 
671  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
672 
673  const ResultType tmp( serial( rhs ) );
674  addAssign( ~lhs, tmp );
675  }
677  //**********************************************************************************************
678 
679  //**Addition assignment to sparse vectors*******************************************************
680  // No special implementation for the addition assignment to sparse vectors.
681  //**********************************************************************************************
682 
683  //**Subtraction assignment to dense vectors*****************************************************
697  template< typename VT > // Type of the target dense vector
698  friend inline typename EnableIf< UseAssign<VT> >::Type
699  subAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
700  {
702 
706 
707  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
708 
709  const ResultType tmp( serial( rhs ) );
710  subAssign( ~lhs, tmp );
711  }
713  //**********************************************************************************************
714 
715  //**Subtraction assignment to sparse vectors****************************************************
716  // No special implementation for the subtraction assignment to sparse vectors.
717  //**********************************************************************************************
718 
719  //**Multiplication assignment to dense vectors**************************************************
733  template< typename VT > // Type of the target dense vector
734  friend inline typename EnableIf< UseAssign<VT> >::Type
735  multAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
736  {
738 
739  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
740 
741  multAssign( ~lhs, rhs.lhs_ );
742  multAssign( ~lhs, rhs.rhs_ );
743  }
745  //**********************************************************************************************
746 
747  //**Multiplication assignment to sparse vectors*************************************************
761  template< typename VT > // Type of the target sparse vector
762  friend inline typename EnableIf< UseAssign<VT> >::Type
763  multAssign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
764  {
766 
767  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
768 
769  multAssign( ~lhs, rhs.lhs_ );
770  multAssign( ~lhs, rhs.rhs_ );
771  }
773  //**********************************************************************************************
774 
775  //**SMP assignment to dense vectors*************************************************************
789  template< typename VT > // Type of the target dense vector
790  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
791  smpAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
792  {
794 
795  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
796 
797  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
798  smpMultAssign( ~lhs, rhs.rhs_ );
799  }
800  else if( !IsComputation<VT2>::value && isSame( ~lhs, rhs.rhs_ ) ) {
801  smpMultAssign( ~lhs, rhs.lhs_ );
802  }
803  else {
804  smpAssign ( ~lhs, rhs.lhs_ );
805  smpMultAssign( ~lhs, rhs.rhs_ );
806  }
807  }
809  //**********************************************************************************************
810 
811  //**SMP assignment to sparse vectors************************************************************
825  template< typename VT > // Type of the target sparse vector
826  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
827  smpAssign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
828  {
830 
834 
835  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
836 
837  const ResultType tmp( rhs );
838  smpAssign( ~lhs, tmp );
839  }
841  //**********************************************************************************************
842 
843  //**SMP addition assignment to dense vectors****************************************************
857  template< typename VT > // Type of the target dense vector
858  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
859  smpAddAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
860  {
862 
866 
867  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
868 
869  const ResultType tmp( rhs );
870  smpAddAssign( ~lhs, tmp );
871  }
873  //**********************************************************************************************
874 
875  //**SMP addition assignment to sparse vectors***************************************************
876  // No special implementation for the SMP addition assignment to sparse vectors.
877  //**********************************************************************************************
878 
879  //**SMP subtraction assignment to dense vectors*************************************************
894  template< typename VT > // Type of the target dense vector
895  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
896  smpSubAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
897  {
899 
903 
904  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
905 
906  const ResultType tmp( rhs );
907  smpSubAssign( ~lhs, tmp );
908  }
910  //**********************************************************************************************
911 
912  //**SMP subtraction assignment to sparse vectors************************************************
913  // No special implementation for the SMP subtraction assignment to sparse vectors.
914  //**********************************************************************************************
915 
916  //**SMP multiplication assignment to dense vectors**********************************************
931  template< typename VT > // Type of the target dense vector
932  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
933  smpMultAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
934  {
936 
937  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
938 
939  smpMultAssign( ~lhs, rhs.lhs_ );
940  smpMultAssign( ~lhs, rhs.rhs_ );
941  }
943  //**********************************************************************************************
944 
945  //**SMP multiplication assignment to sparse vectors*********************************************
960  template< typename VT > // Type of the target sparse vector
961  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
962  smpMultAssign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
963  {
965 
966  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
967 
968  smpMultAssign( ~lhs, rhs.lhs_ );
969  smpMultAssign( ~lhs, rhs.rhs_ );
970  }
972  //**********************************************************************************************
973 
974  //**Compile time checks*************************************************************************
982  //**********************************************************************************************
983 };
984 //*************************************************************************************************
985 
986 
987 
988 
989 //=================================================================================================
990 //
991 // GLOBAL BINARY ARITHMETIC OPERATORS
992 //
993 //=================================================================================================
994 
995 //*************************************************************************************************
1020 template< typename T1 // Type of the left-hand side dense vector
1021  , typename T2 // Type of the right-hand side dense vector
1022  , bool TF > // Transpose flag
1023 inline const DVecDVecMultExpr<T1,T2,TF>
1025 {
1027 
1028  if( (~lhs).size() != (~rhs).size() )
1029  throw std::invalid_argument( "Vector sizes do not match" );
1030 
1031  return DVecDVecMultExpr<T1,T2,TF>( ~lhs, ~rhs );
1032 }
1033 //*************************************************************************************************
1034 
1035 
1036 
1037 
1038 //=================================================================================================
1039 //
1040 // SIZE SPECIALIZATIONS
1041 //
1042 //=================================================================================================
1043 
1044 //*************************************************************************************************
1046 template< typename VT1, typename VT2, bool TF >
1047 struct Size< DVecDVecMultExpr<VT1,VT2,TF> >
1048  : public Max< Size<VT1>, Size<VT2> >::Type
1049 {};
1051 //*************************************************************************************************
1052 
1053 
1054 
1055 
1056 //=================================================================================================
1057 //
1058 // EXPRESSION TRAIT SPECIALIZATIONS
1059 //
1060 //=================================================================================================
1061 
1062 //*************************************************************************************************
1064 template< typename VT1, typename VT2, bool TF, bool AF >
1065 struct SubvectorExprTrait< DVecDVecMultExpr<VT1,VT2,TF>, AF >
1066 {
1067  public:
1068  //**********************************************************************************************
1069  typedef typename MultExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
1070  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
1071  //**********************************************************************************************
1072 };
1074 //*************************************************************************************************
1075 
1076 } // namespace blaze
1077 
1078 #endif
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecDVecMultExpr.h:420
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:160
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:8247
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecMultExpr.h:245
ConstIterator(LeftIteratorType left, RightIteratorType right)
Constructor for the ConstIterator class.
Definition: DVecDVecMultExpr.h:208
Header file for basic type definitions.
DifferenceType difference_type
Difference between two iterators.
Definition: DVecDVecMultExpr.h:193
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:264
Iterator over the elements of the dense vector.
Definition: DVecDVecMultExpr.h:178
ReferenceType reference
Reference return type.
Definition: DVecDVecMultExpr.h:192
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:209
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecMultExpr.h:534
LeftOperand lhs_
Left-hand side dense vector of the multiplication expression.
Definition: DVecDVecMultExpr.h:575
VT2::ResultType RT2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:98
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:354
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:199
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:332
VT1::ReturnType RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:99
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2507
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:261
Header file for the DenseVector base class.
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecDVecMultExpr.h:419
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:699
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:289
Header file for the RequiresEvaluation type trait.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:321
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecDVecMultExpr.h:376
Constraint on the data type.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecDVecMultExpr.h:186
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:263
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:257
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:547
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecDVecMultExpr.h:159
PointerType pointer
Pointer return type.
Definition: DVecDVecMultExpr.h:191
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecDVecMultExpr.h:182
RightOperand rightOperand() const
Returns the right-hand side dense vector operand.
Definition: DVecDVecMultExpr.h:522
SelectType< IsExpression< VT2 >::value, const VT2, const VT2 & >::Type RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:172
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
VT2::ReturnType RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:100
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:233
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecDVecMultExpr.h:467
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecDVecMultExpr.h:502
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecDVecMultExpr.h:299
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:166
SelectType< IsExpression< VT1 >::value, const VT1, const VT1 & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:169
Constraint on the data type.
VT1::ResultType RT1
Result type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:97
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:343
#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:365
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecDVecMultExpr.h:492
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecMultExpr.h:279
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:102
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2505
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:156
Expression object for dense vector-dense vector multiplications.The DVecDVecMultExpr class represents...
Definition: DVecDVecMultExpr.h:91
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:482
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:2506
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:183
Header file for run time assertion macros.
ValueType value_type
Type of the underlying elements.
Definition: DVecDVecMultExpr.h:190
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:150
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:189
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:310
VT2::ElementType ET2
Element type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:104
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecDVecMultExpr.h:455
MultExprTrait< RN1, RN2 >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecDVecMultExpr.h:117
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecDVecMultExpr.h:267
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecMultExpr.h:388
ElementType * PointerType
Pointer return type.
Definition: DVecDVecMultExpr.h:184
DVecDVecMultExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the DVecDVecMultExpr class.
Definition: DVecDVecMultExpr.h:441
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecDVecMultExpr.h:512
VT1::CompositeType CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:101
Header file for all intrinsic functionality.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecDVecMultExpr.h:567
#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:103
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: DVecDVecMultExpr.h:157
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:412
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:557
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:2502
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:576
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecDVecMultExpr.h:220
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecDVecMultExpr.h:400
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecDVecMultExpr.h:163
System settings for the inline keywords.
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:196
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecDVecMultExpr.h:158
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:185