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>
63 #include <blaze/util/Assert.h>
65 #include <blaze/util/EnableIf.h>
67 #include <blaze/util/SelectType.h>
68 #include <blaze/util/Types.h>
70 
71 
72 namespace blaze {
73 
74 //=================================================================================================
75 //
76 // CLASS DVECTDVECMULTEXPR
77 //
78 //=================================================================================================
79 
80 //*************************************************************************************************
87 template< typename VT1 // Type of the left-hand side dense vector
88  , typename VT2 > // Type of the right-hand side dense vector
89 class DVecTDVecMultExpr : public DenseMatrix< DVecTDVecMultExpr<VT1,VT2>, false >
90  , private VecTVecMultExpr
91  , private Computation
92 {
93  private:
94  //**Type definitions****************************************************************************
95  typedef typename VT1::ResultType RT1;
96  typedef typename VT2::ResultType RT2;
97  typedef typename RT1::ElementType ET1;
98  typedef typename RT2::ElementType ET2;
99  typedef typename VT1::ReturnType RN1;
100  typedef typename VT2::ReturnType RN2;
101  typedef typename VT1::CompositeType CT1;
102  typedef typename VT2::CompositeType CT2;
103  //**********************************************************************************************
104 
105  //**********************************************************************************************
108  //**********************************************************************************************
109 
110  //**********************************************************************************************
112  enum { evaluateRight = IsComputation<VT2>::value || RequiresEvaluation<VT2>::value };
113  //**********************************************************************************************
114 
115  //**Return type evaluation**********************************************************************
117 
122  enum { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
123 
126  //**********************************************************************************************
127 
128  //**Serial evaluation strategy******************************************************************
130 
136  enum { useAssign = ( evaluateLeft || evaluateRight ) };
137 
139  template< typename VT >
141  struct UseAssign {
142  enum { value = useAssign };
143  };
145  //**********************************************************************************************
146 
147  //**Parallel evaluation strategy****************************************************************
149 
153  template< typename VT >
154  struct UseSMPAssign {
155  enum { value = evaluateRight };
156  };
158  //**********************************************************************************************
159 
160  //**********************************************************************************************
162 
165  template< typename T1, typename T2, typename T3 >
166  struct UseVectorizedKernel {
167  enum { value = T1::vectorizable && T2::vectorizable && T3::vectorizable &&
171  };
173  //**********************************************************************************************
174 
175  //**********************************************************************************************
177 
180  template< typename T1, typename T2, typename T3 >
181  struct UseDefaultKernel {
182  enum { value = !UseVectorizedKernel<T1,T2,T3>::value };
183  };
185  //**********************************************************************************************
186 
187  public:
188  //**Type definitions****************************************************************************
195 
198 
201 
203  typedef typename SelectType< IsExpression<VT1>::value, const VT1, const VT1& >::Type LeftOperand;
204 
206  typedef typename SelectType< IsExpression<VT2>::value, const VT2, const VT2& >::Type RightOperand;
207 
210 
213  //**********************************************************************************************
214 
215  //**ConstIterator class definition**************************************************************
219  {
220  public:
221  //**Type definitions*************************************************************************
222  typedef std::random_access_iterator_tag IteratorCategory;
223  typedef ElementType ValueType;
224  typedef ElementType* PointerType;
225  typedef ElementType& ReferenceType;
227 
228  // STL iterator requirements
234 
237 
240  //*******************************************************************************************
241 
242  //**Constructor******************************************************************************
248  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right )
249  : left_ ( left ) // Iterator to the current left-hand side element
250  , right_( right ) // Iterator to the current right-hand side element
251  {}
252  //*******************************************************************************************
253 
254  //**Addition assignment operator*************************************************************
260  inline ConstIterator& operator+=( size_t inc ) {
261  right_ += inc;
262  return *this;
263  }
264  //*******************************************************************************************
265 
266  //**Subtraction assignment operator**********************************************************
272  inline ConstIterator& operator-=( size_t dec ) {
273  right_ -= dec;
274  return *this;
275  }
276  //*******************************************************************************************
277 
278  //**Prefix increment operator****************************************************************
284  ++right_;
285  return *this;
286  }
287  //*******************************************************************************************
288 
289  //**Postfix increment operator***************************************************************
294  inline const ConstIterator operator++( int ) {
295  return ConstIterator( left_, right_++ );
296  }
297  //*******************************************************************************************
298 
299  //**Prefix decrement operator****************************************************************
305  --right_;
306  return *this;
307  }
308  //*******************************************************************************************
309 
310  //**Postfix decrement operator***************************************************************
315  inline const ConstIterator operator--( int ) {
316  return ConstIterator( left_, right_-- );
317  }
318  //*******************************************************************************************
319 
320  //**Element access operator******************************************************************
325  inline ReturnType operator*() const {
326  return (*left_) * (*right_);
327  }
328  //*******************************************************************************************
329 
330  //**Load function****************************************************************************
335  inline IntrinsicType load() const {
336  return set( *left_ ) * right_.load();
337  }
338  //*******************************************************************************************
339 
340  //**Equality operator************************************************************************
346  inline bool operator==( const ConstIterator& rhs ) const {
347  return right_ == rhs.right_;
348  }
349  //*******************************************************************************************
350 
351  //**Inequality operator**********************************************************************
357  inline bool operator!=( const ConstIterator& rhs ) const {
358  return right_ != rhs.right_;
359  }
360  //*******************************************************************************************
361 
362  //**Less-than operator***********************************************************************
368  inline bool operator<( const ConstIterator& rhs ) const {
369  return right_ < rhs.right_;
370  }
371  //*******************************************************************************************
372 
373  //**Greater-than operator********************************************************************
379  inline bool operator>( const ConstIterator& rhs ) const {
380  return right_ > rhs.right_;
381  }
382  //*******************************************************************************************
383 
384  //**Less-or-equal-than operator**************************************************************
390  inline bool operator<=( const ConstIterator& rhs ) const {
391  return right_ <= rhs.right_;
392  }
393  //*******************************************************************************************
394 
395  //**Greater-or-equal-than operator***********************************************************
401  inline bool operator>=( const ConstIterator& rhs ) const {
402  return right_ >= rhs.right_;
403  }
404  //*******************************************************************************************
405 
406  //**Subtraction operator*********************************************************************
412  inline DifferenceType operator-( const ConstIterator& rhs ) const {
413  return right_ - rhs.right_;
414  }
415  //*******************************************************************************************
416 
417  //**Addition operator************************************************************************
424  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
425  return ConstIterator( it.left_, it.right_ + inc );
426  }
427  //*******************************************************************************************
428 
429  //**Addition operator************************************************************************
436  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
437  return ConstIterator( it.left_, it.right_ + inc );
438  }
439  //*******************************************************************************************
440 
441  //**Subtraction operator*********************************************************************
448  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
449  return ConstIterator( it.left_, it.right_ - dec );
450  }
451  //*******************************************************************************************
452 
453  private:
454  //**Member variables*************************************************************************
457  //*******************************************************************************************
458  };
459  //**********************************************************************************************
460 
461  //**Compilation flags***************************************************************************
463  enum { vectorizable = VT1::vectorizable && VT2::vectorizable &&
466 
468  enum { smpAssignable = VT1::smpAssignable && !evaluateRight };
469  //**********************************************************************************************
470 
471  //**Constructor*********************************************************************************
477  explicit inline DVecTDVecMultExpr( const VT1& lhs, const VT2& rhs )
478  : lhs_( lhs ) // Left-hand side dense vector of the multiplication expression
479  , rhs_( rhs ) // Right-hand side dense vector of the multiplication expression
480  {}
481  //**********************************************************************************************
482 
483  //**Access operator*****************************************************************************
490  inline ReturnType operator()( size_t i, size_t j ) const {
491  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
492  BLAZE_INTERNAL_ASSERT( j < rhs_.size(), "Invalid column access index" );
493 
494  return lhs_[i] * rhs_[j];
495  }
496  //**********************************************************************************************
497 
498  //**Load function*******************************************************************************
505  inline IntrinsicType load( size_t i, size_t j ) const {
506  typedef IntrinsicTrait<ElementType> IT;
507  BLAZE_INTERNAL_ASSERT( i < lhs_.size() , "Invalid row access index" );
508  BLAZE_INTERNAL_ASSERT( j < rhs_.size() , "Invalid column access index" );
509  BLAZE_INTERNAL_ASSERT( j % IT::size == 0UL, "Invalid column access index" );
510  const IntrinsicType xmm1( set( lhs_[i] ) );
511  const IntrinsicType xmm2( rhs_.load( j ) );
512  return xmm1 * xmm2;
513  }
514  //**********************************************************************************************
515 
516  //**Begin function******************************************************************************
522  inline ConstIterator begin( size_t i ) const {
523  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
524  return ConstIterator( lhs_.begin()+i, rhs_.begin() );
525  }
526  //**********************************************************************************************
527 
528  //**End function********************************************************************************
534  inline ConstIterator end( size_t i ) const {
535  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
536  return ConstIterator( lhs_.begin()+i, rhs_.end() );
537  }
538  //**********************************************************************************************
539 
540  //**Rows function*******************************************************************************
545  inline size_t rows() const {
546  return lhs_.size();
547  }
548  //**********************************************************************************************
549 
550  //**Columns function****************************************************************************
555  inline size_t columns() const {
556  return rhs_.size();
557  }
558  //**********************************************************************************************
559 
560  //**Left operand access*************************************************************************
565  inline LeftOperand leftOperand() const {
566  return lhs_;
567  }
568  //**********************************************************************************************
569 
570  //**Right operand access************************************************************************
575  inline RightOperand rightOperand() const {
576  return rhs_;
577  }
578  //**********************************************************************************************
579 
580  //**********************************************************************************************
586  template< typename T >
587  inline bool canAlias( const T* alias ) const {
588  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
589  }
590  //**********************************************************************************************
591 
592  //**********************************************************************************************
598  template< typename T >
599  inline bool isAliased( const T* alias ) const {
600  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
601  }
602  //**********************************************************************************************
603 
604  //**********************************************************************************************
609  inline bool isAligned() const {
610  return lhs_.isAligned() && rhs_.isAligned();
611  }
612  //**********************************************************************************************
613 
614  //**********************************************************************************************
619  inline bool canSMPAssign() const {
620  return ( rows() > SMP_DVECTDVECMULT_THRESHOLD );
621  }
622  //**********************************************************************************************
623 
624  private:
625  //**Member variables****************************************************************************
626  LeftOperand lhs_;
627  RightOperand rhs_;
628  //**********************************************************************************************
629 
630  //**Assignment to row-major dense matrices******************************************************
644  template< typename MT > // Type of the target dense matrix
645  friend inline typename EnableIf< UseAssign<MT> >::Type
647  {
649 
650  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
651  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
652 
653  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
654  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
655 
656  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
657  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
658  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
659  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
660 
661  DVecTDVecMultExpr::selectAssignKernel( ~lhs, x, y );
662  }
664  //**********************************************************************************************
665 
666  //**Default assignment to row-major dense matrices**********************************************
680  template< typename MT // Type of the left-hand side target matrix
681  , typename VT3 // Type of the left-hand side vector operand
682  , typename VT4 > // Type of the right-hand side vector operand
683  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
684  selectAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
685  {
686  const size_t m( (~A).rows() );
687  const size_t n( (~A).columns() );
688 
689  const size_t jend( n & size_t(-2) );
690  BLAZE_INTERNAL_ASSERT( ( n - ( n % 2UL ) ) == jend, "Invalid end calculation" );
691 
692  for( size_t i=0UL; i<m; ++i ) {
693  for( size_t j=0UL; j<jend; j+=2UL ) {
694  (~A)(i,j ) = x[i] * y[j ];
695  (~A)(i,j+1UL) = x[i] * y[j+1];
696  }
697  if( jend < n ) {
698  (~A)(i,jend) = x[i] * y[jend];
699  }
700  }
701  }
703  //**********************************************************************************************
704 
705  //**Vectorized assignment to row-major dense matrices*******************************************
719  template< typename MT // Type of the left-hand side target matrix
720  , typename VT3 // Type of the left-hand side vector operand
721  , typename VT4 > // Type of the right-hand side vector operand
722  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
723  selectAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
724  {
725  typedef IntrinsicTrait<ElementType> IT;
726 
727  const size_t m( (~A).rows() );
728  const size_t n( (~A).columns() );
729 
730  for( size_t i=0UL; i<m; ++i )
731  {
732  const IntrinsicType x1( set( x[i] ) );
733 
734  for( size_t j=0UL; j<n; j+=IT::size ) {
735  (~A).store( i, j, x1 * y.load(j) );
736  }
737  }
738  }
740  //**********************************************************************************************
741 
742  //**Assignment to column-major dense matrices***************************************************
754  template< typename MT > // Type of the target dense matrix
755  friend inline void assign( DenseMatrix<MT,true>& lhs, const DVecTDVecMultExpr& rhs )
756  {
758 
759  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
760  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
761 
762  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
763  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
764 
765  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
766  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
767  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
768  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
769 
770  DVecTDVecMultExpr::selectAssignKernel( ~lhs, x, y );
771  }
773  //**********************************************************************************************
774 
775  //**Default assignment to column-major dense matrices*******************************************
789  template< typename MT // Type of the left-hand side target matrix
790  , typename VT3 // Type of the left-hand side vector operand
791  , typename VT4 > // Type of the right-hand side vector operand
792  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
793  selectAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
794  {
795  const size_t m( (~A).rows() );
796  const size_t n( (~A).columns() );
797 
798  const size_t iend( m & size_t(-2) );
799  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == iend, "Invalid end calculation" );
800 
801  for( size_t j=0UL; j<n; ++j ) {
802  for( size_t i=0UL; i<iend; i+=2UL ) {
803  (~A)(i ,j) = x[i ] * y[j];
804  (~A)(i+1UL,j) = x[i+1] * y[j];
805  }
806  if( iend < m ) {
807  (~A)(iend,j) = x[iend] * y[j];
808  }
809  }
810  }
812  //**********************************************************************************************
813 
814  //**Vectorized assignment to column-major dense matrices****************************************
828  template< typename MT // Type of the left-hand side target matrix
829  , typename VT3 // Type of the left-hand side vector operand
830  , typename VT4 > // Type of the right-hand side vector operand
831  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
832  selectAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
833  {
834  typedef IntrinsicTrait<ElementType> IT;
835 
836  const size_t m( (~A).rows() );
837  const size_t n( (~A).columns() );
838 
839  for( size_t j=0UL; j<n; ++j )
840  {
841  const IntrinsicType y1( set( y[j] ) );
842 
843  for( size_t i=0UL; i<m; i+=IT::size ) {
844  (~A).store( i, j, x.load(i) * y1 );
845  }
846  }
847  }
849  //**********************************************************************************************
850 
851  //**Assignment to sparse matrices***************************************************************
863  template< typename MT // Type of the target sparse matrix
864  , bool SO > // Storage order of the target sparse matrix
865  friend inline void assign( SparseMatrix<MT,SO>& lhs, const DVecTDVecMultExpr& rhs )
866  {
868 
869  typedef typename SelectType< SO, OppositeType, ResultType >::Type TmpType;
870 
877 
878  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
879  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
880 
881  const TmpType tmp( serial( rhs ) );
882  assign( ~lhs, tmp );
883  }
885  //**********************************************************************************************
886 
887  //**Addition assignment to row-major dense matrices*********************************************
902  template< typename MT > // Type of the target dense matrix
903  friend inline typename EnableIf< UseAssign<MT> >::Type
904  addAssign( DenseMatrix<MT,false>& lhs, const DVecTDVecMultExpr& rhs )
905  {
907 
908  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
909  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
910 
911  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
912  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
913 
914  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
915  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
916  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
917  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
918 
919  DVecTDVecMultExpr::selectAddAssignKernel( ~lhs, x, y );
920  }
922  //**********************************************************************************************
923 
924  //**Default addition assignment to row-major dense matrices*************************************
938  template< typename MT // Type of the left-hand side target matrix
939  , typename VT3 // Type of the left-hand side vector operand
940  , typename VT4 > // Type of the right-hand side vector operand
941  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
942  selectAddAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
943  {
944  const size_t m( (~A).rows() );
945  const size_t n( (~A).columns() );
946 
947  const size_t jend( n & size_t(-2) );
948  BLAZE_INTERNAL_ASSERT( ( n - ( n % 2UL ) ) == jend, "Invalid end calculation" );
949 
950  for( size_t i=0UL; i<m; ++i ) {
951  for( size_t j=0UL; j<jend; j+=2UL ) {
952  (~A)(i,j ) += x[i] * y[j ];
953  (~A)(i,j+1UL) += x[i] * y[j+1UL];
954  }
955  if( jend < n ) {
956  (~A)(i,jend) += x[i] * y[jend];
957  }
958  }
959  }
961  //**********************************************************************************************
962 
963  //**Vectorized addition assignment to row-major dense matrices**********************************
977  template< typename MT // Type of the left-hand side target matrix
978  , typename VT3 // Type of the left-hand side vector operand
979  , typename VT4 > // Type of the right-hand side vector operand
980  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
981  selectAddAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
982  {
983  typedef IntrinsicTrait<ElementType> IT;
984 
985  const size_t m( (~A).rows() );
986  const size_t n( (~A).columns() );
987 
988  for( size_t i=0UL; i<m; ++i )
989  {
990  const IntrinsicType x1( set( x[i] ) );
991 
992  for( size_t j=0UL; j<n; j+=IT::size ) {
993  (~A).store( i, j, (~A).load(i,j) + x1 * y.load(j) );
994  }
995  }
996  }
998  //**********************************************************************************************
999 
1000  //**Addition assignment to column-major dense matrices******************************************
1013  template< typename MT > // Type of the target dense matrix
1014  friend inline void addAssign( DenseMatrix<MT,true>& lhs, const DVecTDVecMultExpr& rhs )
1015  {
1017 
1018  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1019  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1020 
1021  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1022  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
1023 
1024  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1025  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1026  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1027  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1028 
1029  DVecTDVecMultExpr::selectAddAssignKernel( ~lhs, x, y );
1030  }
1032  //**********************************************************************************************
1033 
1034  //**Default addition assignment to column dense matrices****************************************
1048  template< typename MT // Type of the left-hand side target matrix
1049  , typename VT3 // Type of the left-hand side vector operand
1050  , typename VT4 > // Type of the right-hand side vector operand
1051  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
1052  selectAddAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1053  {
1054  const size_t m( (~A).rows() );
1055  const size_t n( (~A).columns() );
1056 
1057  const size_t iend( m & size_t(-2) );
1058  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == iend, "Invalid end calculation" );
1059 
1060  for( size_t j=0UL; j<n; ++j ) {
1061  for( size_t i=0UL; i<iend; i+=2UL ) {
1062  (~A)(i ,j) += x[i ] * y[j];
1063  (~A)(i+1UL,j) += x[i+1UL] * y[j];
1064  }
1065  if( iend < m ) {
1066  (~A)(iend,j) += x[iend] * y[j];
1067  }
1068  }
1069  }
1071  //**********************************************************************************************
1072 
1073  //**Vectorized addition assignment to column-major dense matrices*******************************
1087  template< typename MT // Type of the left-hand side target matrix
1088  , typename VT3 // Type of the left-hand side vector operand
1089  , typename VT4 > // Type of the right-hand side vector operand
1090  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
1091  selectAddAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1092  {
1093  typedef IntrinsicTrait<ElementType> IT;
1094 
1095  const size_t m( (~A).rows() );
1096  const size_t n( (~A).columns() );
1097 
1098  for( size_t j=0UL; j<n; ++j )
1099  {
1100  const IntrinsicType y1( set( y[j] ) );
1101 
1102  for( size_t i=0UL; i<m; i+=IT::size ) {
1103  (~A).store( i, j, (~A).load(i,j) + x.load(i) * y1 );
1104  }
1105  }
1106  }
1108  //**********************************************************************************************
1109 
1110  //**Addition assignment to sparse matrices******************************************************
1111  // No special implementation for the addition assignment to sparse matrices.
1112  //**********************************************************************************************
1113 
1114  //**Subtraction assignment to row-major dense matrices******************************************
1129  template< typename MT > // Type of the target dense matrix
1130  friend inline typename EnableIf< UseAssign<MT> >::Type
1131  subAssign( DenseMatrix<MT,false>& lhs, const DVecTDVecMultExpr& rhs )
1132  {
1134 
1135  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1136  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1137 
1138  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1139  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
1140 
1141  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1142  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1143  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1144  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1145 
1146  DVecTDVecMultExpr::selectSubAssignKernel( ~lhs, x, y );
1147  }
1149  //**********************************************************************************************
1150 
1151  //**Default subtraction assignment to row-major dense matrices**********************************
1165  template< typename MT // Type of the left-hand side target matrix
1166  , typename VT3 // Type of the left-hand side vector operand
1167  , typename VT4 > // Type of the right-hand side vector operand
1168  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
1169  selectSubAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
1170  {
1171  const size_t m( (~A).rows() );
1172  const size_t n( (~A).columns() );
1173 
1174  const size_t jend( n & size_t(-2) );
1175  BLAZE_INTERNAL_ASSERT( ( n - ( n % 2UL ) ) == jend, "Invalid end calculation" );
1176 
1177  for( size_t i=0UL; i<m; ++i ) {
1178  for( size_t j=0UL; j<jend; j+=2UL ) {
1179  (~A)(i,j ) -= x[i] * y[j ];
1180  (~A)(i,j+1UL) -= x[i] * y[j+1UL];
1181  }
1182  if( jend < n ) {
1183  (~A)(i,jend) -= x[i] * y[jend];
1184  }
1185  }
1186  }
1188  //**********************************************************************************************
1189 
1190  //**Vectorized subtraction assignment to row-major dense matrices*******************************
1204  template< typename MT // Type of the left-hand side target matrix
1205  , typename VT3 // Type of the left-hand side vector operand
1206  , typename VT4 > // Type of the right-hand side vector operand
1207  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
1208  selectSubAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
1209  {
1210  typedef IntrinsicTrait<ElementType> IT;
1211 
1212  const size_t m( (~A).rows() );
1213  const size_t n( (~A).columns() );
1214 
1215  for( size_t i=0UL; i<m; ++i )
1216  {
1217  const IntrinsicType x1( set( x[i] ) );
1218 
1219  for( size_t j=0UL; j<n; j+=IT::size ) {
1220  (~A).store( i, j, (~A).load(i,j) - x1 * y.load(j) );
1221  }
1222  }
1223  }
1225  //**********************************************************************************************
1226 
1227  //**Subtraction assignment to column-major dense matrices***************************************
1240  template< typename MT > // Type of the target dense matrix
1241  friend inline void subAssign( DenseMatrix<MT,true>& lhs, const DVecTDVecMultExpr& rhs )
1242  {
1244 
1245  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1246  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1247 
1248  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1249  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
1250 
1251  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1252  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1253  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1254  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1255 
1256  DVecTDVecMultExpr::selectSubAssignKernel( ~lhs, x, y );
1257  }
1259  //**********************************************************************************************
1260 
1261  //**Default subtraction assignment to column dense matrices*************************************
1275  template< typename MT // Type of the left-hand side target matrix
1276  , typename VT3 // Type of the left-hand side vector operand
1277  , typename VT4 > // Type of the right-hand side vector operand
1278  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
1279  selectSubAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1280  {
1281  const size_t m( (~A).rows() );
1282  const size_t n( (~A).columns() );
1283 
1284  const size_t iend( m & size_t(-2) );
1285  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == iend, "Invalid end calculation" );
1286 
1287  for( size_t j=0UL; j<n; ++j ) {
1288  for( size_t i=0UL; i<iend; i+=2UL ) {
1289  (~A)(i ,j) -= x[i ] * y[j];
1290  (~A)(i+1UL,j) -= x[i+1UL] * y[j];
1291  }
1292  if( iend < m ) {
1293  (~A)(iend,j) -= x[iend] * y[j];
1294  }
1295  }
1296  }
1298  //**********************************************************************************************
1299 
1300  //**Vectorized subtraction assignment to column-major dense matrices****************************
1314  template< typename MT // Type of the left-hand side target matrix
1315  , typename VT3 // Type of the left-hand side vector operand
1316  , typename VT4 > // Type of the right-hand side vector operand
1317  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
1318  selectSubAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1319  {
1320  typedef IntrinsicTrait<ElementType> IT;
1321 
1322  const size_t m( (~A).rows() );
1323  const size_t n( (~A).columns() );
1324 
1325  for( size_t j=0UL; j<n; ++j )
1326  {
1327  const IntrinsicType y1( set( y[j] ) );
1328 
1329  for( size_t i=0UL; i<m; i+=IT::size ) {
1330  (~A).store( i, j, (~A).load(i,j) - x.load(i) * y1 );
1331  }
1332  }
1333  }
1335  //**********************************************************************************************
1336 
1337  //**Subtraction assignment to sparse matrices***************************************************
1338  // No special implementation for the subtraction assignment to sparse matrices.
1339  //**********************************************************************************************
1340 
1341  //**Multiplication assignment to dense matrices*************************************************
1342  // No special implementation for the multiplication assignment to dense matrices.
1343  //**********************************************************************************************
1344 
1345  //**Multiplication assignment to sparse matrices************************************************
1346  // No special implementation for the multiplication assignment to sparse matrices.
1347  //**********************************************************************************************
1348 
1349  //**SMP assignment to dense matrices************************************************************
1363  template< typename MT // Type of the target dense matrix
1364  , bool SO > // Storage order of the target dense matrix
1365  friend inline typename EnableIf< UseSMPAssign<MT> >::Type
1366  smpAssign( DenseMatrix<MT,SO>& lhs, const DVecTDVecMultExpr& rhs )
1367  {
1369 
1370  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1371  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1372 
1373  LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
1374  RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
1375 
1376  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1377  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1378  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1379  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1380 
1381  smpAssign( ~lhs, x * y );
1382  }
1384  //**********************************************************************************************
1385 
1386  //**SMP assignment to sparse matrices***********************************************************
1400  template< typename MT // Type of the target sparse matrix
1401  , bool SO > // Storage order of the target sparse matrix
1402  friend inline typename EnableIf< UseSMPAssign<MT> >::Type
1403  smpAssign( SparseMatrix<MT,SO>& lhs, const DVecTDVecMultExpr& rhs )
1404  {
1406 
1407  typedef typename SelectType< SO, OppositeType, ResultType >::Type TmpType;
1408 
1415 
1416  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1417  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1418 
1419  const TmpType tmp( rhs );
1420  smpAssign( ~lhs, tmp );
1421  }
1423  //**********************************************************************************************
1424 
1425  //**SMP addition assignment to dense matrices***************************************************
1439  template< typename MT > // Type of the target dense matrix
1440  friend inline typename EnableIf< UseSMPAssign<MT> >::Type
1441  smpAddAssign( DenseMatrix<MT,false>& lhs, const DVecTDVecMultExpr& rhs )
1442  {
1444 
1445  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1446  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1447 
1448  LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
1449  RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
1450 
1451  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1452  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1453  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1454  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1455 
1456  smpAddAssign( ~lhs, x * y );
1457  }
1459  //**********************************************************************************************
1460 
1461  //**SMP addition assignment to sparse matrices**************************************************
1462  // No special implementation for the SMP addition assignment to sparse matrices.
1463  //**********************************************************************************************
1464 
1465  //**SMP subtraction assignment to dense matrices************************************************
1480  template< typename MT > // Type of the target dense matrix
1481  friend inline typename EnableIf< UseSMPAssign<MT> >::Type
1482  smpSubAssign( DenseMatrix<MT,false>& lhs, const DVecTDVecMultExpr& rhs )
1483  {
1485 
1486  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1487  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1488 
1489  LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
1490  RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
1491 
1492  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1493  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1494  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1495  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1496 
1497  smpSubAssign( ~lhs, x * y );
1498  }
1500  //**********************************************************************************************
1501 
1502  //**SMP subtraction assignment to sparse matrices***********************************************
1503  // No special implementation for the SMP subtraction assignment to sparse matrices.
1504  //**********************************************************************************************
1505 
1506  //**SMP multiplication assignment to dense matrices*********************************************
1507  // No special implementation for the SMP multiplication assignment to dense matrices.
1508  //**********************************************************************************************
1509 
1510  //**SMP multiplication assignment to sparse matrices********************************************
1511  // No special implementation for the SMP multiplication assignment to sparse matrices.
1512  //**********************************************************************************************
1513 
1514  //**Compile time checks*************************************************************************
1521  //**********************************************************************************************
1522 };
1523 //*************************************************************************************************
1524 
1525 
1526 
1527 
1528 //=================================================================================================
1529 //
1530 // GLOBAL BINARY ARITHMETIC OPERATORS
1531 //
1532 //=================================================================================================
1533 
1534 //*************************************************************************************************
1561 template< typename T1 // Type of the left-hand side dense vector
1562  , typename T2 > // Type of the right-hand side dense vector
1563 inline const DVecTDVecMultExpr<T1,T2>
1565 {
1567 
1568  return DVecTDVecMultExpr<T1,T2>( ~lhs, ~rhs );
1569 }
1570 //*************************************************************************************************
1571 
1572 
1573 
1574 
1575 //=================================================================================================
1576 //
1577 // EXPRESSION TRAIT SPECIALIZATIONS
1578 //
1579 //=================================================================================================
1580 
1581 //*************************************************************************************************
1583 template< typename VT1, typename VT2, bool AF >
1584 struct SubmatrixExprTrait< DVecTDVecMultExpr<VT1,VT2>, AF >
1585 {
1586  public:
1587  //**********************************************************************************************
1588  typedef typename MultExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
1589  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
1590  //**********************************************************************************************
1591 };
1593 //*************************************************************************************************
1594 
1595 
1596 //*************************************************************************************************
1598 template< typename VT1, typename VT2 >
1599 struct RowExprTrait< DVecTDVecMultExpr<VT1,VT2> >
1600 {
1601  public:
1602  //**********************************************************************************************
1603  typedef typename MultExprTrait< typename VT1::ReturnType, VT2 >::Type Type;
1604  //**********************************************************************************************
1605 };
1607 //*************************************************************************************************
1608 
1609 
1610 //*************************************************************************************************
1612 template< typename VT1, typename VT2 >
1613 struct ColumnExprTrait< DVecTDVecMultExpr<VT1,VT2> >
1614 {
1615  public:
1616  //**********************************************************************************************
1617  typedef typename MultExprTrait< VT1, typename VT2::ReturnType >::Type Type;
1618  //**********************************************************************************************
1619 };
1621 //*************************************************************************************************
1622 
1623 } // namespace blaze
1624 
1625 #endif
Pointer difference type of the Blaze library.
RT1::ElementType ET1
Element type of the left-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:97
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
EnableIf< IsIntegral< T > >::Type store(T *address, const typename Store< T, sizeof(T)>::Type &value)
Aligned store of a vector of integral values.
Definition: Store.h:223
DVecTDVecMultExpr< VT1, VT2 > This
Type of this DVecTDVecMultExpr instance.
Definition: DVecTDVecMultExpr.h:189
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecTDVecMultExpr.h:226
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:4329
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecTDVecMultExpr.h:294
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:152
#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:199
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecTDVecMultExpr.h:272
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DVecTDVecMultExpr.h:534
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecTDVecMultExpr.h:448
#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:190
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecTDVecMultExpr.h:587
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecTDVecMultExpr.h:412
ElementType * PointerType
Pointer return type.
Definition: DVecTDVecMultExpr.h:224
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2408
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:251
DVecTDVecMultExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the DVecTDVecMultExpr class.
Definition: DVecTDVecMultExpr.h:477
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecTDVecMultExpr.h:455
VT2::ConstIterator RightIteratorType
ConstIterator type of the right-hand side dense matrix expression.
Definition: DVecTDVecMultExpr.h:239
Expression object for outer products between two dense vectors.The DVecTDVecMultExpr class represents...
Definition: DVecTDVecMultExpr.h:89
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:690
Header file for the Computation base class.
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecTDVecMultExpr.h:401
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
SelectType< evaluateLeft, const RT1, CT1 >::Type LT
Type for the assignment of the left-hand side dense vector operand.
Definition: DVecTDVecMultExpr.h:209
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:236
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecTDVecMultExpr.h:368
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecTDVecMultExpr.h:599
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:122
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:230
VT1::CompositeType CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:101
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:424
VT2::ReturnType RN2
Return type of the right-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:100
#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:304
SelectType< useAssign, const ResultType, const DVecTDVecMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecTDVecMultExpr.h:200
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2412
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecTDVecMultExpr.h:346
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecTDVecMultExpr.h:565
Header file for the DenseMatrix base class.
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DVecTDVecMultExpr.h:191
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecTDVecMultExpr.h:194
size_t rows() const
Returns the current number of rows of the matrix.
Definition: DVecTDVecMultExpr.h:545
void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:271
ReferenceType reference
Reference return type.
Definition: DVecTDVecMultExpr.h:232
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:248
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecTDVecMultExpr.h:357
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecTDVecMultExpr.h:609
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecTDVecMultExpr.h:197
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:206
#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:233
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:212
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecTDVecMultExpr.h:436
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2406
VT1::ReturnType RN1
Return type of the left-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:99
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:96
Header file for the EnableIf class template.
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecTDVecMultExpr.h:283
Header file for the serial shim.
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecTDVecMultExpr.h:222
IteratorCategory iterator_category
The iterator category.
Definition: DVecTDVecMultExpr.h:229
void smpAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:92
VT1::ResultType RT1
Result type of the left-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:95
LeftOperand lhs_
Left-hand side dense vector of the multiplication expression.
Definition: DVecTDVecMultExpr.h:626
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:2407
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:301
RightOperand rightOperand() const
Returns the right-hand side dense vector operand.
Definition: DVecTDVecMultExpr.h:575
IntrinsicType load(size_t i, size_t j) const
Access to the intrinsic elements of the matrix.
Definition: DVecTDVecMultExpr.h:505
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:522
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecTDVecMultExpr.h:456
void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:331
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecTDVecMultExpr.h:192
RT2::ElementType ET2
Element type of the right-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:98
RightOperand rhs_
Right-hand side dense vector of the multiplication expression.
Definition: DVecTDVecMultExpr.h:627
IntrinsicType load() const
Access to the intrinsic elements of the matrix.
Definition: DVecTDVecMultExpr.h:335
VT2::CompositeType CT2
Composite type of the right-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:102
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecTDVecMultExpr.h:619
const size_t SMP_DVECTDVECMULT_THRESHOLD
SMP dense vector/dense vector outer product threshold.This threshold specifies when a dense vector/de...
Definition: Thresholds.h:1202
ElementType & ReferenceType
Reference return type.
Definition: DVecTDVecMultExpr.h:225
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DVecTDVecMultExpr.h:490
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:260
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecTDVecMultExpr.h:193
#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:555
ElementType ValueType
Type of the underlying elements.
Definition: DVecTDVecMultExpr.h:223
Header file for the IsComputation type trait class.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecTDVecMultExpr.h:325
Iterator over the elements of the dense matrix.
Definition: DVecTDVecMultExpr.h:218
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:2403
PointerType pointer
Pointer return type.
Definition: DVecTDVecMultExpr.h:231
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:125
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecTDVecMultExpr.h:390
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecTDVecMultExpr.h:315
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:379
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:203
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
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.