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 
53 #include <blaze/math/Intrinsics.h>
68 #include <blaze/util/Assert.h>
70 #include <blaze/util/EnableIf.h>
72 #include <blaze/util/SelectType.h>
73 #include <blaze/util/Types.h>
75 
76 
77 namespace blaze {
78 
79 //=================================================================================================
80 //
81 // CLASS DVECTDVECMULTEXPR
82 //
83 //=================================================================================================
84 
85 //*************************************************************************************************
92 template< typename VT1 // Type of the left-hand side dense vector
93  , typename VT2 > // Type of the right-hand side dense vector
94 class DVecTDVecMultExpr : public DenseMatrix< DVecTDVecMultExpr<VT1,VT2>, false >
95  , private VecTVecMultExpr
96  , private Computation
97 {
98  private:
99  //**Type definitions****************************************************************************
100  typedef typename VT1::ResultType RT1;
101  typedef typename VT2::ResultType RT2;
102  typedef typename RT1::ElementType ET1;
103  typedef typename RT2::ElementType ET2;
104  typedef typename VT1::ReturnType RN1;
105  typedef typename VT2::ReturnType RN2;
106  typedef typename VT1::CompositeType CT1;
107  typedef typename VT2::CompositeType CT2;
108  //**********************************************************************************************
109 
110  //**********************************************************************************************
113  //**********************************************************************************************
114 
115  //**********************************************************************************************
117  enum { evaluateRight = IsComputation<VT2>::value || RequiresEvaluation<VT2>::value };
118  //**********************************************************************************************
119 
120  //**Return type evaluation**********************************************************************
122 
127  enum { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
128 
131  //**********************************************************************************************
132 
133  //**Serial evaluation strategy******************************************************************
135 
141  enum { useAssign = ( evaluateLeft || evaluateRight ) };
142 
144  template< typename VT >
146  struct UseAssign {
147  enum { value = useAssign };
148  };
150  //**********************************************************************************************
151 
152  //**Parallel evaluation strategy****************************************************************
154 
158  template< typename VT >
159  struct UseSMPAssign {
160  enum { value = evaluateRight };
161  };
163  //**********************************************************************************************
164 
165  //**********************************************************************************************
167 
170  template< typename T1, typename T2, typename T3 >
171  struct UseVectorizedKernel {
172  enum { value = T1::vectorizable && T2::vectorizable && T3::vectorizable &&
176  };
178  //**********************************************************************************************
179 
180  //**********************************************************************************************
182 
185  template< typename T1, typename T2, typename T3 >
186  struct UseDefaultKernel {
187  enum { value = !UseVectorizedKernel<T1,T2,T3>::value };
188  };
190  //**********************************************************************************************
191 
192  public:
193  //**Type definitions****************************************************************************
200 
203 
206 
208  typedef typename SelectType< IsExpression<VT1>::value, const VT1, const VT1& >::Type LeftOperand;
209 
211  typedef typename SelectType< IsExpression<VT2>::value, const VT2, const VT2& >::Type RightOperand;
212 
215 
218  //**********************************************************************************************
219 
220  //**ConstIterator class definition**************************************************************
224  {
225  public:
226  //**Type definitions*************************************************************************
227  typedef std::random_access_iterator_tag IteratorCategory;
228  typedef ElementType ValueType;
229  typedef ElementType* PointerType;
230  typedef ElementType& ReferenceType;
232 
233  // STL iterator requirements
239 
242 
245  //*******************************************************************************************
246 
247  //**Constructor******************************************************************************
253  explicit inline ConstIterator( LeftIteratorType left, RightIteratorType right )
254  : left_ ( left ) // Iterator to the current left-hand side element
255  , right_( right ) // Iterator to the current right-hand side element
256  {}
257  //*******************************************************************************************
258 
259  //**Addition assignment operator*************************************************************
265  inline ConstIterator& operator+=( size_t inc ) {
266  right_ += inc;
267  return *this;
268  }
269  //*******************************************************************************************
270 
271  //**Subtraction assignment operator**********************************************************
277  inline ConstIterator& operator-=( size_t dec ) {
278  right_ -= dec;
279  return *this;
280  }
281  //*******************************************************************************************
282 
283  //**Prefix increment operator****************************************************************
289  ++right_;
290  return *this;
291  }
292  //*******************************************************************************************
293 
294  //**Postfix increment operator***************************************************************
299  inline const ConstIterator operator++( int ) {
300  return ConstIterator( left_, right_++ );
301  }
302  //*******************************************************************************************
303 
304  //**Prefix decrement operator****************************************************************
310  --right_;
311  return *this;
312  }
313  //*******************************************************************************************
314 
315  //**Postfix decrement operator***************************************************************
320  inline const ConstIterator operator--( int ) {
321  return ConstIterator( left_, right_-- );
322  }
323  //*******************************************************************************************
324 
325  //**Element access operator******************************************************************
330  inline ReturnType operator*() const {
331  return (*left_) * (*right_);
332  }
333  //*******************************************************************************************
334 
335  //**Load function****************************************************************************
340  inline IntrinsicType load() const {
341  return set( *left_ ) * right_.load();
342  }
343  //*******************************************************************************************
344 
345  //**Equality operator************************************************************************
351  inline bool operator==( const ConstIterator& rhs ) const {
352  return right_ == rhs.right_;
353  }
354  //*******************************************************************************************
355 
356  //**Inequality operator**********************************************************************
362  inline bool operator!=( const ConstIterator& rhs ) const {
363  return right_ != rhs.right_;
364  }
365  //*******************************************************************************************
366 
367  //**Less-than operator***********************************************************************
373  inline bool operator<( const ConstIterator& rhs ) const {
374  return right_ < rhs.right_;
375  }
376  //*******************************************************************************************
377 
378  //**Greater-than operator********************************************************************
384  inline bool operator>( const ConstIterator& rhs ) const {
385  return right_ > rhs.right_;
386  }
387  //*******************************************************************************************
388 
389  //**Less-or-equal-than operator**************************************************************
395  inline bool operator<=( const ConstIterator& rhs ) const {
396  return right_ <= rhs.right_;
397  }
398  //*******************************************************************************************
399 
400  //**Greater-or-equal-than operator***********************************************************
406  inline bool operator>=( const ConstIterator& rhs ) const {
407  return right_ >= rhs.right_;
408  }
409  //*******************************************************************************************
410 
411  //**Subtraction operator*********************************************************************
417  inline DifferenceType operator-( const ConstIterator& rhs ) const {
418  return right_ - rhs.right_;
419  }
420  //*******************************************************************************************
421 
422  //**Addition operator************************************************************************
429  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
430  return ConstIterator( it.left_, it.right_ + inc );
431  }
432  //*******************************************************************************************
433 
434  //**Addition operator************************************************************************
441  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
442  return ConstIterator( it.left_, it.right_ + inc );
443  }
444  //*******************************************************************************************
445 
446  //**Subtraction operator*********************************************************************
453  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
454  return ConstIterator( it.left_, it.right_ - dec );
455  }
456  //*******************************************************************************************
457 
458  private:
459  //**Member variables*************************************************************************
462  //*******************************************************************************************
463  };
464  //**********************************************************************************************
465 
466  //**Compilation flags***************************************************************************
468  enum { vectorizable = VT1::vectorizable && VT2::vectorizable &&
471 
473  enum { smpAssignable = VT1::smpAssignable && !evaluateRight };
474  //**********************************************************************************************
475 
476  //**Constructor*********************************************************************************
482  explicit inline DVecTDVecMultExpr( const VT1& lhs, const VT2& rhs )
483  : lhs_( lhs ) // Left-hand side dense vector of the multiplication expression
484  , rhs_( rhs ) // Right-hand side dense vector of the multiplication expression
485  {}
486  //**********************************************************************************************
487 
488  //**Access operator*****************************************************************************
495  inline ReturnType operator()( size_t i, size_t j ) const {
496  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
497  BLAZE_INTERNAL_ASSERT( j < rhs_.size(), "Invalid column access index" );
498 
499  return lhs_[i] * rhs_[j];
500  }
501  //**********************************************************************************************
502 
503  //**Load function*******************************************************************************
510  inline IntrinsicType load( size_t i, size_t j ) const {
511  typedef IntrinsicTrait<ElementType> IT;
512  BLAZE_INTERNAL_ASSERT( i < lhs_.size() , "Invalid row access index" );
513  BLAZE_INTERNAL_ASSERT( j < rhs_.size() , "Invalid column access index" );
514  BLAZE_INTERNAL_ASSERT( j % IT::size == 0UL, "Invalid column access index" );
515  const IntrinsicType xmm1( set( lhs_[i] ) );
516  const IntrinsicType xmm2( rhs_.load( j ) );
517  return xmm1 * xmm2;
518  }
519  //**********************************************************************************************
520 
521  //**Begin function******************************************************************************
527  inline ConstIterator begin( size_t i ) const {
528  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
529  return ConstIterator( lhs_.begin()+i, rhs_.begin() );
530  }
531  //**********************************************************************************************
532 
533  //**End function********************************************************************************
539  inline ConstIterator end( size_t i ) const {
540  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
541  return ConstIterator( lhs_.begin()+i, rhs_.end() );
542  }
543  //**********************************************************************************************
544 
545  //**Rows function*******************************************************************************
550  inline size_t rows() const {
551  return lhs_.size();
552  }
553  //**********************************************************************************************
554 
555  //**Columns function****************************************************************************
560  inline size_t columns() const {
561  return rhs_.size();
562  }
563  //**********************************************************************************************
564 
565  //**Left operand access*************************************************************************
570  inline LeftOperand leftOperand() const {
571  return lhs_;
572  }
573  //**********************************************************************************************
574 
575  //**Right operand access************************************************************************
580  inline RightOperand rightOperand() const {
581  return rhs_;
582  }
583  //**********************************************************************************************
584 
585  //**********************************************************************************************
591  template< typename T >
592  inline bool canAlias( const T* alias ) const {
593  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
594  }
595  //**********************************************************************************************
596 
597  //**********************************************************************************************
603  template< typename T >
604  inline bool isAliased( const T* alias ) const {
605  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
606  }
607  //**********************************************************************************************
608 
609  //**********************************************************************************************
614  inline bool isAligned() const {
615  return lhs_.isAligned() && rhs_.isAligned();
616  }
617  //**********************************************************************************************
618 
619  //**********************************************************************************************
624  inline bool canSMPAssign() const {
625  return ( rows() > SMP_DVECTDVECMULT_THRESHOLD );
626  }
627  //**********************************************************************************************
628 
629  private:
630  //**Member variables****************************************************************************
631  LeftOperand lhs_;
632  RightOperand rhs_;
633  //**********************************************************************************************
634 
635  //**Assignment to row-major dense matrices******************************************************
649  template< typename MT > // Type of the target dense matrix
650  friend inline typename EnableIf< UseAssign<MT> >::Type
652  {
654 
655  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
656  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
657 
658  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
659  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
660 
661  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
662  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
663  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
664  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
665 
666  DVecTDVecMultExpr::selectAssignKernel( ~lhs, x, y );
667  }
669  //**********************************************************************************************
670 
671  //**Default assignment to row-major dense matrices**********************************************
685  template< typename MT // Type of the left-hand side target matrix
686  , typename VT3 // Type of the left-hand side vector operand
687  , typename VT4 > // Type of the right-hand side vector operand
688  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
689  selectAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
690  {
691  const size_t m( (~A).rows() );
692  const size_t n( (~A).columns() );
693 
694  const size_t jend( n & size_t(-2) );
695  BLAZE_INTERNAL_ASSERT( ( n - ( n % 2UL ) ) == jend, "Invalid end calculation" );
696 
697  for( size_t i=0UL; i<m; ++i ) {
698  for( size_t j=0UL; j<jend; j+=2UL ) {
699  (~A)(i,j ) = x[i] * y[j ];
700  (~A)(i,j+1UL) = x[i] * y[j+1];
701  }
702  if( jend < n ) {
703  (~A)(i,jend) = x[i] * y[jend];
704  }
705  }
706  }
708  //**********************************************************************************************
709 
710  //**Vectorized assignment to row-major dense matrices*******************************************
724  template< typename MT // Type of the left-hand side target matrix
725  , typename VT3 // Type of the left-hand side vector operand
726  , typename VT4 > // Type of the right-hand side vector operand
727  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
728  selectAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
729  {
730  typedef IntrinsicTrait<ElementType> IT;
731 
732  const size_t m( (~A).rows() );
733  const size_t n( (~A).columns() );
734 
735  for( size_t i=0UL; i<m; ++i )
736  {
737  const IntrinsicType x1( set( x[i] ) );
738 
739  for( size_t j=0UL; j<n; j+=IT::size ) {
740  (~A).store( i, j, x1 * y.load(j) );
741  }
742  }
743  }
745  //**********************************************************************************************
746 
747  //**Assignment to column-major dense matrices***************************************************
759  template< typename MT > // Type of the target dense matrix
760  friend inline void assign( DenseMatrix<MT,true>& lhs, const DVecTDVecMultExpr& rhs )
761  {
763 
765 
766  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
767  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
768 
769  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
770  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
771 
772  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
773  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
774  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
775  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
776 
777  DVecTDVecMultExpr::selectAssignKernel( ~lhs, x, y );
778  }
780  //**********************************************************************************************
781 
782  //**Default assignment to column-major dense matrices*******************************************
796  template< typename MT // Type of the left-hand side target matrix
797  , typename VT3 // Type of the left-hand side vector operand
798  , typename VT4 > // Type of the right-hand side vector operand
799  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
800  selectAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
801  {
802  const size_t m( (~A).rows() );
803  const size_t n( (~A).columns() );
804 
805  const size_t iend( m & size_t(-2) );
806  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == iend, "Invalid end calculation" );
807 
808  for( size_t j=0UL; j<n; ++j ) {
809  for( size_t i=0UL; i<iend; i+=2UL ) {
810  (~A)(i ,j) = x[i ] * y[j];
811  (~A)(i+1UL,j) = x[i+1] * y[j];
812  }
813  if( iend < m ) {
814  (~A)(iend,j) = x[iend] * y[j];
815  }
816  }
817  }
819  //**********************************************************************************************
820 
821  //**Vectorized assignment to column-major dense matrices****************************************
835  template< typename MT // Type of the left-hand side target matrix
836  , typename VT3 // Type of the left-hand side vector operand
837  , typename VT4 > // Type of the right-hand side vector operand
838  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
839  selectAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
840  {
841  typedef IntrinsicTrait<ElementType> IT;
842 
843  const size_t m( (~A).rows() );
844  const size_t n( (~A).columns() );
845 
846  for( size_t j=0UL; j<n; ++j )
847  {
848  const IntrinsicType y1( set( y[j] ) );
849 
850  for( size_t i=0UL; i<m; i+=IT::size ) {
851  (~A).store( i, j, x.load(i) * y1 );
852  }
853  }
854  }
856  //**********************************************************************************************
857 
858  //**Assignment to sparse matrices***************************************************************
870  template< typename MT // Type of the target sparse matrix
871  , bool SO > // Storage order of the target sparse matrix
872  friend inline void assign( SparseMatrix<MT,SO>& lhs, const DVecTDVecMultExpr& rhs )
873  {
875 
876  typedef typename SelectType< SO, OppositeType, ResultType >::Type TmpType;
877 
884 
885  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
886  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
887 
888  const TmpType tmp( serial( rhs ) );
889  assign( ~lhs, tmp );
890  }
892  //**********************************************************************************************
893 
894  //**Addition assignment to row-major dense matrices*********************************************
909  template< typename MT > // Type of the target dense matrix
910  friend inline typename EnableIf< UseAssign<MT> >::Type
911  addAssign( DenseMatrix<MT,false>& lhs, const DVecTDVecMultExpr& rhs )
912  {
914 
915  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
916  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
917 
918  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
919  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
920 
921  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
922  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
923  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
924  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
925 
926  DVecTDVecMultExpr::selectAddAssignKernel( ~lhs, x, y );
927  }
929  //**********************************************************************************************
930 
931  //**Default addition assignment to row-major dense matrices*************************************
945  template< typename MT // Type of the left-hand side target matrix
946  , typename VT3 // Type of the left-hand side vector operand
947  , typename VT4 > // Type of the right-hand side vector operand
948  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
949  selectAddAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
950  {
951  const size_t m( (~A).rows() );
952  const size_t n( (~A).columns() );
953 
954  const size_t jend( n & size_t(-2) );
955  BLAZE_INTERNAL_ASSERT( ( n - ( n % 2UL ) ) == jend, "Invalid end calculation" );
956 
957  for( size_t i=0UL; i<m; ++i ) {
958  for( size_t j=0UL; j<jend; j+=2UL ) {
959  (~A)(i,j ) += x[i] * y[j ];
960  (~A)(i,j+1UL) += x[i] * y[j+1UL];
961  }
962  if( jend < n ) {
963  (~A)(i,jend) += x[i] * y[jend];
964  }
965  }
966  }
968  //**********************************************************************************************
969 
970  //**Vectorized addition assignment to row-major dense matrices**********************************
984  template< typename MT // Type of the left-hand side target matrix
985  , typename VT3 // Type of the left-hand side vector operand
986  , typename VT4 > // Type of the right-hand side vector operand
987  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
988  selectAddAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
989  {
990  typedef IntrinsicTrait<ElementType> IT;
991 
992  const size_t m( (~A).rows() );
993  const size_t n( (~A).columns() );
994 
995  for( size_t i=0UL; i<m; ++i )
996  {
997  const IntrinsicType x1( set( x[i] ) );
998 
999  for( size_t j=0UL; j<n; j+=IT::size ) {
1000  (~A).store( i, j, (~A).load(i,j) + x1 * y.load(j) );
1001  }
1002  }
1003  }
1005  //**********************************************************************************************
1006 
1007  //**Addition assignment to column-major dense matrices******************************************
1020  template< typename MT > // Type of the target dense matrix
1021  friend inline void addAssign( DenseMatrix<MT,true>& lhs, const DVecTDVecMultExpr& rhs )
1022  {
1024 
1026 
1027  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1028  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1029 
1030  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1031  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
1032 
1033  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1034  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1035  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1036  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1037 
1038  DVecTDVecMultExpr::selectAddAssignKernel( ~lhs, x, y );
1039  }
1041  //**********************************************************************************************
1042 
1043  //**Default addition assignment to column dense matrices****************************************
1057  template< typename MT // Type of the left-hand side target matrix
1058  , typename VT3 // Type of the left-hand side vector operand
1059  , typename VT4 > // Type of the right-hand side vector operand
1060  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
1061  selectAddAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1062  {
1063  const size_t m( (~A).rows() );
1064  const size_t n( (~A).columns() );
1065 
1066  const size_t iend( m & size_t(-2) );
1067  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == iend, "Invalid end calculation" );
1068 
1069  for( size_t j=0UL; j<n; ++j ) {
1070  for( size_t i=0UL; i<iend; i+=2UL ) {
1071  (~A)(i ,j) += x[i ] * y[j];
1072  (~A)(i+1UL,j) += x[i+1UL] * y[j];
1073  }
1074  if( iend < m ) {
1075  (~A)(iend,j) += x[iend] * y[j];
1076  }
1077  }
1078  }
1080  //**********************************************************************************************
1081 
1082  //**Vectorized addition assignment to column-major dense matrices*******************************
1096  template< typename MT // Type of the left-hand side target matrix
1097  , typename VT3 // Type of the left-hand side vector operand
1098  , typename VT4 > // Type of the right-hand side vector operand
1099  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
1100  selectAddAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1101  {
1102  typedef IntrinsicTrait<ElementType> IT;
1103 
1104  const size_t m( (~A).rows() );
1105  const size_t n( (~A).columns() );
1106 
1107  for( size_t j=0UL; j<n; ++j )
1108  {
1109  const IntrinsicType y1( set( y[j] ) );
1110 
1111  for( size_t i=0UL; i<m; i+=IT::size ) {
1112  (~A).store( i, j, (~A).load(i,j) + x.load(i) * y1 );
1113  }
1114  }
1115  }
1117  //**********************************************************************************************
1118 
1119  //**Addition assignment to sparse matrices******************************************************
1120  // No special implementation for the addition assignment to sparse matrices.
1121  //**********************************************************************************************
1122 
1123  //**Subtraction assignment to row-major dense matrices******************************************
1138  template< typename MT > // Type of the target dense matrix
1139  friend inline typename EnableIf< UseAssign<MT> >::Type
1140  subAssign( DenseMatrix<MT,false>& lhs, const DVecTDVecMultExpr& rhs )
1141  {
1143 
1144  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1145  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1146 
1147  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1148  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
1149 
1150  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1151  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1152  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1153  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1154 
1155  DVecTDVecMultExpr::selectSubAssignKernel( ~lhs, x, y );
1156  }
1158  //**********************************************************************************************
1159 
1160  //**Default subtraction assignment to row-major dense matrices**********************************
1174  template< typename MT // Type of the left-hand side target matrix
1175  , typename VT3 // Type of the left-hand side vector operand
1176  , typename VT4 > // Type of the right-hand side vector operand
1177  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
1178  selectSubAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
1179  {
1180  const size_t m( (~A).rows() );
1181  const size_t n( (~A).columns() );
1182 
1183  const size_t jend( n & size_t(-2) );
1184  BLAZE_INTERNAL_ASSERT( ( n - ( n % 2UL ) ) == jend, "Invalid end calculation" );
1185 
1186  for( size_t i=0UL; i<m; ++i ) {
1187  for( size_t j=0UL; j<jend; j+=2UL ) {
1188  (~A)(i,j ) -= x[i] * y[j ];
1189  (~A)(i,j+1UL) -= x[i] * y[j+1UL];
1190  }
1191  if( jend < n ) {
1192  (~A)(i,jend) -= x[i] * y[jend];
1193  }
1194  }
1195  }
1197  //**********************************************************************************************
1198 
1199  //**Vectorized subtraction assignment to row-major dense matrices*******************************
1213  template< typename MT // Type of the left-hand side target matrix
1214  , typename VT3 // Type of the left-hand side vector operand
1215  , typename VT4 > // Type of the right-hand side vector operand
1216  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
1217  selectSubAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
1218  {
1219  typedef IntrinsicTrait<ElementType> IT;
1220 
1221  const size_t m( (~A).rows() );
1222  const size_t n( (~A).columns() );
1223 
1224  for( size_t i=0UL; i<m; ++i )
1225  {
1226  const IntrinsicType x1( set( x[i] ) );
1227 
1228  for( size_t j=0UL; j<n; j+=IT::size ) {
1229  (~A).store( i, j, (~A).load(i,j) - x1 * y.load(j) );
1230  }
1231  }
1232  }
1234  //**********************************************************************************************
1235 
1236  //**Subtraction assignment to column-major dense matrices***************************************
1249  template< typename MT > // Type of the target dense matrix
1250  friend inline void subAssign( DenseMatrix<MT,true>& lhs, const DVecTDVecMultExpr& rhs )
1251  {
1253 
1255 
1256  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1257  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1258 
1259  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1260  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
1261 
1262  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1263  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1264  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1265  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1266 
1267  DVecTDVecMultExpr::selectSubAssignKernel( ~lhs, x, y );
1268  }
1270  //**********************************************************************************************
1271 
1272  //**Default subtraction assignment to column dense matrices*************************************
1286  template< typename MT // Type of the left-hand side target matrix
1287  , typename VT3 // Type of the left-hand side vector operand
1288  , typename VT4 > // Type of the right-hand side vector operand
1289  static inline typename EnableIf< UseDefaultKernel<MT,VT3,VT4> >::Type
1290  selectSubAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1291  {
1292  const size_t m( (~A).rows() );
1293  const size_t n( (~A).columns() );
1294 
1295  const size_t iend( m & size_t(-2) );
1296  BLAZE_INTERNAL_ASSERT( ( m - ( m % 2UL ) ) == iend, "Invalid end calculation" );
1297 
1298  for( size_t j=0UL; j<n; ++j ) {
1299  for( size_t i=0UL; i<iend; i+=2UL ) {
1300  (~A)(i ,j) -= x[i ] * y[j];
1301  (~A)(i+1UL,j) -= x[i+1UL] * y[j];
1302  }
1303  if( iend < m ) {
1304  (~A)(iend,j) -= x[iend] * y[j];
1305  }
1306  }
1307  }
1309  //**********************************************************************************************
1310 
1311  //**Vectorized subtraction assignment to column-major dense matrices****************************
1325  template< typename MT // Type of the left-hand side target matrix
1326  , typename VT3 // Type of the left-hand side vector operand
1327  , typename VT4 > // Type of the right-hand side vector operand
1328  static inline typename EnableIf< UseVectorizedKernel<MT,VT3,VT4> >::Type
1329  selectSubAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1330  {
1331  typedef IntrinsicTrait<ElementType> IT;
1332 
1333  const size_t m( (~A).rows() );
1334  const size_t n( (~A).columns() );
1335 
1336  for( size_t j=0UL; j<n; ++j )
1337  {
1338  const IntrinsicType y1( set( y[j] ) );
1339 
1340  for( size_t i=0UL; i<m; i+=IT::size ) {
1341  (~A).store( i, j, (~A).load(i,j) - x.load(i) * y1 );
1342  }
1343  }
1344  }
1346  //**********************************************************************************************
1347 
1348  //**Subtraction assignment to sparse matrices***************************************************
1349  // No special implementation for the subtraction assignment to sparse matrices.
1350  //**********************************************************************************************
1351 
1352  //**Multiplication assignment to dense matrices*************************************************
1353  // No special implementation for the multiplication assignment to dense matrices.
1354  //**********************************************************************************************
1355 
1356  //**Multiplication assignment to sparse matrices************************************************
1357  // No special implementation for the multiplication assignment to sparse matrices.
1358  //**********************************************************************************************
1359 
1360  //**SMP assignment to dense matrices************************************************************
1374  template< typename MT // Type of the target dense matrix
1375  , bool SO > // Storage order of the target dense matrix
1376  friend inline typename EnableIf< UseSMPAssign<MT> >::Type
1377  smpAssign( DenseMatrix<MT,SO>& lhs, const DVecTDVecMultExpr& rhs )
1378  {
1380 
1381  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1382  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1383 
1384  LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
1385  RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
1386 
1387  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1388  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1389  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1390  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1391 
1392  smpAssign( ~lhs, x * y );
1393  }
1395  //**********************************************************************************************
1396 
1397  //**SMP assignment to sparse matrices***********************************************************
1411  template< typename MT // Type of the target sparse matrix
1412  , bool SO > // Storage order of the target sparse matrix
1413  friend inline typename EnableIf< UseSMPAssign<MT> >::Type
1414  smpAssign( SparseMatrix<MT,SO>& lhs, const DVecTDVecMultExpr& rhs )
1415  {
1417 
1418  typedef typename SelectType< SO, OppositeType, ResultType >::Type TmpType;
1419 
1426 
1427  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1428  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1429 
1430  const TmpType tmp( rhs );
1431  smpAssign( ~lhs, tmp );
1432  }
1434  //**********************************************************************************************
1435 
1436  //**SMP addition assignment to dense matrices***************************************************
1450  template< typename MT > // Type of the target dense matrix
1451  friend inline typename EnableIf< UseSMPAssign<MT> >::Type
1452  smpAddAssign( DenseMatrix<MT,false>& lhs, const DVecTDVecMultExpr& rhs )
1453  {
1455 
1456  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1457  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1458 
1459  LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
1460  RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
1461 
1462  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1463  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1464  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1465  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1466 
1467  smpAddAssign( ~lhs, x * y );
1468  }
1470  //**********************************************************************************************
1471 
1472  //**SMP addition assignment to sparse matrices**************************************************
1473  // No special implementation for the SMP addition assignment to sparse matrices.
1474  //**********************************************************************************************
1475 
1476  //**SMP subtraction assignment to dense matrices************************************************
1491  template< typename MT > // Type of the target dense matrix
1492  friend inline typename EnableIf< UseSMPAssign<MT> >::Type
1493  smpSubAssign( DenseMatrix<MT,false>& lhs, const DVecTDVecMultExpr& rhs )
1494  {
1496 
1497  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1498  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1499 
1500  LT x( rhs.lhs_ ); // Evaluation of the left-hand side dense vector operand
1501  RT y( rhs.rhs_ ); // Evaluation of the right-hand side dense vector operand
1502 
1503  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1504  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1505  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1506  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1507 
1508  smpSubAssign( ~lhs, x * y );
1509  }
1511  //**********************************************************************************************
1512 
1513  //**SMP subtraction assignment to sparse matrices***********************************************
1514  // No special implementation for the SMP subtraction assignment to sparse matrices.
1515  //**********************************************************************************************
1516 
1517  //**SMP multiplication assignment to dense matrices*********************************************
1518  // No special implementation for the SMP multiplication assignment to dense matrices.
1519  //**********************************************************************************************
1520 
1521  //**SMP multiplication assignment to sparse matrices********************************************
1522  // No special implementation for the SMP multiplication assignment to sparse matrices.
1523  //**********************************************************************************************
1524 
1525  //**Compile time checks*************************************************************************
1533  //**********************************************************************************************
1534 };
1535 //*************************************************************************************************
1536 
1537 
1538 
1539 
1540 //=================================================================================================
1541 //
1542 // GLOBAL BINARY ARITHMETIC OPERATORS
1543 //
1544 //=================================================================================================
1545 
1546 //*************************************************************************************************
1573 template< typename T1 // Type of the left-hand side dense vector
1574  , typename T2 > // Type of the right-hand side dense vector
1575 inline const DVecTDVecMultExpr<T1,T2>
1577 {
1579 
1580  return DVecTDVecMultExpr<T1,T2>( ~lhs, ~rhs );
1581 }
1582 //*************************************************************************************************
1583 
1584 
1585 
1586 
1587 //=================================================================================================
1588 //
1589 // ROWS SPECIALIZATIONS
1590 //
1591 //=================================================================================================
1592 
1593 //*************************************************************************************************
1595 template< typename VT1, typename VT2 >
1596 struct Rows< DVecTDVecMultExpr<VT1,VT2> > : public Size<VT1>
1597 {};
1599 //*************************************************************************************************
1600 
1601 
1602 
1603 
1604 //=================================================================================================
1605 //
1606 // COLUMNS SPECIALIZATIONS
1607 //
1608 //=================================================================================================
1609 
1610 //*************************************************************************************************
1612 template< typename VT1, typename VT2 >
1613 struct Columns< DVecTDVecMultExpr<VT1,VT2> > : public Size<VT2>
1614 {};
1616 //*************************************************************************************************
1617 
1618 
1619 
1620 
1621 //=================================================================================================
1622 //
1623 // EXPRESSION TRAIT SPECIALIZATIONS
1624 //
1625 //=================================================================================================
1626 
1627 //*************************************************************************************************
1629 template< typename VT1, typename VT2, bool AF >
1630 struct SubmatrixExprTrait< DVecTDVecMultExpr<VT1,VT2>, AF >
1631 {
1632  public:
1633  //**********************************************************************************************
1634  typedef typename MultExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
1635  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
1636  //**********************************************************************************************
1637 };
1639 //*************************************************************************************************
1640 
1641 
1642 //*************************************************************************************************
1644 template< typename VT1, typename VT2 >
1645 struct RowExprTrait< DVecTDVecMultExpr<VT1,VT2> >
1646 {
1647  public:
1648  //**********************************************************************************************
1649  typedef typename MultExprTrait< typename VT1::ReturnType, VT2 >::Type Type;
1650  //**********************************************************************************************
1651 };
1653 //*************************************************************************************************
1654 
1655 
1656 //*************************************************************************************************
1658 template< typename VT1, typename VT2 >
1659 struct ColumnExprTrait< DVecTDVecMultExpr<VT1,VT2> >
1660 {
1661  public:
1662  //**********************************************************************************************
1663  typedef typename MultExprTrait< VT1, typename VT2::ReturnType >::Type Type;
1664  //**********************************************************************************************
1665 };
1667 //*************************************************************************************************
1668 
1669 } // namespace blaze
1670 
1671 #endif
Pointer difference type of the Blaze library.
RT1::ElementType ET1
Element type of the left-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:102
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:194
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecTDVecMultExpr.h:231
Header file for the Rows type trait.
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:4838
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecTDVecMultExpr.h:299
#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:205
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecTDVecMultExpr.h:277
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DVecTDVecMultExpr.h:539
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecTDVecMultExpr.h:453
#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:195
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecTDVecMultExpr.h:592
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecTDVecMultExpr.h:417
ElementType * PointerType
Pointer return type.
Definition: DVecTDVecMultExpr.h:229
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2478
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:257
DVecTDVecMultExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the DVecTDVecMultExpr class.
Definition: DVecTDVecMultExpr.h:482
LeftIteratorType left_
Iterator to the current left-hand side element.
Definition: DVecTDVecMultExpr.h:460
VT2::ConstIterator RightIteratorType
ConstIterator type of the right-hand side dense matrix expression.
Definition: DVecTDVecMultExpr.h:244
Expression object for outer products between two dense vectors.The DVecTDVecMultExpr class represents...
Definition: DVecTDVecMultExpr.h:94
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:695
Header file for the Computation base class.
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecTDVecMultExpr.h:406
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:214
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:241
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecTDVecMultExpr.h:373
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecTDVecMultExpr.h:604
Constraint on the data type.
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
ValueType value_type
Type of the underlying elements.
Definition: DVecTDVecMultExpr.h:235
VT1::CompositeType CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:106
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:429
VT2::ReturnType RN2
Return type of the right-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:105
#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:309
SelectType< useAssign, const ResultType, const DVecTDVecMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecTDVecMultExpr.h:205
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_VECTVECMULTEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid vector/vector ...
Definition: VecTVecMultExpr.h:161
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecTDVecMultExpr.h:351
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecTDVecMultExpr.h:570
Header file for the DenseMatrix base class.
BLAZE_ALWAYS_INLINE void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:635
Header file for the Columns type trait.
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DVecTDVecMultExpr.h:196
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecTDVecMultExpr.h:199
size_t rows() const
Returns the current number of rows of the matrix.
Definition: DVecTDVecMultExpr.h:550
ReferenceType reference
Reference return type.
Definition: DVecTDVecMultExpr.h:237
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:253
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecTDVecMultExpr.h:362
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecTDVecMultExpr.h:614
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecTDVecMultExpr.h:202
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:211
#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:238
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:217
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecTDVecMultExpr.h:441
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
VT1::ReturnType RN1
Return type of the left-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:104
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:101
Header file for the EnableIf class template.
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecTDVecMultExpr.h:288
Header file for the serial shim.
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecTDVecMultExpr.h:227
IteratorCategory iterator_category
The iterator category.
Definition: DVecTDVecMultExpr.h:234
BLAZE_ALWAYS_INLINE 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:211
VT1::ResultType RT1
Result type of the left-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:100
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
LeftOperand lhs_
Left-hand side dense vector of the multiplication expression.
Definition: DVecTDVecMultExpr.h:631
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:116
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:2477
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:749
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
Base template for the MultTrait class.
Definition: MultTrait.h:142
BLAZE_ALWAYS_INLINE void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:742
RightOperand rightOperand() const
Returns the right-hand side dense vector operand.
Definition: DVecTDVecMultExpr.h:580
IntrinsicType load(size_t i, size_t j) const
Access to the intrinsic elements of the matrix.
Definition: DVecTDVecMultExpr.h:510
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:527
RightIteratorType right_
Iterator to the current right-hand side element.
Definition: DVecTDVecMultExpr.h:461
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecTDVecMultExpr.h:197
RT2::ElementType ET2
Element type of the right-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:103
RightOperand rhs_
Right-hand side dense vector of the multiplication expression.
Definition: DVecTDVecMultExpr.h:632
IntrinsicType load() const
Access to the intrinsic elements of the matrix.
Definition: DVecTDVecMultExpr.h:340
VT2::CompositeType CT2
Composite type of the right-hand side dense vector expression.
Definition: DVecTDVecMultExpr.h:107
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecTDVecMultExpr.h:624
Constraint on the data type.
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:230
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DVecTDVecMultExpr.h:495
Constraint on the data type.
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:265
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecTDVecMultExpr.h:198
#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:560
ElementType ValueType
Type of the underlying elements.
Definition: DVecTDVecMultExpr.h:228
Header file for the IsComputation type trait class.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecTDVecMultExpr.h:330
Iterator over the elements of the dense matrix.
Definition: DVecTDVecMultExpr.h:223
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
PointerType pointer
Pointer return type.
Definition: DVecTDVecMultExpr.h:236
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:130
BLAZE_ALWAYS_INLINE 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:225
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecTDVecMultExpr.h:395
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecTDVecMultExpr.h:320
Header file for the Size type trait.
Evaluation of the resulting expression type of a multiplication.Via this type trait it is possible to...
Definition: MultExprTrait.h:137
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecTDVecMultExpr.h:384
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:208
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
BLAZE_ALWAYS_INLINE void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:849