All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DVecTDVecMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECTDVECMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECTDVECMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
51 #include <blaze/math/Intrinsics.h>
64 #include <blaze/util/Assert.h>
66 #include <blaze/util/EnableIf.h>
68 #include <blaze/util/SelectType.h>
69 #include <blaze/util/Types.h>
71 
72 
73 namespace blaze {
74 
75 //=================================================================================================
76 //
77 // CLASS DVECTDVECMULTEXPR
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 class DVecTDVecMultExpr : public DenseMatrix< DVecTDVecMultExpr<VT1,VT2>, false >
91  , private VecTVecMultExpr
92  , private Computation
93 {
94  private:
95  //**Type definitions****************************************************************************
96  typedef typename VT1::ResultType RT1;
97  typedef typename VT2::ResultType RT2;
98  typedef typename RT1::ElementType ET1;
99  typedef typename RT2::ElementType ET2;
100  typedef typename VT1::ReturnType RN1;
101  typedef typename VT2::ReturnType RN2;
102  typedef typename VT1::CompositeType CT1;
103  typedef typename VT2::CompositeType CT2;
104  //**********************************************************************************************
105 
106  //**********************************************************************************************
109  //**********************************************************************************************
110 
111  //**********************************************************************************************
113  enum { evaluateRight = IsComputation<VT2>::value || RequiresEvaluation<VT2>::value };
114  //**********************************************************************************************
115 
116  //**Return type evaluation**********************************************************************
118 
123  enum { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
124 
127  //**********************************************************************************************
128 
129  //**Evaluation strategy*************************************************************************
131 
137  enum { useAssign = ( evaluateLeft || evaluateRight ) };
138 
140  template< typename VT >
142  struct UseAssign {
143  enum { value = useAssign };
144  };
146  //**********************************************************************************************
147 
148  //**********************************************************************************************
150 
153  template< typename T1, typename T2, typename T3 >
154  struct UseSMPAssignKernel {
155  enum { value = evaluateRight };
156  };
158  //**********************************************************************************************
159 
160  //**********************************************************************************************
162 
165  template< typename T1, typename T2, typename T3 >
166  struct UseVectorizedKernel {
167  enum { value = !UseSMPAssignKernel<T1,T2,T3>::value &&
168  T1::vectorizable && T2::vectorizable && T3::vectorizable &&
172  };
174  //**********************************************************************************************
175 
176  //**********************************************************************************************
178 
181  template< typename T1, typename T2, typename T3 >
182  struct UseDefaultKernel {
183  enum { value = !UseSMPAssignKernel<T1,T2,T3>::value &&
184  !UseVectorizedKernel<T1,T2,T3>::value };
185  };
187  //**********************************************************************************************
188 
189  public:
190  //**Type definitions****************************************************************************
197 
200 
203 
205  typedef typename SelectType< IsExpression<VT1>::value, const VT1, const VT1& >::Type LeftOperand;
206 
208  typedef typename SelectType< IsExpression<VT2>::value, const VT2, const VT2& >::Type RightOperand;
209 
212 
215  //**********************************************************************************************
216 
217  //**ConstIterator class definition**************************************************************
221  {
222  public:
223  //**Type definitions*************************************************************************
224  typedef std::random_access_iterator_tag IteratorCategory;
225  typedef ElementType ValueType;
226  typedef ElementType* PointerType;
227  typedef ElementType& ReferenceType;
229 
230  // STL iterator requirements
236 
239 
242  //*******************************************************************************************
243 
244  //**Constructor******************************************************************************
250  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right )
251  : left_ ( left ) // Iterator to the current left-hand side element
252  , right_( right ) // Iterator to the current right-hand side element
253  {}
254  //*******************************************************************************************
255 
256  //**Addition assignment operator*************************************************************
262  inline ConstIterator& operator+=( size_t inc ) {
263  right_ += inc;
264  return *this;
265  }
266  //*******************************************************************************************
267 
268  //**Subtraction assignment operator**********************************************************
274  inline ConstIterator& operator-=( size_t dec ) {
275  right_ -= dec;
276  return *this;
277  }
278  //*******************************************************************************************
279 
280  //**Prefix increment operator****************************************************************
286  ++right_;
287  return *this;
288  }
289  //*******************************************************************************************
290 
291  //**Postfix increment operator***************************************************************
296  inline const ConstIterator operator++( int ) {
297  return ConstIterator( left_, right_++ );
298  }
299  //*******************************************************************************************
300 
301  //**Prefix decrement operator****************************************************************
307  --right_;
308  return *this;
309  }
310  //*******************************************************************************************
311 
312  //**Postfix decrement operator***************************************************************
317  inline const ConstIterator operator--( int ) {
318  return ConstIterator( left_, right_-- );
319  }
320  //*******************************************************************************************
321 
322  //**Element access operator******************************************************************
327  inline ReturnType operator*() const {
328  return (*left_) * (*right_);
329  }
330  //*******************************************************************************************
331 
332  //**Load function****************************************************************************
337  inline IntrinsicType load() const {
338  return set( *left_ ) * right_.load();
339  }
340  //*******************************************************************************************
341 
342  //**Equality operator************************************************************************
348  inline bool operator==( const ConstIterator& rhs ) const {
349  return right_ == rhs.right_;
350  }
351  //*******************************************************************************************
352 
353  //**Inequality operator**********************************************************************
359  inline bool operator!=( const ConstIterator& rhs ) const {
360  return right_ != rhs.right_;
361  }
362  //*******************************************************************************************
363 
364  //**Less-than operator***********************************************************************
370  inline bool operator<( const ConstIterator& rhs ) const {
371  return right_ < rhs.right_;
372  }
373  //*******************************************************************************************
374 
375  //**Greater-than operator********************************************************************
381  inline bool operator>( const ConstIterator& rhs ) const {
382  return right_ > rhs.right_;
383  }
384  //*******************************************************************************************
385 
386  //**Less-or-equal-than operator**************************************************************
392  inline bool operator<=( const ConstIterator& rhs ) const {
393  return right_ <= rhs.right_;
394  }
395  //*******************************************************************************************
396 
397  //**Greater-or-equal-than operator***********************************************************
403  inline bool operator>=( const ConstIterator& rhs ) const {
404  return right_ >= rhs.right_;
405  }
406  //*******************************************************************************************
407 
408  //**Subtraction operator*********************************************************************
414  inline DifferenceType operator-( const ConstIterator& rhs ) const {
415  return right_ - rhs.right_;
416  }
417  //*******************************************************************************************
418 
419  //**Addition operator************************************************************************
426  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
427  return ConstIterator( it.left_, it.right_ + inc );
428  }
429  //*******************************************************************************************
430 
431  //**Addition operator************************************************************************
438  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
439  return ConstIterator( it.left_, it.right_ + inc );
440  }
441  //*******************************************************************************************
442 
443  //**Subtraction operator*********************************************************************
450  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
451  return ConstIterator( it.left_, it.right_ - dec );
452  }
453  //*******************************************************************************************
454 
455  private:
456  //**Member variables*************************************************************************
459  //*******************************************************************************************
460  };
461  //**********************************************************************************************
462 
463  //**Compilation flags***************************************************************************
465  enum { vectorizable = VT1::vectorizable && VT2::vectorizable &&
468 
470  enum { smpAssignable = !evaluateRight };
471  //**********************************************************************************************
472 
473  //**Constructor*********************************************************************************
479  explicit inline DVecTDVecMultExpr( const VT1& lhs, const VT2& rhs )
480  : lhs_( lhs ) // Left-hand side dense vector of the multiplication expression
481  , rhs_( rhs ) // Right-hand side dense vector of the multiplication expression
482  {}
483  //**********************************************************************************************
484 
485  //**Access operator*****************************************************************************
492  inline ReturnType operator()( size_t i, size_t j ) const {
493  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
494  BLAZE_INTERNAL_ASSERT( j < rhs_.size(), "Invalid column access index" );
495 
496  return lhs_[i] * rhs_[j];
497  }
498  //**********************************************************************************************
499 
500  //**Load function*******************************************************************************
507  inline IntrinsicType load( size_t i, size_t j ) const {
508  typedef IntrinsicTrait<ElementType> IT;
509  BLAZE_INTERNAL_ASSERT( i < lhs_.size() , "Invalid row access index" );
510  BLAZE_INTERNAL_ASSERT( j < rhs_.size() , "Invalid column access index" );
511  BLAZE_INTERNAL_ASSERT( j % IT::size == 0UL, "Invalid column access index" );
512  const IntrinsicType xmm1( set( lhs_[i] ) );
513  const IntrinsicType xmm2( rhs_.load( j ) );
514  return xmm1 * xmm2;
515  }
516  //**********************************************************************************************
517 
518  //**Begin function******************************************************************************
524  inline ConstIterator begin( size_t i ) const {
525  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
526  return ConstIterator( lhs_.begin()+i, rhs_.begin() );
527  }
528  //**********************************************************************************************
529 
530  //**End function********************************************************************************
536  inline ConstIterator end( size_t i ) const {
537  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
538  return ConstIterator( lhs_.begin()+i, rhs_.end() );
539  }
540  //**********************************************************************************************
541 
542  //**Rows function*******************************************************************************
547  inline size_t rows() const {
548  return lhs_.size();
549  }
550  //**********************************************************************************************
551 
552  //**Columns function****************************************************************************
557  inline size_t columns() const {
558  return rhs_.size();
559  }
560  //**********************************************************************************************
561 
562  //**Left operand access*************************************************************************
567  inline LeftOperand leftOperand() const {
568  return lhs_;
569  }
570  //**********************************************************************************************
571 
572  //**Right operand access************************************************************************
577  inline RightOperand rightOperand() const {
578  return rhs_;
579  }
580  //**********************************************************************************************
581 
582  //**********************************************************************************************
588  template< typename T >
589  inline bool canAlias( const T* alias ) const {
590  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
591  }
592  //**********************************************************************************************
593 
594  //**********************************************************************************************
600  template< typename T >
601  inline bool isAliased( const T* alias ) const {
602  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
603  }
604  //**********************************************************************************************
605 
606  //**********************************************************************************************
611  inline bool isAligned() const {
612  return lhs_.isAligned() && rhs_.isAligned();
613  }
614  //**********************************************************************************************
615 
616  //**********************************************************************************************
621  inline bool canSMPAssign() const {
622  return ( rows() > SMP_DVECTDVECMULT_THRESHOLD );
623  }
624  //**********************************************************************************************
625 
626  private:
627  //**Member variables****************************************************************************
628  LeftOperand lhs_;
629  RightOperand rhs_;
630  //**********************************************************************************************
631 
632  //**Assignment to row-major dense matrices******************************************************
646  template< typename MT > // Type of the target dense matrix
647  friend inline typename EnableIf< UseAssign<MT> >::Type
649  {
651 
652  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
653  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
654 
655  LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
656  RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
657 
658  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
659  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
660  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
661  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
662 
663  DVecTDVecMultExpr::selectAssignKernel( ~lhs, x, y );
664  }
666  //**********************************************************************************************
667 
668  //**Default assignment to row-major dense matrices**********************************************
682  template< typename MT // Type of the left-hand side target matrix
683  , typename VT3 // Type of the left-hand side vector operand
684  , typename VT4 > // Type of the right-hand side vector operand
685  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
686  selectAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
687  {
688  const size_t m( (~A).rows() );
689  const size_t n( (~A).columns() );
690 
691  const size_t jend( n & size_t(-2) );
692  BLAZE_INTERNAL_ASSERT( ( n - ( n % 2UL ) ) == jend, "Invalid end calculation" );
693 
694  for( size_t i=0UL; i<m; ++i ) {
695  for( size_t j=0UL; j<jend; j+=2UL ) {
696  (~A)(i,j ) = x[i] * y[j ];
697  (~A)(i,j+1UL) = x[i] * y[j+1];
698  }
699  if( jend < n ) {
700  (~A)(i,jend) = x[i] * y[jend];
701  }
702  }
703  }
705  //**********************************************************************************************
706 
707  //**Vectorized assignment to row-major dense matrices*******************************************
721  template< typename MT // Type of the left-hand side target matrix
722  , typename VT3 // Type of the left-hand side vector operand
723  , typename VT4 > // Type of the right-hand side vector operand
724  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
725  selectAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
726  {
727  typedef IntrinsicTrait<ElementType> IT;
728 
729  const size_t m( (~A).rows() );
730  const size_t n( (~A).columns() );
731 
732  for( size_t i=0UL; i<m; ++i )
733  {
734  const IntrinsicType x1( set( x[i] ) );
735 
736  for( size_t j=0UL; j<n; j+=IT::size ) {
737  (~A).store( i, j, x1 * y.load(j) );
738  }
739  }
740  }
742  //**********************************************************************************************
743 
744  //**SMP assignment to row-major dense matrices**************************************************
758  template< typename MT // Type of the left-hand side target matrix
759  , typename VT3 // Type of the left-hand side vector operand
760  , typename VT4 > // Type of the right-hand side vector operand
761  static inline typename EnableIf< UseSMPAssignKernel<MT,VT3,VT4> >::Type
762  selectAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
763  {
764  smpAssign( A, x * y );
765  }
767  //**********************************************************************************************
768 
769  //**Assignment to column-major dense matrices***************************************************
781  template< typename MT > // Type of the target dense matrix
782  friend inline void assign( DenseMatrix<MT,true>& lhs, const DVecTDVecMultExpr& rhs )
783  {
785 
786  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
787  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
788 
789  LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
790  RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
791 
792  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
793  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
794  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
795  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
796 
797  DVecTDVecMultExpr::selectAssignKernel( ~lhs, x, y );
798  }
800  //**********************************************************************************************
801 
802  //**Default assignment to column-major dense matrices*******************************************
816  template< typename MT // Type of the left-hand side target matrix
817  , typename VT3 // Type of the left-hand side vector operand
818  , typename VT4 > // Type of the right-hand side vector operand
819  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
820  selectAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
821  {
822  const size_t m( (~A).rows() );
823  const size_t n( (~A).columns() );
824 
825  const size_t iend( m & size_t(-2) );
826  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == iend, "Invalid end calculation" );
827 
828  for( size_t j=0UL; j<n; ++j ) {
829  for( size_t i=0UL; i<iend; i+=2UL ) {
830  (~A)(i ,j) = x[i ] * y[j];
831  (~A)(i+1UL,j) = x[i+1] * y[j];
832  }
833  if( iend < m ) {
834  (~A)(iend,j) = x[iend] * y[j];
835  }
836  }
837  }
839  //**********************************************************************************************
840 
841  //**Vectorized assignment to column-major dense matrices****************************************
855  template< typename MT // Type of the left-hand side target matrix
856  , typename VT3 // Type of the left-hand side vector operand
857  , typename VT4 > // Type of the right-hand side vector operand
858  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
859  selectAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
860  {
861  typedef IntrinsicTrait<ElementType> IT;
862 
863  const size_t m( (~A).rows() );
864  const size_t n( (~A).columns() );
865 
866  for( size_t j=0UL; j<n; ++j )
867  {
868  const IntrinsicType y1( set( y[j] ) );
869 
870  for( size_t i=0UL; i<m; i+=IT::size ) {
871  (~A).store( i, j, x.load(i) * y1 );
872  }
873  }
874  }
876  //**********************************************************************************************
877 
878  //**SMP assignment to column-major dense matrices***********************************************
892  template< typename MT // Type of the left-hand side target matrix
893  , typename VT3 // Type of the left-hand side vector operand
894  , typename VT4 > // Type of the right-hand side vector operand
895  static inline typename EnableIf< UseSMPAssignKernel<MT,VT3,VT4> >::Type
896  selectAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
897  {
898  smpAssign( A, x * y );
899  }
901  //**********************************************************************************************
902 
903  //**Assignment to sparse matrices***************************************************************
915  template< typename MT // Type of the target sparse matrix
916  , bool SO > // Storage order of the target sparse matrix
917  friend inline void assign( SparseMatrix<MT,SO>& lhs, const DVecTDVecMultExpr& rhs )
918  {
920 
921  typedef typename SelectType< SO, OppositeType, ResultType >::Type TmpType;
922 
929 
930  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
931  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
932 
933  const TmpType tmp( rhs );
934  smpAssign( ~lhs, tmp );
935  }
937  //**********************************************************************************************
938 
939  //**Addition assignment to row-major dense matrices*********************************************
954  template< typename MT > // Type of the target dense matrix
955  friend inline typename EnableIf< UseAssign<MT> >::Type
956  addAssign( DenseMatrix<MT,false>& lhs, const DVecTDVecMultExpr& rhs )
957  {
959 
960  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
961  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
962 
963  LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
964  RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
965 
966  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
967  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
968  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
969  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
970 
971  DVecTDVecMultExpr::selectAddAssignKernel( ~lhs, x, y );
972  }
974  //**********************************************************************************************
975 
976  //**Default addition assignment to row-major dense matrices*************************************
990  template< typename MT // Type of the left-hand side target matrix
991  , typename VT3 // Type of the left-hand side vector operand
992  , typename VT4 > // Type of the right-hand side vector operand
993  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
994  selectAddAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
995  {
996  const size_t m( (~A).rows() );
997  const size_t n( (~A).columns() );
998 
999  const size_t jend( n & size_t(-2) );
1000  BLAZE_INTERNAL_ASSERT( ( n - ( n % 2UL ) ) == jend, "Invalid end calculation" );
1001 
1002  for( size_t i=0UL; i<m; ++i ) {
1003  for( size_t j=0UL; j<jend; j+=2UL ) {
1004  (~A)(i,j ) += x[i] * y[j ];
1005  (~A)(i,j+1UL) += x[i] * y[j+1UL];
1006  }
1007  if( jend < n ) {
1008  (~A)(i,jend) += x[i] * y[jend];
1009  }
1010  }
1011  }
1013  //**********************************************************************************************
1014 
1015  //**Vectorized addition assignment to row-major dense matrices**********************************
1029  template< typename MT // Type of the left-hand side target matrix
1030  , typename VT3 // Type of the left-hand side vector operand
1031  , typename VT4 > // Type of the right-hand side vector operand
1032  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
1033  selectAddAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
1034  {
1035  typedef IntrinsicTrait<ElementType> IT;
1036 
1037  const size_t m( (~A).rows() );
1038  const size_t n( (~A).columns() );
1039 
1040  for( size_t i=0UL; i<m; ++i )
1041  {
1042  const IntrinsicType x1( set( x[i] ) );
1043 
1044  for( size_t j=0UL; j<n; j+=IT::size ) {
1045  (~A).store( i, j, (~A).load(i,j) + x1 * y.load(j) );
1046  }
1047  }
1048  }
1050  //**********************************************************************************************
1051 
1052  //**SMP addition assignment to row-major dense matrices*****************************************
1066  template< typename MT // Type of the left-hand side target matrix
1067  , typename VT3 // Type of the left-hand side vector operand
1068  , typename VT4 > // Type of the right-hand side vector operand
1069  static inline typename EnableIf< UseSMPAssignKernel<MT,VT3,VT4> >::Type
1070  selectAddAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
1071  {
1072  smpAddAssign( A, x * y );
1073  }
1075  //**********************************************************************************************
1076 
1077  //**Addition assignment to column-major dense matrices******************************************
1090  template< typename MT > // Type of the target dense matrix
1091  friend inline void addAssign( DenseMatrix<MT,true>& lhs, const DVecTDVecMultExpr& rhs )
1092  {
1094 
1095  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1096  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1097 
1098  LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
1099  RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
1100 
1101  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1102  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1103  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1104  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1105 
1106  DVecTDVecMultExpr::selectAddAssignKernel( ~lhs, x, y );
1107  }
1109  //**********************************************************************************************
1110 
1111  //**Default addition assignment to column dense matrices****************************************
1125  template< typename MT // Type of the left-hand side target matrix
1126  , typename VT3 // Type of the left-hand side vector operand
1127  , typename VT4 > // Type of the right-hand side vector operand
1128  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
1129  selectAddAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1130  {
1131  const size_t m( (~A).rows() );
1132  const size_t n( (~A).columns() );
1133 
1134  const size_t iend( m & size_t(-2) );
1135  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == iend, "Invalid end calculation" );
1136 
1137  for( size_t j=0UL; j<n; ++j ) {
1138  for( size_t i=0UL; i<iend; i+=2UL ) {
1139  (~A)(i ,j) += x[i ] * y[j];
1140  (~A)(i+1UL,j) += x[i+1UL] * y[j];
1141  }
1142  if( iend < m ) {
1143  (~A)(iend,j) += x[iend] * y[j];
1144  }
1145  }
1146  }
1148  //**********************************************************************************************
1149 
1150  //**Vectorized addition assignment to column-major dense matrices*******************************
1164  template< typename MT // Type of the left-hand side target matrix
1165  , typename VT3 // Type of the left-hand side vector operand
1166  , typename VT4 > // Type of the right-hand side vector operand
1167  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
1168  selectAddAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1169  {
1170  typedef IntrinsicTrait<ElementType> IT;
1171 
1172  const size_t m( (~A).rows() );
1173  const size_t n( (~A).columns() );
1174 
1175  for( size_t j=0UL; j<n; ++j )
1176  {
1177  const IntrinsicType y1( set( y[j] ) );
1178 
1179  for( size_t i=0UL; i<m; i+=IT::size ) {
1180  (~A).store( i, j, (~A).load(i,j) + x.load(i) * y1 );
1181  }
1182  }
1183  }
1185  //**********************************************************************************************
1186 
1187  //**SMP addition assignment to column-major dense matrices**************************************
1201  template< typename MT // Type of the left-hand side target matrix
1202  , typename VT3 // Type of the left-hand side vector operand
1203  , typename VT4 > // Type of the right-hand side vector operand
1204  static inline typename EnableIf< UseSMPAssignKernel<MT,VT3,VT4> >::Type
1205  selectAddAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1206  {
1207  smpAddAssign( A, x * y );
1208  }
1210  //**********************************************************************************************
1211 
1212  //**Addition assignment to sparse matrices******************************************************
1213  // No special implementation for the addition assignment to sparse matrices.
1214  //**********************************************************************************************
1215 
1216  //**Subtraction assignment to row-major dense matrices******************************************
1231  template< typename MT > // Type of the target dense matrix
1232  friend inline typename EnableIf< UseAssign<MT> >::Type
1233  subAssign( DenseMatrix<MT,false>& lhs, const DVecTDVecMultExpr& rhs )
1234  {
1236 
1237  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1238  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1239 
1240  LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
1241  RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
1242 
1243  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1244  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1245  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1246  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1247 
1248  DVecTDVecMultExpr::selectSubAssignKernel( ~lhs, x, y );
1249  }
1251  //**********************************************************************************************
1252 
1253  //**Default subtraction assignment to row-major dense matrices**********************************
1267  template< typename MT // Type of the left-hand side target matrix
1268  , typename VT3 // Type of the left-hand side vector operand
1269  , typename VT4 > // Type of the right-hand side vector operand
1270  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
1271  selectSubAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
1272  {
1273  const size_t m( (~A).rows() );
1274  const size_t n( (~A).columns() );
1275 
1276  const size_t jend( n & size_t(-2) );
1277  BLAZE_INTERNAL_ASSERT( ( n - ( n % 2UL ) ) == jend, "Invalid end calculation" );
1278 
1279  for( size_t i=0UL; i<m; ++i ) {
1280  for( size_t j=0UL; j<jend; j+=2UL ) {
1281  (~A)(i,j ) -= x[i] * y[j ];
1282  (~A)(i,j+1UL) -= x[i] * y[j+1UL];
1283  }
1284  if( jend < n ) {
1285  (~A)(i,jend) -= x[i] * y[jend];
1286  }
1287  }
1288  }
1290  //**********************************************************************************************
1291 
1292  //**Vectorized subtraction assignment to row-major dense matrices*******************************
1306  template< typename MT // Type of the left-hand side target matrix
1307  , typename VT3 // Type of the left-hand side vector operand
1308  , typename VT4 > // Type of the right-hand side vector operand
1309  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
1310  selectSubAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
1311  {
1312  typedef IntrinsicTrait<ElementType> IT;
1313 
1314  const size_t m( (~A).rows() );
1315  const size_t n( (~A).columns() );
1316 
1317  for( size_t i=0UL; i<m; ++i )
1318  {
1319  const IntrinsicType x1( set( x[i] ) );
1320 
1321  for( size_t j=0UL; j<n; j+=IT::size ) {
1322  (~A).store( i, j, (~A).load(i,j) - x1 * y.load(j) );
1323  }
1324  }
1325  }
1327  //**********************************************************************************************
1328 
1329  //**SMP subtraction assignment to row-major dense matrices**************************************
1343  template< typename MT // Type of the left-hand side target matrix
1344  , typename VT3 // Type of the left-hand side vector operand
1345  , typename VT4 > // Type of the right-hand side vector operand
1346  static inline typename EnableIf< UseSMPAssignKernel<MT,VT3,VT4> >::Type
1347  selectSubAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
1348  {
1349  smpSubAssign( A, x * y );
1350  }
1352  //**********************************************************************************************
1353 
1354  //**Subtraction assignment to column-major dense matrices***************************************
1367  template< typename MT > // Type of the target dense matrix
1368  friend inline void subAssign( DenseMatrix<MT,true>& lhs, const DVecTDVecMultExpr& rhs )
1369  {
1371 
1372  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1373  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1374 
1375  LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
1376  RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
1377 
1378  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1379  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1380  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1381  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1382 
1383  DVecTDVecMultExpr::selectSubAssignKernel( ~lhs, x, y );
1384  }
1386  //**********************************************************************************************
1387 
1388  //**Default subtraction assignment to column dense matrices*************************************
1402  template< typename MT // Type of the left-hand side target matrix
1403  , typename VT3 // Type of the left-hand side vector operand
1404  , typename VT4 > // Type of the right-hand side vector operand
1405  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
1406  selectSubAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1407  {
1408  const size_t m( (~A).rows() );
1409  const size_t n( (~A).columns() );
1410 
1411  const size_t iend( m & size_t(-2) );
1412  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == iend, "Invalid end calculation" );
1413 
1414  for( size_t j=0UL; j<n; ++j ) {
1415  for( size_t i=0UL; i<iend; i+=2UL ) {
1416  (~A)(i ,j) -= x[i ] * y[j];
1417  (~A)(i+1UL,j) -= x[i+1UL] * y[j];
1418  }
1419  if( iend < m ) {
1420  (~A)(iend,j) -= x[iend] * y[j];
1421  }
1422  }
1423  }
1425  //**********************************************************************************************
1426 
1427  //**Vectorized subtraction assignment to column-major dense matrices****************************
1441  template< typename MT // Type of the left-hand side target matrix
1442  , typename VT3 // Type of the left-hand side vector operand
1443  , typename VT4 > // Type of the right-hand side vector operand
1444  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
1445  selectSubAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1446  {
1447  typedef IntrinsicTrait<ElementType> IT;
1448 
1449  const size_t m( (~A).rows() );
1450  const size_t n( (~A).columns() );
1451 
1452  for( size_t j=0UL; j<n; ++j )
1453  {
1454  const IntrinsicType y1( set( y[j] ) );
1455 
1456  for( size_t i=0UL; i<m; i+=IT::size ) {
1457  (~A).store( i, j, (~A).load(i,j) - x.load(i) * y1 );
1458  }
1459  }
1460  }
1462  //**********************************************************************************************
1463 
1464  //**SMP subtraction assignment to column-major dense matrices***********************************
1478  template< typename MT // Type of the left-hand side target matrix
1479  , typename VT3 // Type of the left-hand side vector operand
1480  , typename VT4 > // Type of the right-hand side vector operand
1481  static inline typename EnableIf< UseSMPAssignKernel<MT,VT3,VT4> >::Type
1482  selectSubAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1483  {
1484  smpSubAssign( A, x * y );
1485  }
1487  //**********************************************************************************************
1488 
1489  //**Subtraction assignment to sparse matrices***************************************************
1490  // No special implementation for the subtraction assignment to sparse matrices.
1491  //**********************************************************************************************
1492 
1493  //**Multiplication assignment to dense matrices*************************************************
1494  // No special implementation for the multiplication assignment to dense matrices.
1495  //**********************************************************************************************
1496 
1497  //**Multiplication assignment to sparse matrices************************************************
1498  // No special implementation for the multiplication assignment to sparse matrices.
1499  //**********************************************************************************************
1500 
1501  //**Compile time checks*************************************************************************
1508  //**********************************************************************************************
1509 };
1510 //*************************************************************************************************
1511 
1512 
1513 
1514 
1515 //=================================================================================================
1516 //
1517 // GLOBAL BINARY ARITHMETIC OPERATORS
1518 //
1519 //=================================================================================================
1520 
1521 //*************************************************************************************************
1548 template< typename T1 // Type of the left-hand side dense vector
1549  , typename T2 > // Type of the right-hand side dense vector
1550 inline const DVecTDVecMultExpr<T1,T2>
1552 {
1554 
1555  return DVecTDVecMultExpr<T1,T2>( ~lhs, ~rhs );
1556 }
1557 //*************************************************************************************************
1558 
1559 
1560 
1561 
1562 //=================================================================================================
1563 //
1564 // EXPRESSION TRAIT SPECIALIZATIONS
1565 //
1566 //=================================================================================================
1567 
1568 //*************************************************************************************************
1570 template< typename VT1, typename VT2, bool AF >
1571 struct SubmatrixExprTrait< DVecTDVecMultExpr<VT1,VT2>, AF >
1572 {
1573  public:
1574  //**********************************************************************************************
1575  typedef typename MultExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
1576  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
1577  //**********************************************************************************************
1578 };
1580 //*************************************************************************************************
1581 
1582 
1583 //*************************************************************************************************
1585 template< typename VT1, typename VT2 >
1586 struct RowExprTrait< DVecTDVecMultExpr<VT1,VT2> >
1587 {
1588  public:
1589  //**********************************************************************************************
1590  typedef typename MultExprTrait< typename VT1::ReturnType, VT2 >::Type Type;
1591  //**********************************************************************************************
1592 };
1594 //*************************************************************************************************
1595 
1596 
1597 //*************************************************************************************************
1599 template< typename VT1, typename VT2 >
1600 struct ColumnExprTrait< DVecTDVecMultExpr<VT1,VT2> >
1601 {
1602  public:
1603  //**********************************************************************************************
1604  typedef typename MultExprTrait< VT1, typename VT2::ReturnType >::Type Type;
1605  //**********************************************************************************************
1606 };
1608 //*************************************************************************************************
1609 
1610 } // namespace blaze
1611 
1612 #endif
Pointer difference type of the Blaze library.
RT1::ElementType ET1
Element type of the left-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:98
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
DVecTDVecMultExpr< VT1, VT2 > This
Type of this DVecTDVecMultExpr instance.
Definition: DVecTDVecMultExpr.h:191
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecTDVecMultExpr.h:228
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:4075
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecTDVecMultExpr.h:296
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:151
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a column dense or sparse vector type...
Definition: TransposeFlag.h:159
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:197
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecTDVecMultExpr.h:274
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DVecTDVecMultExpr.h:536
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecTDVecMultExpr.h:450
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:79
Header file for the ColumnExprTrait class template.
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: DVecTDVecMultExpr.h:192
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecTDVecMultExpr.h:589
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecTDVecMultExpr.h:414
ElementType * PointerType
Pointer return type.
Definition: DVecTDVecMultExpr.h:226
Header file for the sparse matrix SMP implementation.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2384
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:249
DVecTDVecMultExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the DVecTDVecMultExpr class.
Definition: DVecTDVecMultExpr.h:479
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecTDVecMultExpr.h:457
VT2::ConstIterator RightIteratorType
ConstIterator type of the right-hand side dense matrix expression.
Definition: DVecTDVecMultExpr.h:241
Expression object for outer products between two dense vectors.The DVecTDVecMultExpr class represents...
Definition: DVecTDVecMultExpr.h:90
Header file for the Computation base class.
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecTDVecMultExpr.h:403
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
const size_t SMP_DVECTDVECMULT_THRESHOLD
SMP dense vector/dense vector outer product threshold.This threshold represents the system-specific t...
Definition: Thresholds.h:641
SelectType< evaluateLeft, const RT1, CT1 >::Type LT
Type for the assignment of the left-hand side dense vector operand.
Definition: DVecTDVecMultExpr.h:211
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Constraint on the data type.
VT1::ConstIterator LeftIteratorType
ConstIterator type of the left-hand side dense matrix expression.
Definition: DVecTDVecMultExpr.h:238
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecTDVecMultExpr.h:370
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecTDVecMultExpr.h:601
Constraint on the data type.
Header file for the MultExprTrait class template.
void smpAddAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:121
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
ValueType value_type
Type of the underlying elements.
Definition: DVecTDVecMultExpr.h:232
VT1::CompositeType CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:102
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.
Header file for the multiplication trait.
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecTDVecMultExpr.h:426
VT2::ReturnType RN2
Return type of the right-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:101
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: StorageOrder.h:161
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecTDVecMultExpr.h:306
SelectType< useAssign, const ResultType, const DVecTDVecMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecTDVecMultExpr.h:202
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2388
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecTDVecMultExpr.h:348
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecTDVecMultExpr.h:567
Header file for the dense matrix SMP implementation.
Header file for the DenseMatrix base class.
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DVecTDVecMultExpr.h:193
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecTDVecMultExpr.h:196
size_t rows() const
Returns the current number of rows of the matrix.
Definition: DVecTDVecMultExpr.h:547
void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:179
ReferenceType reference
Reference return type.
Definition: DVecTDVecMultExpr.h:234
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
ConstIterator(LeftIteratorType left, RightIteratorType right)
Constructor for the ConstIterator class.
Definition: DVecTDVecMultExpr.h:250
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecTDVecMultExpr.h:359
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecTDVecMultExpr.h:611
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecTDVecMultExpr.h:199
Constraint on the data type.
SelectType< IsExpression< VT2 >::value, const VT2, const VT2 & >::Type RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:208
#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
DifferenceType difference_type
Difference between two iterators.
Definition: DVecTDVecMultExpr.h:235
Constraints on the storage order of matrix types.
Constraint on the data type.
SelectType< evaluateRight, const RT2, CT2 >::Type RT
Type for the assignment of the right-hand side dense vector operand.
Definition: DVecTDVecMultExpr.h:214
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecTDVecMultExpr.h:438
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2382
VT1::ReturnType RN1
Return type of the left-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:100
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Header file for the VecTVecMultExpr base class.
VT2::ResultType RT2
Result type of the right-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:97
Header file for the EnableIf class template.
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecTDVecMultExpr.h:285
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecTDVecMultExpr.h:224
IteratorCategory iterator_category
The iterator category.
Definition: DVecTDVecMultExpr.h:231
void smpAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:91
VT1::ResultType RT1
Result type of the left-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:96
LeftOperand lhs_
Left-hand side dense vector of the multiplication expression.
Definition: DVecTDVecMultExpr.h:628
Header file for the SubmatrixExprTrait class template.
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a row-major dense or sparse matrix t...
Definition: StorageOrder.h:81
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2383
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:748
Header file for run time assertion macros.
Base template for the MultTrait class.
Definition: MultTrait.h:141
void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:209
RightOperand rightOperand() const
Returns the right-hand side dense vector operand.
Definition: DVecTDVecMultExpr.h:577
IntrinsicType load(size_t i, size_t j) const
Access to the intrinsic elements of the matrix.
Definition: DVecTDVecMultExpr.h:507
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DVecTDVecMultExpr.h:524
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecTDVecMultExpr.h:458
void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:239
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecTDVecMultExpr.h:194
RT2::ElementType ET2
Element type of the right-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:99
RightOperand rhs_
Right-hand side dense vector of the multiplication expression.
Definition: DVecTDVecMultExpr.h:629
IntrinsicType load() const
Access to the intrinsic elements of the matrix.
Definition: DVecTDVecMultExpr.h:337
VT2::CompositeType CT2
Composite type of the right-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:103
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecTDVecMultExpr.h:621
ElementType & ReferenceType
Reference return type.
Definition: DVecTDVecMultExpr.h:227
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DVecTDVecMultExpr.h:492
Header file for the IsReference type trait.
Base class for all outer product expression templates.The VecTVecMultExpr class serves as a tag for a...
Definition: VecTVecMultExpr.h:66
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.In case either of the two given data types T1 or T2 is not a matrix type ...
Definition: StorageOrder.h:283
Header file for all intrinsic functionality.
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecTDVecMultExpr.h:262
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecTDVecMultExpr.h:195
#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
size_t columns() const
Returns the current number of columns of the matrix.
Definition: DVecTDVecMultExpr.h:557
ElementType ValueType
Type of the underlying elements.
Definition: DVecTDVecMultExpr.h:225
Header file for the IsComputation type trait class.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecTDVecMultExpr.h:327
Iterator over the elements of the dense matrix.
Definition: DVecTDVecMultExpr.h:220
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
#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:2379
PointerType pointer
Pointer return type.
Definition: DVecTDVecMultExpr.h:233
Header file for basic type definitions.
#define BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a row dense or sparse vector type (i...
Definition: TransposeFlag.h:81
Header file for the SubvectorExprTrait class template.
MultExprTrait< RN1, RN2 >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecTDVecMultExpr.h:126
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecTDVecMultExpr.h:392
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecTDVecMultExpr.h:317
Evaluation of the resulting expression type of a multiplication.Via this type trait it is possible to...
Definition: MultExprTrait.h:137
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecTDVecMultExpr.h:381
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
SelectType< IsExpression< VT1 >::value, const VT1, const VT1 & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:205
EnableIf< IsIntegral< T >, Set< T, sizeof(T)> >::Type::Type set(T value)
Sets all values in the vector to the given integral value.
Definition: Set.h:209
void store(float *address, const sse_float_t &value)
Aligned store of a vector of &#39;float&#39; values.
Definition: Store.h:242
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.