DVecSVecOuterExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECSVECOUTEREXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECSVECOUTEREXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <blaze/math/Aliases.h>
53 #include <blaze/math/Exception.h>
59 #include <blaze/math/shims/Reset.h>
61 #include <blaze/math/SIMD.h>
73 #include <blaze/util/Assert.h>
74 #include <blaze/util/EnableIf.h>
76 #include <blaze/util/mpl/If.h>
77 #include <blaze/util/Types.h>
81 #include <blaze/util/Unused.h>
82 
83 
84 namespace blaze {
85 
86 //=================================================================================================
87 //
88 // CLASS DVECSVECOUTEREXPR
89 //
90 //=================================================================================================
91 
92 //*************************************************************************************************
99 template< typename VT1 // Type of the left-hand side dense vector
100  , typename VT2 > // Type of the right-hand side sparse vector
102  : public VecTVecMultExpr< SparseMatrix< DVecSVecOuterExpr<VT1,VT2>, false > >
103  , private Computation
104 {
105  private:
106  //**Type definitions****************************************************************************
115  //**********************************************************************************************
116 
117  //**Return type evaluation**********************************************************************
119 
124  enum : bool { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
125 
128  //**********************************************************************************************
129 
130  //**Evaluation strategy*************************************************************************
132 
139  enum : bool { useAssign = ( IsComputation<VT1>::value || !IsNumeric<ET1>::value ||
141 
143  template< typename MT >
145  struct UseAssign {
146  enum : bool { value = useAssign };
147  };
149  //**********************************************************************************************
150 
151  //**********************************************************************************************
153 
156  template< typename T1, typename T2, typename T3 >
157  struct UseVectorizedKernel {
158  enum : bool { value = useOptimizedKernels &&
159  T1::simdEnabled && T2::simdEnabled &&
161  IsSame< ElementType_<T1>, ElementType_<T3> >::value &&
163  };
165  //**********************************************************************************************
166 
167  //**********************************************************************************************
169 
172  template< typename T1, typename T2, typename T3 >
173  struct UseDefaultKernel {
174  enum : bool { value = !UseVectorizedKernel<T1,T2,T3>::value };
175  };
177  //**********************************************************************************************
178 
179  public:
180  //**Type definitions****************************************************************************
186 
189 
192 
194  using LeftOperand = If_< IsExpression<VT1>, const VT1, const VT1& >;
195 
197  using RightOperand = If_< IsExpression<VT2>, const VT2, const VT2& >;
198 
200  using LT = If_< IsComputation<VT1>, const RT1, CT1 >;
201 
203  using RT = If_< IsComputation<VT2>, const RT2, CT2 >;
204  //**********************************************************************************************
205 
206  //**ConstIterator class definition**************************************************************
210  {
211  public:
212  //**Type definitions*************************************************************************
215 
217  using LeftElement = ET1;
218 
221 
222  using IteratorCategory = std::forward_iterator_tag;
223  using ValueType = Element;
227 
228  // STL iterator requirements
234  //*******************************************************************************************
235 
236  //**Constructor******************************************************************************
240  : v_ ( v ) // Element of the left-hand side dense vector expression.
241  , it_( it ) // Iterator over the elements of the right-hand side sparse vector expression
242  {}
243  //*******************************************************************************************
244 
245  //**Prefix increment operator****************************************************************
251  ++it_;
252  return *this;
253  }
254  //*******************************************************************************************
255 
256  //**Element access operator******************************************************************
261  inline const Element operator*() const {
262  return Element( v_ * it_->value(), it_->index() );
263  }
264  //*******************************************************************************************
265 
266  //**Element access operator******************************************************************
271  inline const ConstIterator* operator->() const {
272  return this;
273  }
274  //*******************************************************************************************
275 
276  //**Value function***************************************************************************
281  inline ReturnType value() const {
282  return v_ * it_->value();
283  }
284  //*******************************************************************************************
285 
286  //**Index function***************************************************************************
291  inline size_t index() const {
292  return it_->index();
293  }
294  //*******************************************************************************************
295 
296  //**Equality operator************************************************************************
302  inline bool operator==( const ConstIterator& rhs ) const {
303  return it_ == rhs.it_;
304  }
305  //*******************************************************************************************
306 
307  //**Inequality operator**********************************************************************
313  inline bool operator!=( const ConstIterator& rhs ) const {
314  return it_ != rhs.it_;
315  }
316  //*******************************************************************************************
317 
318  //**Subtraction operator*********************************************************************
324  inline DifferenceType operator-( const ConstIterator& rhs ) const {
325  return it_ - rhs.it_;
326  }
327  //*******************************************************************************************
328 
329  private:
330  //**Member variables*************************************************************************
333  //*******************************************************************************************
334  };
335  //**********************************************************************************************
336 
337  //**Compilation flags***************************************************************************
339  enum : bool { smpAssignable = false };
340  //**********************************************************************************************
341 
342  //**SIMD properties*****************************************************************************
344  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
345  //**********************************************************************************************
346 
347  //**Constructor*********************************************************************************
353  explicit inline DVecSVecOuterExpr( const VT1& lhs, const VT2& rhs ) noexcept
354  : lhs_( lhs ) // Left-hand side dense vector of the multiplication expression
355  , rhs_( rhs ) // Right-hand side sparse vector of the multiplication expression
356  {}
357  //**********************************************************************************************
358 
359  //**Access operator*****************************************************************************
366  inline ReturnType operator()( size_t i, size_t j ) const {
367  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
368  BLAZE_INTERNAL_ASSERT( j < rhs_.size(), "Invalid column access index" );
369 
370  return lhs_[i] * rhs_[j];
371  }
372  //**********************************************************************************************
373 
374  //**At function*********************************************************************************
382  inline ReturnType at( size_t i, size_t j ) const {
383  if( i >= lhs_.size() ) {
384  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
385  }
386  if( j >= rhs_.size() ) {
387  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
388  }
389  return (*this)(i,j);
390  }
391  //**********************************************************************************************
392 
393  //**Begin function******************************************************************************
399  inline ConstIterator begin( size_t i ) const {
400  return ConstIterator( lhs_[i], rhs_.begin() );
401  }
402  //**********************************************************************************************
403 
404  //**End function********************************************************************************
410  inline ConstIterator end( size_t i ) const {
411  return ConstIterator( lhs_[i], rhs_.end() );
412  }
413  //**********************************************************************************************
414 
415  //**Rows function*******************************************************************************
420  inline size_t rows() const noexcept {
421  return lhs_.size();
422  }
423  //**********************************************************************************************
424 
425  //**Columns function****************************************************************************
430  inline size_t columns() const noexcept {
431  return rhs_.size();
432  }
433  //**********************************************************************************************
434 
435  //**NonZeros function***************************************************************************
440  inline size_t nonZeros() const {
441  return lhs_.size() * rhs_.nonZeros();
442  }
443  //**********************************************************************************************
444 
445  //**NonZeros function***************************************************************************
451  inline size_t nonZeros( size_t i ) const {
452  UNUSED_PARAMETER( i );
453  return rhs_.nonZeros();
454  }
455  //**********************************************************************************************
456 
457  //**Find function*******************************************************************************
464  inline ConstIterator find( size_t i, size_t j ) const {
466  return ConstIterator( lhs_[i], rhs_.find( j ) );
467  }
468  //**********************************************************************************************
469 
470  //**LowerBound function*************************************************************************
477  inline ConstIterator lowerBound( size_t i, size_t j ) const {
479  return ConstIterator( lhs_[i], rhs_.lowerBound( j ) );
480  }
481  //**********************************************************************************************
482 
483  //**UpperBound function*************************************************************************
490  inline ConstIterator upperBound( size_t i, size_t j ) const {
492  return ConstIterator( lhs_[i], rhs_.upperBound( j ) );
493  }
494  //**********************************************************************************************
495 
496  //**Left operand access*************************************************************************
501  inline LeftOperand leftOperand() const noexcept {
502  return lhs_;
503  }
504  //**********************************************************************************************
505 
506  //**Right operand access************************************************************************
511  inline RightOperand rightOperand() const noexcept {
512  return rhs_;
513  }
514  //**********************************************************************************************
515 
516  //**********************************************************************************************
522  template< typename T >
523  inline bool canAlias( const T* alias ) const noexcept {
524  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
525  }
526  //**********************************************************************************************
527 
528  //**********************************************************************************************
534  template< typename T >
535  inline bool isAliased( const T* alias ) const noexcept {
536  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
537  }
538  //**********************************************************************************************
539 
540  private:
541  //**Member variables****************************************************************************
544  //**********************************************************************************************
545 
546  //**Assignment to row-major dense matrices******************************************************
561  template< typename MT > // Type of the target dense matrix
562  friend inline EnableIf_< UseAssign<MT> >
563  assign( DenseMatrix<MT,false>& lhs, const DVecSVecOuterExpr& rhs )
564  {
566 
567  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
568  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
569 
571 
572  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
573  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
574 
575  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
576  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
577  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
578  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
579 
580  const ConstIterator begin( y.begin() );
581  const ConstIterator end ( y.end() );
582 
583  for( size_t i=0UL; i<x.size(); ++i ) {
584  for( ConstIterator element=begin; element!=end; ++element ) {
585  (~lhs)(i,element->index()) = x[i] * element->value();
586  }
587  }
588  }
590  //**********************************************************************************************
591 
592  //**Assignment to column-major dense matrices***************************************************
605  template< typename MT > // Type of the target dense matrix
606  friend inline void assign( DenseMatrix<MT,true>& lhs, const DVecSVecOuterExpr& rhs )
607  {
609 
611 
612  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
613  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
614 
615  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
616  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
617 
618  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
619  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
620  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
621  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
622 
623  DVecSVecOuterExpr::selectAssignKernel( ~lhs, x, y );
624  }
626  //**********************************************************************************************
627 
628  //**Default assignment to column-major dense matrices*******************************************
642  template< typename MT // Type of the left-hand side target matrix
643  , typename VT3 // Type of the left-hand side vector operand
644  , typename VT4 > // Type of the right-hand side vector operand
646  selectAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
647  {
649 
650  const ConstIterator begin( y.begin() );
651  const ConstIterator end ( y.end() );
652 
653  for( ConstIterator element=begin; element!=end; ++element ) {
654  for( size_t i=0UL; i<x.size(); ++i ) {
655  (~A)(i,element->index()) = x[i] * element->value();
656  }
657  }
658  }
660  //**********************************************************************************************
661 
662  //**Vectorized assignment to column-major dense matrices****************************************
676  template< typename MT // Type of the left-hand side target matrix
677  , typename VT3 // Type of the left-hand side vector operand
678  , typename VT4 > // Type of the right-hand side vector operand
680  selectAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
681  {
683 
684  constexpr bool remainder( !IsPadded<MT>::value || !IsPadded<VT3>::value );
685 
686  const size_t M( (~A).rows() );
687 
688  const size_t ipos( remainder ? ( M & size_t(-SIMDSIZE) ) : M );
689  BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % SIMDSIZE ) ) == ipos, "Invalid end calculation" );
690 
691  const ConstIterator begin( y.begin() );
692  const ConstIterator end ( y.end() );
693 
694  for( ConstIterator element=begin; element!=end; ++element )
695  {
696  const SIMDTrait_<ElementType> y1( set( element->value() ) );
697 
698  size_t i( 0UL );
699 
700  for( ; i<ipos; i+=SIMDSIZE ) {
701  (~A).store( i, element->index(), x.load(i) * y1 );
702  }
703  for( ; remainder && i<M; ++i ) {
704  (~A)(i,element->index()) = x[i] * element->value();
705  }
706  }
707  }
709  //**********************************************************************************************
710 
711  //**Assignment to row-major sparse matrices*****************************************************
726  template< typename MT > // Type of the target sparse matrix
727  friend inline EnableIf_< UseAssign<MT> >
728  assign( SparseMatrix<MT,false>& lhs, const DVecSVecOuterExpr& rhs )
729  {
731 
732  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
733  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns() , "Invalid number of columns" );
734  BLAZE_INTERNAL_ASSERT( (~lhs).capacity() >= rhs.nonZeros(), "Insufficient capacity" );
735 
737 
738  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
739  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
740 
741  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
742  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
743  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
744  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
745 
746  const ConstIterator begin( y.begin() );
747  const ConstIterator end ( y.end() );
748 
749  if( begin == end )
750  return;
751 
752  for( size_t i=0UL; i<x.size(); ++i ) {
753  if( !isDefault( x[i] ) ) {
754  for( ConstIterator element=begin; element!=end; ++element ) {
755  (~lhs).append( i, element->index(), x[i] * element->value() );
756  }
757  }
758  (~lhs).finalize( i );
759  }
760  }
762  //**********************************************************************************************
763 
764  //**Assignment to column-major sparse matrices*****************************************************
777  template< typename MT > // Type of the target sparse matrix
778  friend inline void assign( SparseMatrix<MT,true>& lhs, const DVecSVecOuterExpr& rhs )
779  {
781 
783 
784  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
785  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns() , "Invalid number of columns" );
786 
788 
789  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
790  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
791 
792  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
793  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
794  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
795  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
796 
797  const ConstIterator begin( y.begin() );
798  const ConstIterator end ( y.end() );
799 
800  if( begin == end )
801  return;
802 
803  (~lhs).reserve( begin->index(), rhs.nonZeros() );
804 
805  size_t index( 0UL );
806 
807  for( ConstIterator element=begin; element!=end; ++element ) {
808  if( !isDefault( element->value() ) ) {
809  for( ; index < element->index(); ++index ) {
810  (~lhs).finalize( index );
811  }
812  for( size_t i=0UL; i<x.size(); ++i ) {
813  (~lhs).append( i, element->index(), x[i] * element->value() );
814  }
815  (~lhs).finalize( index++ );
816  }
817  }
818 
819  for( ; index < y.size(); ++index ) {
820  (~lhs).finalize( index );
821  }
822  }
824  //**********************************************************************************************
825 
826  //**Addition assignment to row-major dense matrices*********************************************
842  template< typename MT > // Type of the target dense matrix
843  friend inline EnableIf_< UseAssign<MT> >
844  addAssign( DenseMatrix<MT,false>& lhs, const DVecSVecOuterExpr& rhs )
845  {
847 
848  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
849  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
850 
852 
853  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
854  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
855 
856  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
857  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
858  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
859  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
860 
861  const ConstIterator begin( y.begin() );
862  const ConstIterator end ( y.end() );
863 
864  for( size_t i=0UL; i<x.size(); ++i ) {
865  if( !isDefault( x[i] ) ) {
866  for( ConstIterator element=begin; element!=end; ++element ) {
867  (~lhs)(i,element->index()) += x[i] * element->value();
868  }
869  }
870  }
871  }
873  //**********************************************************************************************
874 
875  //**Addition assignment to column-major dense matrices******************************************
888  template< typename MT > // Type of the target dense matrix
889  friend inline void addAssign( DenseMatrix<MT,true>& lhs, const DVecSVecOuterExpr& rhs )
890  {
892 
894 
895  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
896  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
897 
898  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
899  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
900 
901  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
902  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
903  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
904  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
905 
906  DVecSVecOuterExpr::selectAddAssignKernel( ~lhs, x, y );
907  }
909  //**********************************************************************************************
910 
911  //**Default addition assignment to column dense matrices****************************************
925  template< typename MT // Type of the left-hand side target matrix
926  , typename VT3 // Type of the left-hand side vector operand
927  , typename VT4 > // Type of the right-hand side vector operand
929  selectAddAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
930  {
932 
933  const ConstIterator begin( y.begin() );
934  const ConstIterator end ( y.end() );
935 
936  for( ConstIterator element=begin; element!=end; ++element ) {
937  if( !isDefault( element->value() ) ) {
938  for( size_t i=0UL; i<x.size(); ++i ) {
939  (~A)(i,element->index()) += x[i] * element->value();
940  }
941  }
942  }
943  }
945  //**********************************************************************************************
946 
947  //**Vectorized addition assignment to column-major dense matrices*******************************
961  template< typename MT // Type of the left-hand side target matrix
962  , typename VT3 // Type of the left-hand side vector operand
963  , typename VT4 > // Type of the right-hand side vector operand
965  selectAddAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
966  {
968 
969  constexpr bool remainder( !IsPadded<MT>::value || !IsPadded<VT3>::value );
970 
971  const size_t M( (~A).rows() );
972 
973  const size_t ipos( remainder ? ( M & size_t(-SIMDSIZE) ) : M );
974  BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % SIMDSIZE ) ) == ipos, "Invalid end calculation" );
975 
976  const ConstIterator begin( y.begin() );
977  const ConstIterator end ( y.end() );
978 
979  for( ConstIterator element=begin; element!=end; ++element )
980  {
981  if( isDefault( element->value() ) ) continue;
982 
983  const SIMDTrait_<ElementType> y1( set( element->value() ) );
984 
985  size_t i( 0UL );
986 
987  for( ; i<ipos; i+=SIMDSIZE ) {
988  (~A).store( i, element->index(), (~A).load(i,element->index()) + x.load(i) * y1 );
989  }
990  for( ; remainder && i<M; ++i ) {
991  (~A)(i,element->index()) += x[i] * element->value();
992  }
993  }
994  }
996  //**********************************************************************************************
997 
998  //**Addition assignment to sparse matrices******************************************************
999  // No special implementation for the addition assignment to sparse matrices.
1000  //**********************************************************************************************
1001 
1002  //**Subtraction assignment to row-major dense matrices******************************************
1018  template< typename MT > // Type of the target dense matrix
1019  friend inline EnableIf_< UseAssign<MT> >
1020  subAssign( DenseMatrix<MT,false>& lhs, const DVecSVecOuterExpr& rhs )
1021  {
1023 
1024  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1025  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1026 
1028 
1029  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1030  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
1031 
1032  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1033  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1034  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1035  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1036 
1037  const ConstIterator begin( y.begin() );
1038  const ConstIterator end ( y.end() );
1039 
1040  for( size_t i=0UL; i<x.size(); ++i ) {
1041  if( !isDefault( x[i] ) ) {
1042  for( ConstIterator element=begin; element!=end; ++element ) {
1043  (~lhs)(i,element->index()) -= x[i] * element->value();
1044  }
1045  }
1046  }
1047  }
1049  //**********************************************************************************************
1050 
1051  //**Subtraction assignment to column-major dense matrices***************************************
1064  template< typename MT > // Type of the target dense matrix
1065  friend inline void subAssign( DenseMatrix<MT,true>& lhs, const DVecSVecOuterExpr& rhs )
1066  {
1068 
1070 
1071  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1072  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1073 
1074  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1075  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
1076 
1077  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1078  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1079  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1080  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1081 
1082  DVecSVecOuterExpr::selectSubAssignKernel( ~lhs, x, y );
1083  }
1085  //**********************************************************************************************
1086 
1087  //**Default subtraction assignment to column dense matrices*************************************
1101  template< typename MT // Type of the left-hand side target matrix
1102  , typename VT3 // Type of the left-hand side vector operand
1103  , typename VT4 > // Type of the right-hand side vector operand
1105  selectSubAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1106  {
1108 
1109  const ConstIterator begin( y.begin() );
1110  const ConstIterator end ( y.end() );
1111 
1112  for( ConstIterator element=begin; element!=end; ++element ) {
1113  if( !isDefault( element->value() ) ) {
1114  for( size_t i=0UL; i<x.size(); ++i ) {
1115  (~A)(i,element->index()) -= x[i] * element->value();
1116  }
1117  }
1118  }
1119  }
1121  //**********************************************************************************************
1122 
1123  //**Vectorized subtraction assignment to column-major dense matrices****************************
1137  template< typename MT // Type of the left-hand side target matrix
1138  , typename VT3 // Type of the left-hand side vector operand
1139  , typename VT4 > // Type of the right-hand side vector operand
1141  selectSubAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1142  {
1144 
1145  constexpr bool remainder( !IsPadded<MT>::value || !IsPadded<VT3>::value );
1146 
1147  const size_t M( (~A).rows() );
1148 
1149  const size_t ipos( remainder ? ( M & size_t(-SIMDSIZE) ) : M );
1150  BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % SIMDSIZE ) ) == ipos, "Invalid end calculation" );
1151 
1152  const ConstIterator begin( y.begin() );
1153  const ConstIterator end ( y.end() );
1154 
1155  for( ConstIterator element=begin; element!=end; ++element )
1156  {
1157  if( isDefault( element->value() ) ) continue;
1158 
1159  const SIMDTrait_<ElementType> y1( set( element->value() ) );
1160 
1161  size_t i( 0UL );
1162 
1163  for( ; i<ipos; i+=SIMDSIZE ) {
1164  (~A).store( i, element->index(), (~A).load(i,element->index()) - x.load(i) * y1 );
1165  }
1166  for( ; remainder && i<M; ++i ) {
1167  (~A)(i,element->index()) -= x[i] * element->value();
1168  }
1169  }
1170  }
1172  //**********************************************************************************************
1173 
1174  //**Subtraction assignment to sparse matrices***************************************************
1175  // No special implementation for the subtraction assignment to sparse matrices.
1176  //**********************************************************************************************
1177 
1178  //**Schur product assignment to row-major dense matrices****************************************
1194  template< typename MT > // Type of the target dense matrix
1195  friend inline EnableIf_< UseAssign<MT> >
1196  schurAssign( DenseMatrix<MT,false>& lhs, const DVecSVecOuterExpr& rhs )
1197  {
1199 
1200  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1201  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1202 
1204 
1205  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1206  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
1207 
1208  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1209  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1210  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1211  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1212 
1213  const ConstIterator end( y.end() );
1214 
1215  for( size_t i=0UL; i<x.size(); ++i )
1216  {
1217  size_t j( 0UL );
1218 
1219  for( ConstIterator element=y.begin(); element!=end; ++element, ++j ) {
1220  for( ; j<element->index(); ++j )
1221  reset( (~lhs)(i,j) );
1222  (~lhs)(i,element->index()) *= x[i] * element->value();
1223  }
1224 
1225  for( ; j<y.size(); ++j ) {
1226  reset( (~lhs)(i,j) );
1227  }
1228  }
1229  }
1231  //**********************************************************************************************
1232 
1233  //**Schur product assignment to column-major dense matrices*************************************
1246  template< typename MT > // Type of the target dense matrix
1247  friend inline void schurAssign( DenseMatrix<MT,true>& lhs, const DVecSVecOuterExpr& rhs )
1248  {
1250 
1252 
1253  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1254  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1255 
1256  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1257  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
1258 
1259  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1260  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1261  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1262  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1263 
1264  DVecSVecOuterExpr::selectSchurAssignKernel( ~lhs, x, y );
1265  }
1267  //**********************************************************************************************
1268 
1269  //**Default Schur product assignment to column dense matrices***********************************
1283  template< typename MT // Type of the left-hand side target matrix
1284  , typename VT3 // Type of the left-hand side vector operand
1285  , typename VT4 > // Type of the right-hand side vector operand
1287  selectSchurAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1288  {
1290 
1291  const ConstIterator end( y.end() );
1292 
1293  size_t j( 0UL );
1294 
1295  for( ConstIterator element=y.begin(); element!=end; ++element )
1296  {
1297  if( isDefault( element->value() ) ) continue;
1298 
1299  for( ; j<element->index(); ++j ) {
1300  for( size_t i=0UL; i<x.size(); ++i )
1301  reset( (~A)(i,j) );
1302  }
1303 
1304  for( size_t i=0UL; i<x.size(); ++i ) {
1305  (~A)(i,element->index()) *= x[i] * element->value();
1306  }
1307 
1308  ++j;
1309  }
1310 
1311  for( ; j<y.size(); ++j ) {
1312  for( size_t i=0UL; i<x.size(); ++i )
1313  reset( (~A)(i,j) );
1314  }
1315  }
1317  //**********************************************************************************************
1318 
1319  //**Vectorized Schur product assignment to column-major dense matrices**************************
1333  template< typename MT // Type of the left-hand side target matrix
1334  , typename VT3 // Type of the left-hand side vector operand
1335  , typename VT4 > // Type of the right-hand side vector operand
1337  selectSchurAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1338  {
1340 
1341  constexpr bool remainder( !IsPadded<MT>::value || !IsPadded<VT3>::value );
1342 
1343  const size_t M( (~A).rows() );
1344  const size_t N( (~A).columns() );
1345 
1346  const size_t ipos( remainder ? ( M & size_t(-SIMDSIZE) ) : M );
1347  BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % SIMDSIZE ) ) == ipos, "Invalid end calculation" );
1348 
1349  const ConstIterator begin( y.begin() );
1350  const ConstIterator end ( y.end() );
1351 
1352  size_t j( 0UL );
1353 
1354  for( ConstIterator element=begin; element!=end; ++element )
1355  {
1356  if( isDefault( element->value() ) ) continue;
1357 
1358  for( ; j<element->index(); ++j ) {
1359  for( size_t i=0UL; i<M; ++i )
1360  reset( (~A)(i,j) );
1361  }
1362 
1363  const SIMDTrait_<ElementType> y1( set( element->value() ) );
1364 
1365  size_t i( 0UL );
1366 
1367  for( ; i<ipos; i+=SIMDSIZE ) {
1368  (~A).store( i, element->index(), (~A).load(i,element->index()) * ( x.load(i) * y1 ) );
1369  }
1370  for( ; remainder && i<M; ++i ) {
1371  (~A)(i,element->index()) *= x[i] * element->value();
1372  }
1373 
1374  ++j;
1375  }
1376 
1377  for( ; j<N; ++j ) {
1378  for( size_t i=0UL; i<M; ++i )
1379  reset( (~A)(i,j) );
1380  }
1381  }
1383  //**********************************************************************************************
1384 
1385  //**Schur product assignment to sparse matrices*************************************************
1386  // No special implementation for the Schur product assignment to sparse matrices.
1387  //**********************************************************************************************
1388 
1389  //**Multiplication assignment to dense matrices*************************************************
1390  // No special implementation for the multiplication assignment to dense matrices.
1391  //**********************************************************************************************
1392 
1393  //**Multiplication assignment to sparse matrices************************************************
1394  // No special implementation for the multiplication assignment to sparse matrices.
1395  //**********************************************************************************************
1396 
1397  //**Compile time checks*************************************************************************
1405  //**********************************************************************************************
1406 };
1407 //*************************************************************************************************
1408 
1409 
1410 
1411 
1412 //=================================================================================================
1413 //
1414 // GLOBAL BINARY ARITHMETIC OPERATORS
1415 //
1416 //=================================================================================================
1417 
1418 //*************************************************************************************************
1447 template< typename VT1 // Type of the left-hand side dense vector
1448  , typename VT2 > // Type of the right-hand side sparse vector
1449 inline decltype(auto)
1450  operator*( const DenseVector<VT1,false>& lhs, const SparseVector<VT2,true>& rhs )
1451 {
1453 
1454  using ReturnType = const DVecSVecOuterExpr<VT1,VT2>;
1455  return ReturnType( ~lhs, ~rhs );
1456 }
1457 //*************************************************************************************************
1458 
1459 
1460 
1461 
1462 //=================================================================================================
1463 //
1464 // ROWS SPECIALIZATIONS
1465 //
1466 //=================================================================================================
1467 
1468 //*************************************************************************************************
1470 template< typename VT1, typename VT2 >
1471 struct Rows< DVecSVecOuterExpr<VT1,VT2> >
1472  : public Size<VT1>
1473 {};
1475 //*************************************************************************************************
1476 
1477 
1478 
1479 
1480 //=================================================================================================
1481 //
1482 // COLUMNS SPECIALIZATIONS
1483 //
1484 //=================================================================================================
1485 
1486 //*************************************************************************************************
1488 template< typename VT1, typename VT2 >
1489 struct Columns< DVecSVecOuterExpr<VT1,VT2> >
1490  : public Size<VT2>
1491 {};
1493 //*************************************************************************************************
1494 
1495 } // namespace blaze
1496 
1497 #endif
ConstIterator_< RemoveReference_< RightOperand > > IteratorType
Iterator type of the sparse vector expression.
Definition: DVecSVecOuterExpr.h:220
CompositeType_< VT2 > CT2
Composite type of the right-hand side sparse vector expression.
Definition: DVecSVecOuterExpr.h:112
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecSVecOuterExpr.h:535
Pointer difference type of the Blaze library.
Header file for auxiliary alias declarations.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:72
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:79
ResultType_< VT1 > RT1
Result type of the left-hand side dense vector expression.
Definition: DVecSVecOuterExpr.h:107
LeftElement v_
Element of the left-hand side dense vector expression.
Definition: DVecSVecOuterExpr.h:331
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:70
Header file for the Rows type trait.
Header file for the UNUSED_PARAMETER function template.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:356
Header file for basic type definitions.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DVecSVecOuterExpr.h:430
ElementType_< VT2 > ET2
Element type of the right-hand side sparse vector expression.
Definition: DVecSVecOuterExpr.h:114
#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: ColumnVector.h:61
Header file for the serial shim.
IfTrue_< useAssign, const ResultType, const DVecSVecOuterExpr &> CompositeType
Data type for composite expression templates.
Definition: DVecSVecOuterExpr.h:191
Expression object for dense vector-sparse vector outer products.The DVecSVecOuterExpr class represent...
Definition: DVecSVecOuterExpr.h:101
Header file for the IsSame and IsStrictlySame type traits.
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: DVecSVecOuterExpr.h:261
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:172
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:316
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DVecSVecOuterExpr.h:185
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:560
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DVecSVecOuterExpr.h:382
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:250
Header file for the Computation base class.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member constant is set to true, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to false, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:140
If_< IsExpression< VT2 >, const VT2, const VT2 &> RightOperand
Composite type of the right-hand side sparse vector expression.
Definition: DVecSVecOuterExpr.h:197
System settings for performance optimizations.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:78
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
Header file for the SparseMatrix base class.
Constraint on the transpose flag of vector types.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: DVecSVecOuterExpr.h:440
Constraint on the data type.
size_t index() const
Access to the current index of the sparse element.
Definition: DVecSVecOuterExpr.h:291
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DVecSVecOuterExpr.h:410
typename MultExprTrait< T1, T2 >::Type MultExprTrait_
Auxiliary alias declaration for the MultExprTrait class template.The MultExprTrait_ alias declaration...
Definition: MultExprTrait.h:112
Header file for the MultExprTrait class template.
IteratorType it_
Iterator over the elements of the right-hand side sparse vector expression.
Definition: DVecSVecOuterExpr.h:332
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
IteratorCategory iterator_category
The iterator category.
Definition: DVecSVecOuterExpr.h:229
Header file for the ValueIndexPair class.
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
DVecSVecOuterExpr(const VT1 &lhs, const VT2 &rhs) noexcept
Constructor for the DVecSVecOuterExpr class.
Definition: DVecSVecOuterExpr.h:353
Iterator over the elements of the dense vector-sparse vector outer product expression.
Definition: DVecSVecOuterExpr.h:209
ConstIterator lowerBound(size_t i, size_t j) const
Returns an iterator to the first index not less then the given index.
Definition: DVecSVecOuterExpr.h:477
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecSVecOuterExpr.h:523
#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:104
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the Columns type trait.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecSVecOuterExpr.h:313
If_< IsExpression< VT1 >, const VT1, const VT1 &> LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecSVecOuterExpr.h:194
ResultType_< VT2 > RT2
Result type of the right-hand side sparse vector expression.
Definition: DVecSVecOuterExpr.h:108
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3087
CompositeType_< VT1 > CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecSVecOuterExpr.h:111
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Header file for all SIMD functionality.
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional vector type...
Definition: SparseVector.h:61
Constraint on the data type.
If_< IsComputation< VT2 >, const RT2, CT2 > RT
Type for the assignment of the right-hand side dense vector operand.
Definition: DVecSVecOuterExpr.h:203
Header file for the exception macros of the math module.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecSVecOuterExpr.h:302
Constraint on the data type.
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DVecSVecOuterExpr.h:188
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Header file for the VecTVecMultExpr base class.
Header file for the EnableIf class template.
ReturnType value() const
Access to the current value of the sparse element.
Definition: DVecSVecOuterExpr.h:281
ElementType_< VT1 > ET1
Element type of the left-hand side dense vector expression.
Definition: DVecSVecOuterExpr.h:113
Header file for the IsNumeric type trait.
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse vector operand.
Definition: DVecSVecOuterExpr.h:511
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: DVecSVecOuterExpr.h:464
#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:79
Header file for the HasSIMDMult type trait.
Header file for run time assertion macros.
ET1 LeftElement
Element type of the dense vector expression.
Definition: DVecSVecOuterExpr.h:217
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: DVecSVecOuterExpr.h:490
MultExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: DVecSVecOuterExpr.h:127
Header file for the reset shim.
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
Header file for the isDefault shim.
Constraint on the data type.
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: DVecSVecOuterExpr.h:324
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:819
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
ReturnType_< VT1 > RN1
Return type of the left-hand side dense vector expression.
Definition: DVecSVecOuterExpr.h:109
Constraint on the data type.
Header file for the RemoveReference type trait.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
Base class for all outer product expression templates.The VecTVecMultExpr class serves as a tag for a...
Definition: VecTVecMultExpr.h:67
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:263
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: DVecSVecOuterExpr.h:222
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3082
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
#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:61
LeftOperand lhs_
Left-hand side dense vector of the multiplication expression.
Definition: DVecSVecOuterExpr.h:542
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:73
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DVecSVecOuterExpr.h:366
RightOperand rhs_
Right-hand side sparse vector of the multiplication expression.
Definition: DVecSVecOuterExpr.h:543
Header file for the IsComputation type trait class.
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
ConstIterator(LeftElement v, IteratorType it)
Constructor for the ConstIterator class.
Definition: DVecSVecOuterExpr.h:239
ReturnType_< VT2 > RN2
Return type of the right-hand side sparse vector expression.
Definition: DVecSVecOuterExpr.h:110
Compile time evaluation of the size of a vector.The Size type trait evaluates the size of the given v...
Definition: Size.h:74
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DVecSVecOuterExpr.h:399
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
If_< IsComputation< VT1 >, const RT1, CT1 > LT
Type for the assignment of the left-hand side dense vector operand.
Definition: DVecSVecOuterExpr.h:200
Compile time evaluation of the number of columns of a matrix.The Columns type trait evaluates the num...
Definition: Columns.h:75
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecSVecOuterExpr.h:250
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecSVecOuterExpr.h:501
#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: RowVector.h:61
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:75
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:600
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: DVecSVecOuterExpr.h:451
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DVecSVecOuterExpr.h:420
Header file for the Size type trait.
#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
Constraint on the transpose flag of vector types.
Header file for the IsExpression type trait class.
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecSVecOuterExpr.h:184
Header file for the function trace functionality.
const ConstIterator * operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: DVecSVecOuterExpr.h:271
MultTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: DVecSVecOuterExpr.h:182
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DVecSVecOuterExpr.h:183