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 <iterator>
51 #include <blaze/math/Intrinsics.h>
63 #include <blaze/system/Inline.h>
65 #include <blaze/util/Assert.h>
67 #include <blaze/util/EnableIf.h>
68 #include <blaze/util/Exception.h>
70 #include <blaze/util/mpl/And.h>
71 #include <blaze/util/mpl/Max.h>
72 #include <blaze/util/SelectType.h>
73 #include <blaze/util/Types.h>
76 
77 
78 namespace blaze {
79 
80 //=================================================================================================
81 //
82 // CLASS DVECDVECMULTEXPR
83 //
84 //=================================================================================================
85 
86 //*************************************************************************************************
93 template< typename VT1 // Type of the left-hand side dense vector
94  , typename VT2 // Type of the right-hand side dense vector
95  , bool TF > // Transpose flag
96 class DVecDVecMultExpr : public DenseVector< DVecDVecMultExpr<VT1,VT2,TF>, TF >
97  , private VecVecMultExpr
98  , private Computation
99 {
100  private:
101  //**Type definitions****************************************************************************
102  typedef typename VT1::ResultType RT1;
103  typedef typename VT2::ResultType RT2;
104  typedef typename VT1::ReturnType RN1;
105  typedef typename VT2::ReturnType RN2;
106  typedef typename VT1::CompositeType CT1;
107  typedef typename VT2::CompositeType CT2;
108  typedef typename VT1::ElementType ET1;
109  typedef typename VT2::ElementType ET2;
110  //**********************************************************************************************
111 
112  //**Return type evaluation**********************************************************************
114 
119  enum { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
120 
123  //**********************************************************************************************
124 
125  //**Serial evaluation strategy******************************************************************
127 
133  enum { useAssign = ( RequiresEvaluation<VT1>::value || RequiresEvaluation<VT2>::value || !returnExpr ) };
134 
136  template< typename VT >
138  struct UseAssign {
139  enum { value = useAssign };
140  };
142  //**********************************************************************************************
143 
144  //**Parallel evaluation strategy****************************************************************
146 
152  template< typename VT >
153  struct UseSMPAssign {
154  enum { value = ( !VT1::smpAssignable || !VT2::smpAssignable ) && useAssign };
155  };
157  //**********************************************************************************************
158 
159  public:
160  //**Type definitions****************************************************************************
166 
169 
172 
174  typedef typename SelectType< IsExpression<VT1>::value, const VT1, const VT1& >::Type LeftOperand;
175 
177  typedef typename SelectType< IsExpression<VT2>::value, const VT2, const VT2& >::Type RightOperand;
178  //**********************************************************************************************
179 
180  //**ConstIterator class definition**************************************************************
184  {
185  public:
186  //**Type definitions*************************************************************************
187  typedef std::random_access_iterator_tag IteratorCategory;
188  typedef ElementType ValueType;
189  typedef ElementType* PointerType;
190  typedef ElementType& ReferenceType;
192 
193  // STL iterator requirements
194  typedef IteratorCategory iterator_category;
195  typedef ValueType value_type;
196  typedef PointerType pointer;
197  typedef ReferenceType reference;
198  typedef DifferenceType difference_type;
199 
202 
205  //*******************************************************************************************
206 
207  //**Constructor******************************************************************************
213  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right )
214  : left_ ( left ) // Iterator to the current left-hand side element
215  , right_( right ) // Iterator to the current right-hand side element
216  {}
217  //*******************************************************************************************
218 
219  //**Addition assignment operator*************************************************************
225  inline ConstIterator& operator+=( size_t inc ) {
226  left_ += inc;
227  right_ += inc;
228  return *this;
229  }
230  //*******************************************************************************************
231 
232  //**Subtraction assignment operator**********************************************************
238  inline ConstIterator& operator-=( size_t dec ) {
239  left_ -= dec;
240  right_ -= dec;
241  return *this;
242  }
243  //*******************************************************************************************
244 
245  //**Prefix increment operator****************************************************************
251  ++left_;
252  ++right_;
253  return *this;
254  }
255  //*******************************************************************************************
256 
257  //**Postfix increment operator***************************************************************
262  inline const ConstIterator operator++( int ) {
263  return ConstIterator( left_++, right_++ );
264  }
265  //*******************************************************************************************
266 
267  //**Prefix decrement operator****************************************************************
273  --left_;
274  --right_;
275  return *this;
276  }
277  //*******************************************************************************************
278 
279  //**Postfix decrement operator***************************************************************
284  inline const ConstIterator operator--( int ) {
285  return ConstIterator( left_--, right_-- );
286  }
287  //*******************************************************************************************
288 
289  //**Element access operator******************************************************************
294  inline ReturnType operator*() const {
295  return (*left_) * (*right_);
296  }
297  //*******************************************************************************************
298 
299  //**Load function****************************************************************************
304  inline IntrinsicType load() const {
305  return left_.load() * right_.load();
306  }
307  //*******************************************************************************************
308 
309  //**Equality operator************************************************************************
315  inline bool operator==( const ConstIterator& rhs ) const {
316  return left_ == rhs.left_;
317  }
318  //*******************************************************************************************
319 
320  //**Inequality operator**********************************************************************
326  inline bool operator!=( const ConstIterator& rhs ) const {
327  return left_ != rhs.left_;
328  }
329  //*******************************************************************************************
330 
331  //**Less-than operator***********************************************************************
337  inline bool operator<( const ConstIterator& rhs ) const {
338  return left_ < rhs.left_;
339  }
340  //*******************************************************************************************
341 
342  //**Greater-than operator********************************************************************
348  inline bool operator>( const ConstIterator& rhs ) const {
349  return left_ > rhs.left_;
350  }
351  //*******************************************************************************************
352 
353  //**Less-or-equal-than operator**************************************************************
359  inline bool operator<=( const ConstIterator& rhs ) const {
360  return left_ <= rhs.left_;
361  }
362  //*******************************************************************************************
363 
364  //**Greater-or-equal-than operator***********************************************************
370  inline bool operator>=( const ConstIterator& rhs ) const {
371  return left_ >= rhs.left_;
372  }
373  //*******************************************************************************************
374 
375  //**Subtraction operator*********************************************************************
381  inline DifferenceType operator-( const ConstIterator& rhs ) const {
382  return left_ - rhs.left_;
383  }
384  //*******************************************************************************************
385 
386  //**Addition operator************************************************************************
393  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
394  return ConstIterator( it.left_ + inc, it.right_ + inc );
395  }
396  //*******************************************************************************************
397 
398  //**Addition operator************************************************************************
405  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
406  return ConstIterator( it.left_ + inc, it.right_ + inc );
407  }
408  //*******************************************************************************************
409 
410  //**Subtraction operator*********************************************************************
417  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
418  return ConstIterator( it.left_ - dec, it.right_ - dec );
419  }
420  //*******************************************************************************************
421 
422  private:
423  //**Member variables*************************************************************************
424  LeftIteratorType left_;
425  RightIteratorType right_;
426  //*******************************************************************************************
427  };
428  //**********************************************************************************************
429 
430  //**Compilation flags***************************************************************************
432  enum { vectorizable = VT1::vectorizable && VT2::vectorizable &&
435 
437  enum { smpAssignable = VT1::smpAssignable && VT2::smpAssignable };
438  //**********************************************************************************************
439 
440  //**Constructor*********************************************************************************
446  explicit inline DVecDVecMultExpr( const VT1& lhs, const VT2& rhs )
447  : lhs_( lhs ) // Left-hand side dense vector of the multiplication expression
448  , rhs_( rhs ) // Right-hand side dense vector of the multiplication expression
449  {
450  BLAZE_INTERNAL_ASSERT( lhs.size() == rhs.size(), "Invalid vector sizes" );
451  }
452  //**********************************************************************************************
453 
454  //**Subscript operator**************************************************************************
460  inline ReturnType operator[]( size_t index ) const {
461  BLAZE_INTERNAL_ASSERT( index < lhs_.size(), "Invalid vector access index" );
462  return lhs_[index] * rhs_[index];
463  }
464  //**********************************************************************************************
465 
466  //**At function*********************************************************************************
473  inline ReturnType at( size_t index ) const {
474  if( index >= lhs_.size() ) {
475  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
476  }
477  return (*this)[index];
478  }
479  //**********************************************************************************************
480 
481  //**Load function*******************************************************************************
487  BLAZE_ALWAYS_INLINE IntrinsicType load( size_t index ) const {
488  typedef IntrinsicTrait<ElementType> IT;
489  BLAZE_INTERNAL_ASSERT( index < lhs_.size() , "Invalid vector access index" );
490  BLAZE_INTERNAL_ASSERT( index % IT::size == 0UL, "Invalid vector access index" );
491  const IntrinsicType xmm1( lhs_.load( index ) );
492  const IntrinsicType xmm2( rhs_.load( index ) );
493  return xmm1 * xmm2;
494  }
495  //**********************************************************************************************
496 
497  //**Begin function******************************************************************************
502  inline ConstIterator begin() const {
503  return ConstIterator( lhs_.begin(), rhs_.begin() );
504  }
505  //**********************************************************************************************
506 
507  //**End function********************************************************************************
512  inline ConstIterator end() const {
513  return ConstIterator( lhs_.end(), rhs_.end() );
514  }
515  //**********************************************************************************************
516 
517  //**Size function*******************************************************************************
522  inline size_t size() const {
523  return lhs_.size();
524  }
525  //**********************************************************************************************
526 
527  //**Left operand access*************************************************************************
532  inline LeftOperand leftOperand() const {
533  return lhs_;
534  }
535  //**********************************************************************************************
536 
537  //**Right operand access************************************************************************
542  inline RightOperand rightOperand() const {
543  return rhs_;
544  }
545  //**********************************************************************************************
546 
547  //**********************************************************************************************
553  template< typename T >
554  inline bool canAlias( const T* alias ) const {
555  return ( IsExpression<VT1>::value && ( RequiresEvaluation<VT1>::value ? lhs_.isAliased( alias ) : lhs_.canAlias( alias ) ) ) ||
556  ( IsExpression<VT2>::value && ( RequiresEvaluation<VT2>::value ? rhs_.isAliased( alias ) : rhs_.canAlias( alias ) ) );
557  }
558  //**********************************************************************************************
559 
560  //**********************************************************************************************
566  template< typename T >
567  inline bool isAliased( const T* alias ) const {
568  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
569  }
570  //**********************************************************************************************
571 
572  //**********************************************************************************************
577  inline bool isAligned() const {
578  return lhs_.isAligned() && rhs_.isAligned();
579  }
580  //**********************************************************************************************
581 
582  //**********************************************************************************************
587  inline bool canSMPAssign() const {
588  return lhs_.canSMPAssign() || rhs_.canSMPAssign() ||
589  ( size() > SMP_DVECDVECMULT_THRESHOLD );
590  }
591  //**********************************************************************************************
592 
593  private:
594  //**Member variables****************************************************************************
595  LeftOperand lhs_;
596  RightOperand rhs_;
597  //**********************************************************************************************
598 
599  //**Assignment to dense vectors*****************************************************************
613  template< typename VT > // Type of the target dense vector
614  friend inline typename EnableIf< UseAssign<VT> >::Type
615  assign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
616  {
618 
619  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
620 
621  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
622  multAssign( ~lhs, rhs.rhs_ );
623  }
624  else if( !IsComputation<VT2>::value && isSame( ~lhs, rhs.rhs_ ) ) {
625  multAssign( ~lhs, rhs.lhs_ );
626  }
627  else {
628  assign ( ~lhs, rhs.lhs_ );
629  multAssign( ~lhs, rhs.rhs_ );
630  }
631  }
633  //**********************************************************************************************
634 
635  //**Assignment to sparse vectors****************************************************************
649  template< typename VT > // Type of the target sparse vector
650  friend inline typename EnableIf< UseAssign<VT> >::Type
651  assign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
652  {
654 
658 
659  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
660 
661  const ResultType tmp( serial( rhs ) );
662  assign( ~lhs, tmp );
663  }
665  //**********************************************************************************************
666 
667  //**Addition assignment to dense vectors********************************************************
681  template< typename VT > // Type of the target dense vector
682  friend inline typename EnableIf< UseAssign<VT> >::Type
683  addAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
684  {
686 
690 
691  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
692 
693  const ResultType tmp( serial( rhs ) );
694  addAssign( ~lhs, tmp );
695  }
697  //**********************************************************************************************
698 
699  //**Addition assignment to sparse vectors*******************************************************
700  // No special implementation for the addition assignment to sparse vectors.
701  //**********************************************************************************************
702 
703  //**Subtraction assignment to dense vectors*****************************************************
717  template< typename VT > // Type of the target dense vector
718  friend inline typename EnableIf< UseAssign<VT> >::Type
719  subAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
720  {
722 
726 
727  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
728 
729  const ResultType tmp( serial( rhs ) );
730  subAssign( ~lhs, tmp );
731  }
733  //**********************************************************************************************
734 
735  //**Subtraction assignment to sparse vectors****************************************************
736  // No special implementation for the subtraction assignment to sparse vectors.
737  //**********************************************************************************************
738 
739  //**Multiplication assignment to dense vectors**************************************************
753  template< typename VT > // Type of the target dense vector
754  friend inline typename EnableIf< UseAssign<VT> >::Type
755  multAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
756  {
758 
759  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
760 
761  multAssign( ~lhs, rhs.lhs_ );
762  multAssign( ~lhs, rhs.rhs_ );
763  }
765  //**********************************************************************************************
766 
767  //**Multiplication assignment to sparse vectors*************************************************
781  template< typename VT > // Type of the target sparse vector
782  friend inline typename EnableIf< UseAssign<VT> >::Type
783  multAssign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
784  {
786 
787  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
788 
789  multAssign( ~lhs, rhs.lhs_ );
790  multAssign( ~lhs, rhs.rhs_ );
791  }
793  //**********************************************************************************************
794 
795  //**SMP assignment to dense vectors*************************************************************
809  template< typename VT > // Type of the target dense vector
810  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
811  smpAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
812  {
814 
815  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
816 
817  if( !IsComputation<VT1>::value && isSame( ~lhs, rhs.lhs_ ) ) {
818  smpMultAssign( ~lhs, rhs.rhs_ );
819  }
820  else if( !IsComputation<VT2>::value && isSame( ~lhs, rhs.rhs_ ) ) {
821  smpMultAssign( ~lhs, rhs.lhs_ );
822  }
823  else {
824  smpAssign ( ~lhs, rhs.lhs_ );
825  smpMultAssign( ~lhs, rhs.rhs_ );
826  }
827  }
829  //**********************************************************************************************
830 
831  //**SMP assignment to sparse vectors************************************************************
845  template< typename VT > // Type of the target sparse vector
846  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
847  smpAssign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
848  {
850 
854 
855  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
856 
857  const ResultType tmp( rhs );
858  smpAssign( ~lhs, tmp );
859  }
861  //**********************************************************************************************
862 
863  //**SMP addition assignment to dense vectors****************************************************
877  template< typename VT > // Type of the target dense vector
878  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
879  smpAddAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
880  {
882 
886 
887  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
888 
889  const ResultType tmp( rhs );
890  smpAddAssign( ~lhs, tmp );
891  }
893  //**********************************************************************************************
894 
895  //**SMP addition assignment to sparse vectors***************************************************
896  // No special implementation for the SMP addition assignment to sparse vectors.
897  //**********************************************************************************************
898 
899  //**SMP subtraction assignment to dense vectors*************************************************
914  template< typename VT > // Type of the target dense vector
915  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
916  smpSubAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
917  {
919 
923 
924  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
925 
926  const ResultType tmp( rhs );
927  smpSubAssign( ~lhs, tmp );
928  }
930  //**********************************************************************************************
931 
932  //**SMP subtraction assignment to sparse vectors************************************************
933  // No special implementation for the SMP subtraction assignment to sparse vectors.
934  //**********************************************************************************************
935 
936  //**SMP multiplication assignment to dense vectors**********************************************
951  template< typename VT > // Type of the target dense vector
952  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
953  smpMultAssign( DenseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
954  {
956 
957  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
958 
959  smpMultAssign( ~lhs, rhs.lhs_ );
960  smpMultAssign( ~lhs, rhs.rhs_ );
961  }
963  //**********************************************************************************************
964 
965  //**SMP multiplication assignment to sparse vectors*********************************************
980  template< typename VT > // Type of the target sparse vector
981  friend inline typename EnableIf< UseSMPAssign<VT> >::Type
982  smpMultAssign( SparseVector<VT,TF>& lhs, const DVecDVecMultExpr& rhs )
983  {
985 
986  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
987 
988  smpMultAssign( ~lhs, rhs.lhs_ );
989  smpMultAssign( ~lhs, rhs.rhs_ );
990  }
992  //**********************************************************************************************
993 
994  //**Compile time checks*************************************************************************
1002  //**********************************************************************************************
1003 };
1004 //*************************************************************************************************
1005 
1006 
1007 
1008 
1009 //=================================================================================================
1010 //
1011 // GLOBAL BINARY ARITHMETIC OPERATORS
1012 //
1013 //=================================================================================================
1014 
1015 //*************************************************************************************************
1040 template< typename T1 // Type of the left-hand side dense vector
1041  , typename T2 // Type of the right-hand side dense vector
1042  , bool TF > // Transpose flag
1043 inline const DVecDVecMultExpr<T1,T2,TF>
1045 {
1047 
1048  if( (~lhs).size() != (~rhs).size() ) {
1049  BLAZE_THROW_INVALID_ARGUMENT( "Vector sizes do not match" );
1050  }
1051 
1052  return DVecDVecMultExpr<T1,T2,TF>( ~lhs, ~rhs );
1053 }
1054 //*************************************************************************************************
1055 
1056 
1057 
1058 
1059 //=================================================================================================
1060 //
1061 // SIZE SPECIALIZATIONS
1062 //
1063 //=================================================================================================
1064 
1065 //*************************************************************************************************
1067 template< typename VT1, typename VT2, bool TF >
1068 struct Size< DVecDVecMultExpr<VT1,VT2,TF> >
1069  : public Max< Size<VT1>, Size<VT2> >
1070 {};
1072 //*************************************************************************************************
1073 
1074 
1075 
1076 
1077 //=================================================================================================
1078 //
1079 // ISALIGNED SPECIALIZATIONS
1080 //
1081 //=================================================================================================
1082 
1083 //*************************************************************************************************
1085 template< typename VT1, typename VT2, bool TF >
1086 struct IsAligned< DVecDVecMultExpr<VT1,VT2,TF> >
1087  : public IsTrue< And< IsAligned<VT1>, IsAligned<VT2> >::value >
1088 {};
1090 //*************************************************************************************************
1091 
1092 
1093 
1094 
1095 //=================================================================================================
1096 //
1097 // ISPADDED SPECIALIZATIONS
1098 //
1099 //=================================================================================================
1100 
1101 //*************************************************************************************************
1103 template< typename VT1, typename VT2, bool TF >
1104 struct IsPadded< DVecDVecMultExpr<VT1,VT2,TF> >
1105  : public IsTrue< And< IsPadded<VT1>, IsPadded<VT2> >::value >
1106 {};
1108 //*************************************************************************************************
1109 
1110 
1111 
1112 
1113 //=================================================================================================
1114 //
1115 // EXPRESSION TRAIT SPECIALIZATIONS
1116 //
1117 //=================================================================================================
1118 
1119 //*************************************************************************************************
1121 template< typename VT1, typename VT2, bool TF, bool AF >
1122 struct SubvectorExprTrait< DVecDVecMultExpr<VT1,VT2,TF>, AF >
1123 {
1124  public:
1125  //**********************************************************************************************
1126  typedef typename MultExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
1127  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
1128  //**********************************************************************************************
1129 };
1131 //*************************************************************************************************
1132 
1133 } // namespace blaze
1134 
1135 #endif
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecDVecMultExpr.h:425
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
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:165
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:7820
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecDVecMultExpr.h:250
ConstIterator(LeftIteratorType left, RightIteratorType right)
Constructor for the ConstIterator class.
Definition: DVecDVecMultExpr.h:213
Header file for basic type definitions.
DifferenceType difference_type
Difference between two iterators.
Definition: DVecDVecMultExpr.h:198
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
Iterator over the elements of the dense vector.
Definition: DVecDVecMultExpr.h:183
ReferenceType reference
Reference return type.
Definition: DVecDVecMultExpr.h:197
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecDVecMultExpr.h:554
LeftOperand lhs_
Left-hand side dense vector of the multiplication expression.
Definition: DVecDVecMultExpr.h:595
VT2::ResultType RT2
Result type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:103
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:359
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:647
VT2::ConstIterator RightIteratorType
ConstIterator type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:204
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:337
VT1::ReturnType RN1
Return type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:104
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:259
Header file for the And class template.
Header file for the DenseVector base class.
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecDVecMultExpr.h:424
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
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:294
Header file for the RequiresEvaluation type trait.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:326
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecDVecMultExpr.h:381
Constraint on the data type.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecDVecMultExpr.h:191
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:261
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:262
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:567
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecDVecMultExpr.h:164
PointerType pointer
Pointer return type.
Definition: DVecDVecMultExpr.h:196
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:187
RightOperand rightOperand() const
Returns the right-hand side dense vector operand.
Definition: DVecDVecMultExpr.h:542
SelectType< IsExpression< VT2 >::value, const VT2, const VT2 & >::Type RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:177
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
VT2::ReturnType RN2
Return type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:105
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecDVecMultExpr.h:238
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecDVecMultExpr.h:487
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecDVecMultExpr.h:522
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecDVecMultExpr.h:304
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:171
SelectType< IsExpression< VT1 >::value, const VT1, const VT1 & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:174
Header file for the IsAligned type trait.
Constraint on the data type.
VT1::ResultType RT1
Result type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:102
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:348
#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:370
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecDVecMultExpr.h:512
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecDVecMultExpr.h:284
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:107
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecDVecMultExpr.h:473
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
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:161
Expression object for dense vector-dense vector multiplications.The DVecDVecMultExpr class represents...
Definition: DVecDVecMultExpr.h:96
Header file for the EnableIf class template.
Header file for the IsPadded type trait.
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:502
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:2587
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
ElementType ValueType
Type of the underlying elements.
Definition: DVecDVecMultExpr.h:188
Header file for run time assertion macros.
ValueType value_type
Type of the underlying elements.
Definition: DVecDVecMultExpr.h:195
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:138
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:194
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecDVecMultExpr.h:315
VT2::ElementType ET2
Element type of the right-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:109
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecDVecMultExpr.h:460
MultExprTrait< RN1, RN2 >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecDVecMultExpr.h:122
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecDVecMultExpr.h:272
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecDVecMultExpr.h:393
ElementType * PointerType
Pointer return type.
Definition: DVecDVecMultExpr.h:189
DVecDVecMultExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the DVecDVecMultExpr class.
Definition: DVecDVecMultExpr.h:446
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecDVecMultExpr.h:532
VT1::CompositeType CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecDVecMultExpr.h:106
Header file for all intrinsic functionality.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecDVecMultExpr.h:587
#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:108
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: DVecDVecMultExpr.h:162
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:417
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:577
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:118
#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:2583
Header file for the IsTrue value trait.
Header file for the SubvectorExprTrait class template.
RightOperand rhs_
Right-hand side dense vector of the multiplication expression.
Definition: DVecDVecMultExpr.h:596
Header file for exception macros.
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecDVecMultExpr.h:225
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecDVecMultExpr.h:405
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecDVecMultExpr.h:168
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:81
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:201
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecDVecMultExpr.h:163
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
ElementType & ReferenceType
Reference return type.
Definition: DVecDVecMultExpr.h:190