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>
71 #include <blaze/util/Assert.h>
72 #include <blaze/util/EnableIf.h>
74 #include <blaze/util/mpl/If.h>
75 #include <blaze/util/Types.h>
79 #include <blaze/util/Unused.h>
80 
81 
82 namespace blaze {
83 
84 //=================================================================================================
85 //
86 // CLASS DVECSVECOUTEREXPR
87 //
88 //=================================================================================================
89 
90 //*************************************************************************************************
97 template< typename VT1 // Type of the left-hand side dense vector
98  , typename VT2 > // Type of the right-hand side sparse vector
100  : public VecTVecMultExpr< SparseMatrix< DVecSVecOuterExpr<VT1,VT2>, false > >
101  , private Computation
102 {
103  private:
104  //**Type definitions****************************************************************************
113  //**********************************************************************************************
114 
115  //**Return type evaluation**********************************************************************
117 
122  enum : bool { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
123 
126  //**********************************************************************************************
127 
128  //**Evaluation strategy*************************************************************************
130 
137  enum : bool { useAssign = ( IsComputation<VT1>::value || !IsNumeric<ET1>::value ||
139 
141  template< typename MT >
143  struct UseAssign {
144  enum : bool { value = useAssign };
145  };
147  //**********************************************************************************************
148 
149  //**********************************************************************************************
151 
154  template< typename T1, typename T2, typename T3 >
155  struct UseVectorizedKernel {
156  enum : bool { value = useOptimizedKernels &&
157  T1::simdEnabled && T2::simdEnabled &&
159  IsSame< ElementType_<T1>, ElementType_<T3> >::value &&
161  };
163  //**********************************************************************************************
164 
165  //**********************************************************************************************
167 
170  template< typename T1, typename T2, typename T3 >
171  struct UseDefaultKernel {
172  enum : bool { value = !UseVectorizedKernel<T1,T2,T3>::value };
173  };
175  //**********************************************************************************************
176 
177  public:
178  //**Type definitions****************************************************************************
184 
187 
190 
192  using LeftOperand = If_< IsExpression<VT1>, const VT1, const VT1& >;
193 
195  using RightOperand = If_< IsExpression<VT2>, const VT2, const VT2& >;
196 
198  using LT = If_< IsComputation<VT1>, const RT1, CT1 >;
199 
201  using RT = If_< IsComputation<VT2>, const RT2, CT2 >;
202  //**********************************************************************************************
203 
204  //**ConstIterator class definition**************************************************************
208  {
209  public:
210  //**Type definitions*************************************************************************
213 
215  using LeftElement = ET1;
216 
219 
220  using IteratorCategory = std::forward_iterator_tag;
221  using ValueType = Element;
225 
226  // STL iterator requirements
232  //*******************************************************************************************
233 
234  //**Constructor******************************************************************************
238  : v_ ( v ) // Element of the left-hand side dense vector expression.
239  , it_( it ) // Iterator over the elements of the right-hand side sparse vector expression
240  {}
241  //*******************************************************************************************
242 
243  //**Prefix increment operator****************************************************************
249  ++it_;
250  return *this;
251  }
252  //*******************************************************************************************
253 
254  //**Element access operator******************************************************************
259  inline const Element operator*() const {
260  return Element( v_ * it_->value(), it_->index() );
261  }
262  //*******************************************************************************************
263 
264  //**Element access operator******************************************************************
269  inline const ConstIterator* operator->() const {
270  return this;
271  }
272  //*******************************************************************************************
273 
274  //**Value function***************************************************************************
279  inline ReturnType value() const {
280  return v_ * it_->value();
281  }
282  //*******************************************************************************************
283 
284  //**Index function***************************************************************************
289  inline size_t index() const {
290  return it_->index();
291  }
292  //*******************************************************************************************
293 
294  //**Equality operator************************************************************************
300  inline bool operator==( const ConstIterator& rhs ) const {
301  return it_ == rhs.it_;
302  }
303  //*******************************************************************************************
304 
305  //**Inequality operator**********************************************************************
311  inline bool operator!=( const ConstIterator& rhs ) const {
312  return it_ != rhs.it_;
313  }
314  //*******************************************************************************************
315 
316  //**Subtraction operator*********************************************************************
322  inline DifferenceType operator-( const ConstIterator& rhs ) const {
323  return it_ - rhs.it_;
324  }
325  //*******************************************************************************************
326 
327  private:
328  //**Member variables*************************************************************************
331  //*******************************************************************************************
332  };
333  //**********************************************************************************************
334 
335  //**Compilation flags***************************************************************************
337  enum : bool { smpAssignable = false };
338  //**********************************************************************************************
339 
340  //**SIMD properties*****************************************************************************
342  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
343  //**********************************************************************************************
344 
345  //**Constructor*********************************************************************************
351  explicit inline DVecSVecOuterExpr( const VT1& lhs, const VT2& rhs ) noexcept
352  : lhs_( lhs ) // Left-hand side dense vector of the multiplication expression
353  , rhs_( rhs ) // Right-hand side sparse vector of the multiplication expression
354  {}
355  //**********************************************************************************************
356 
357  //**Access operator*****************************************************************************
364  inline ReturnType operator()( size_t i, size_t j ) const {
365  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
366  BLAZE_INTERNAL_ASSERT( j < rhs_.size(), "Invalid column access index" );
367 
368  return lhs_[i] * rhs_[j];
369  }
370  //**********************************************************************************************
371 
372  //**At function*********************************************************************************
380  inline ReturnType at( size_t i, size_t j ) const {
381  if( i >= lhs_.size() ) {
382  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
383  }
384  if( j >= rhs_.size() ) {
385  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
386  }
387  return (*this)(i,j);
388  }
389  //**********************************************************************************************
390 
391  //**Begin function******************************************************************************
397  inline ConstIterator begin( size_t i ) const {
398  return ConstIterator( lhs_[i], rhs_.begin() );
399  }
400  //**********************************************************************************************
401 
402  //**End function********************************************************************************
408  inline ConstIterator end( size_t i ) const {
409  return ConstIterator( lhs_[i], rhs_.end() );
410  }
411  //**********************************************************************************************
412 
413  //**Rows function*******************************************************************************
418  inline size_t rows() const noexcept {
419  return lhs_.size();
420  }
421  //**********************************************************************************************
422 
423  //**Columns function****************************************************************************
428  inline size_t columns() const noexcept {
429  return rhs_.size();
430  }
431  //**********************************************************************************************
432 
433  //**NonZeros function***************************************************************************
438  inline size_t nonZeros() const {
439  return lhs_.size() * rhs_.nonZeros();
440  }
441  //**********************************************************************************************
442 
443  //**NonZeros function***************************************************************************
449  inline size_t nonZeros( size_t i ) const {
450  UNUSED_PARAMETER( i );
451  return rhs_.nonZeros();
452  }
453  //**********************************************************************************************
454 
455  //**Find function*******************************************************************************
462  inline ConstIterator find( size_t i, size_t j ) const {
464  return ConstIterator( lhs_[i], rhs_.find( j ) );
465  }
466  //**********************************************************************************************
467 
468  //**LowerBound function*************************************************************************
475  inline ConstIterator lowerBound( size_t i, size_t j ) const {
477  return ConstIterator( lhs_[i], rhs_.lowerBound( j ) );
478  }
479  //**********************************************************************************************
480 
481  //**UpperBound function*************************************************************************
488  inline ConstIterator upperBound( size_t i, size_t j ) const {
490  return ConstIterator( lhs_[i], rhs_.upperBound( j ) );
491  }
492  //**********************************************************************************************
493 
494  //**Left operand access*************************************************************************
499  inline LeftOperand leftOperand() const noexcept {
500  return lhs_;
501  }
502  //**********************************************************************************************
503 
504  //**Right operand access************************************************************************
509  inline RightOperand rightOperand() const noexcept {
510  return rhs_;
511  }
512  //**********************************************************************************************
513 
514  //**********************************************************************************************
520  template< typename T >
521  inline bool canAlias( const T* alias ) const noexcept {
522  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
523  }
524  //**********************************************************************************************
525 
526  //**********************************************************************************************
532  template< typename T >
533  inline bool isAliased( const T* alias ) const noexcept {
534  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
535  }
536  //**********************************************************************************************
537 
538  private:
539  //**Member variables****************************************************************************
542  //**********************************************************************************************
543 
544  //**Assignment to row-major dense matrices******************************************************
559  template< typename MT > // Type of the target dense matrix
560  friend inline EnableIf_< UseAssign<MT> >
561  assign( DenseMatrix<MT,false>& lhs, const DVecSVecOuterExpr& rhs )
562  {
564 
565  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
566  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
567 
569 
570  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
571  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
572 
573  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
574  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
575  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
576  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
577 
578  const ConstIterator begin( y.begin() );
579  const ConstIterator end ( y.end() );
580 
581  for( size_t i=0UL; i<x.size(); ++i ) {
582  for( ConstIterator element=begin; element!=end; ++element ) {
583  (~lhs)(i,element->index()) = x[i] * element->value();
584  }
585  }
586  }
588  //**********************************************************************************************
589 
590  //**Assignment to column-major dense matrices***************************************************
603  template< typename MT > // Type of the target dense matrix
604  friend inline void assign( DenseMatrix<MT,true>& lhs, const DVecSVecOuterExpr& rhs )
605  {
607 
609 
610  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
611  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
612 
613  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
614  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
615 
616  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
617  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
618  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
619  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
620 
621  DVecSVecOuterExpr::selectAssignKernel( ~lhs, x, y );
622  }
624  //**********************************************************************************************
625 
626  //**Default assignment to column-major dense matrices*******************************************
640  template< typename MT // Type of the left-hand side target matrix
641  , typename VT3 // Type of the left-hand side vector operand
642  , typename VT4 > // Type of the right-hand side vector operand
644  selectAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
645  {
647 
648  const ConstIterator begin( y.begin() );
649  const ConstIterator end ( y.end() );
650 
651  for( ConstIterator element=begin; element!=end; ++element ) {
652  for( size_t i=0UL; i<x.size(); ++i ) {
653  (~A)(i,element->index()) = x[i] * element->value();
654  }
655  }
656  }
658  //**********************************************************************************************
659 
660  //**Vectorized assignment to column-major dense matrices****************************************
674  template< typename MT // Type of the left-hand side target matrix
675  , typename VT3 // Type of the left-hand side vector operand
676  , typename VT4 > // Type of the right-hand side vector operand
678  selectAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
679  {
681 
682  constexpr bool remainder( !IsPadded<MT>::value || !IsPadded<VT3>::value );
683 
684  const size_t M( (~A).rows() );
685 
686  const size_t ipos( remainder ? ( M & size_t(-SIMDSIZE) ) : M );
687  BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % SIMDSIZE ) ) == ipos, "Invalid end calculation" );
688 
689  const ConstIterator begin( y.begin() );
690  const ConstIterator end ( y.end() );
691 
692  for( ConstIterator element=begin; element!=end; ++element )
693  {
694  const SIMDTrait_<ElementType> y1( set( element->value() ) );
695 
696  size_t i( 0UL );
697 
698  for( ; i<ipos; i+=SIMDSIZE ) {
699  (~A).store( i, element->index(), x.load(i) * y1 );
700  }
701  for( ; remainder && i<M; ++i ) {
702  (~A)(i,element->index()) = x[i] * element->value();
703  }
704  }
705  }
707  //**********************************************************************************************
708 
709  //**Assignment to row-major sparse matrices*****************************************************
724  template< typename MT > // Type of the target sparse matrix
725  friend inline EnableIf_< UseAssign<MT> >
726  assign( SparseMatrix<MT,false>& lhs, const DVecSVecOuterExpr& rhs )
727  {
729 
730  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
731  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns() , "Invalid number of columns" );
732  BLAZE_INTERNAL_ASSERT( (~lhs).capacity() >= rhs.nonZeros(), "Insufficient capacity" );
733 
735 
736  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
737  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
738 
739  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
740  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
741  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
742  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
743 
744  // Final memory allocation (based on the evaluated operands)
745  (~lhs).reserve( x.size() * y.nonZeros() );
746 
747  // Performing the outer product
748  const ConstIterator begin( y.begin() );
749  const ConstIterator end ( y.end() );
750 
751  if( begin == end )
752  return;
753 
754  for( size_t i=0UL; i<x.size(); ++i ) {
755  if( !isDefault( x[i] ) ) {
756  for( ConstIterator element=begin; element!=end; ++element ) {
757  (~lhs).append( i, element->index(), x[i] * element->value() );
758  }
759  }
760  (~lhs).finalize( i );
761  }
762  }
764  //**********************************************************************************************
765 
766  //**Assignment to column-major sparse matrices*****************************************************
779  template< typename MT > // Type of the target sparse matrix
780  friend inline void assign( SparseMatrix<MT,true>& lhs, const DVecSVecOuterExpr& rhs )
781  {
783 
785 
786  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
787  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns() , "Invalid number of columns" );
788 
790 
791  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
792  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
793 
794  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
795  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
796  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
797  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
798 
799  const ConstIterator begin( y.begin() );
800  const ConstIterator end ( y.end() );
801 
802  if( begin == end )
803  return;
804 
805  (~lhs).reserve( begin->index(), rhs.nonZeros() );
806 
807  size_t index( 0UL );
808 
809  for( ConstIterator element=begin; element!=end; ++element ) {
810  if( !isDefault( element->value() ) ) {
811  for( ; index < element->index(); ++index ) {
812  (~lhs).finalize( index );
813  }
814  for( size_t i=0UL; i<x.size(); ++i ) {
815  (~lhs).append( i, element->index(), x[i] * element->value() );
816  }
817  (~lhs).finalize( index++ );
818  }
819  }
820 
821  for( ; index < y.size(); ++index ) {
822  (~lhs).finalize( index );
823  }
824  }
826  //**********************************************************************************************
827 
828  //**Addition assignment to row-major dense matrices*********************************************
844  template< typename MT > // Type of the target dense matrix
845  friend inline EnableIf_< UseAssign<MT> >
846  addAssign( DenseMatrix<MT,false>& lhs, const DVecSVecOuterExpr& rhs )
847  {
849 
850  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
851  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
852 
854 
855  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
856  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
857 
858  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
859  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
860  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
861  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
862 
863  const ConstIterator begin( y.begin() );
864  const ConstIterator end ( y.end() );
865 
866  for( size_t i=0UL; i<x.size(); ++i ) {
867  if( !isDefault( x[i] ) ) {
868  for( ConstIterator element=begin; element!=end; ++element ) {
869  (~lhs)(i,element->index()) += x[i] * element->value();
870  }
871  }
872  }
873  }
875  //**********************************************************************************************
876 
877  //**Addition assignment to column-major dense matrices******************************************
890  template< typename MT > // Type of the target dense matrix
891  friend inline void addAssign( DenseMatrix<MT,true>& lhs, const DVecSVecOuterExpr& rhs )
892  {
894 
896 
897  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
898  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
899 
900  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
901  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
902 
903  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
904  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
905  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
906  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
907 
908  DVecSVecOuterExpr::selectAddAssignKernel( ~lhs, x, y );
909  }
911  //**********************************************************************************************
912 
913  //**Default addition assignment to column dense matrices****************************************
927  template< typename MT // Type of the left-hand side target matrix
928  , typename VT3 // Type of the left-hand side vector operand
929  , typename VT4 > // Type of the right-hand side vector operand
931  selectAddAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
932  {
934 
935  const ConstIterator begin( y.begin() );
936  const ConstIterator end ( y.end() );
937 
938  for( ConstIterator element=begin; element!=end; ++element ) {
939  if( !isDefault( element->value() ) ) {
940  for( size_t i=0UL; i<x.size(); ++i ) {
941  (~A)(i,element->index()) += x[i] * element->value();
942  }
943  }
944  }
945  }
947  //**********************************************************************************************
948 
949  //**Vectorized addition assignment to column-major dense matrices*******************************
963  template< typename MT // Type of the left-hand side target matrix
964  , typename VT3 // Type of the left-hand side vector operand
965  , typename VT4 > // Type of the right-hand side vector operand
967  selectAddAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
968  {
970 
971  constexpr bool remainder( !IsPadded<MT>::value || !IsPadded<VT3>::value );
972 
973  const size_t M( (~A).rows() );
974 
975  const size_t ipos( remainder ? ( M & size_t(-SIMDSIZE) ) : M );
976  BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % SIMDSIZE ) ) == ipos, "Invalid end calculation" );
977 
978  const ConstIterator begin( y.begin() );
979  const ConstIterator end ( y.end() );
980 
981  for( ConstIterator element=begin; element!=end; ++element )
982  {
983  if( isDefault( element->value() ) ) continue;
984 
985  const SIMDTrait_<ElementType> y1( set( element->value() ) );
986 
987  size_t i( 0UL );
988 
989  for( ; i<ipos; i+=SIMDSIZE ) {
990  (~A).store( i, element->index(), (~A).load(i,element->index()) + x.load(i) * y1 );
991  }
992  for( ; remainder && i<M; ++i ) {
993  (~A)(i,element->index()) += x[i] * element->value();
994  }
995  }
996  }
998  //**********************************************************************************************
999 
1000  //**Addition assignment to sparse matrices******************************************************
1001  // No special implementation for the addition assignment to sparse matrices.
1002  //**********************************************************************************************
1003 
1004  //**Subtraction assignment to row-major dense matrices******************************************
1020  template< typename MT > // Type of the target dense matrix
1021  friend inline EnableIf_< UseAssign<MT> >
1022  subAssign( DenseMatrix<MT,false>& lhs, const DVecSVecOuterExpr& rhs )
1023  {
1025 
1026  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1027  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1028 
1030 
1031  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1032  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
1033 
1034  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1035  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1036  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1037  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1038 
1039  const ConstIterator begin( y.begin() );
1040  const ConstIterator end ( y.end() );
1041 
1042  for( size_t i=0UL; i<x.size(); ++i ) {
1043  if( !isDefault( x[i] ) ) {
1044  for( ConstIterator element=begin; element!=end; ++element ) {
1045  (~lhs)(i,element->index()) -= x[i] * element->value();
1046  }
1047  }
1048  }
1049  }
1051  //**********************************************************************************************
1052 
1053  //**Subtraction assignment to column-major dense matrices***************************************
1066  template< typename MT > // Type of the target dense matrix
1067  friend inline void subAssign( DenseMatrix<MT,true>& lhs, const DVecSVecOuterExpr& rhs )
1068  {
1070 
1072 
1073  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1074  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1075 
1076  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1077  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
1078 
1079  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1080  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1081  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1082  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1083 
1084  DVecSVecOuterExpr::selectSubAssignKernel( ~lhs, x, y );
1085  }
1087  //**********************************************************************************************
1088 
1089  //**Default subtraction assignment to column dense matrices*************************************
1103  template< typename MT // Type of the left-hand side target matrix
1104  , typename VT3 // Type of the left-hand side vector operand
1105  , typename VT4 > // Type of the right-hand side vector operand
1107  selectSubAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1108  {
1110 
1111  const ConstIterator begin( y.begin() );
1112  const ConstIterator end ( y.end() );
1113 
1114  for( ConstIterator element=begin; element!=end; ++element ) {
1115  if( !isDefault( element->value() ) ) {
1116  for( size_t i=0UL; i<x.size(); ++i ) {
1117  (~A)(i,element->index()) -= x[i] * element->value();
1118  }
1119  }
1120  }
1121  }
1123  //**********************************************************************************************
1124 
1125  //**Vectorized subtraction assignment to column-major dense matrices****************************
1139  template< typename MT // Type of the left-hand side target matrix
1140  , typename VT3 // Type of the left-hand side vector operand
1141  , typename VT4 > // Type of the right-hand side vector operand
1143  selectSubAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1144  {
1146 
1147  constexpr bool remainder( !IsPadded<MT>::value || !IsPadded<VT3>::value );
1148 
1149  const size_t M( (~A).rows() );
1150 
1151  const size_t ipos( remainder ? ( M & size_t(-SIMDSIZE) ) : M );
1152  BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % SIMDSIZE ) ) == ipos, "Invalid end calculation" );
1153 
1154  const ConstIterator begin( y.begin() );
1155  const ConstIterator end ( y.end() );
1156 
1157  for( ConstIterator element=begin; element!=end; ++element )
1158  {
1159  if( isDefault( element->value() ) ) continue;
1160 
1161  const SIMDTrait_<ElementType> y1( set( element->value() ) );
1162 
1163  size_t i( 0UL );
1164 
1165  for( ; i<ipos; i+=SIMDSIZE ) {
1166  (~A).store( i, element->index(), (~A).load(i,element->index()) - x.load(i) * y1 );
1167  }
1168  for( ; remainder && i<M; ++i ) {
1169  (~A)(i,element->index()) -= x[i] * element->value();
1170  }
1171  }
1172  }
1174  //**********************************************************************************************
1175 
1176  //**Subtraction assignment to sparse matrices***************************************************
1177  // No special implementation for the subtraction assignment to sparse matrices.
1178  //**********************************************************************************************
1179 
1180  //**Schur product assignment to row-major dense matrices****************************************
1196  template< typename MT > // Type of the target dense matrix
1197  friend inline EnableIf_< UseAssign<MT> >
1198  schurAssign( DenseMatrix<MT,false>& lhs, const DVecSVecOuterExpr& rhs )
1199  {
1201 
1202  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1203  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1204 
1206 
1207  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1208  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
1209 
1210  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1211  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1212  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1213  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1214 
1215  const ConstIterator end( y.end() );
1216 
1217  for( size_t i=0UL; i<x.size(); ++i )
1218  {
1219  size_t j( 0UL );
1220 
1221  for( ConstIterator element=y.begin(); element!=end; ++element, ++j ) {
1222  for( ; j<element->index(); ++j )
1223  reset( (~lhs)(i,j) );
1224  (~lhs)(i,element->index()) *= x[i] * element->value();
1225  }
1226 
1227  for( ; j<y.size(); ++j ) {
1228  reset( (~lhs)(i,j) );
1229  }
1230  }
1231  }
1233  //**********************************************************************************************
1234 
1235  //**Schur product assignment to column-major dense matrices*************************************
1248  template< typename MT > // Type of the target dense matrix
1249  friend inline void schurAssign( DenseMatrix<MT,true>& lhs, const DVecSVecOuterExpr& rhs )
1250  {
1252 
1254 
1255  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1256  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1257 
1258  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1259  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
1260 
1261  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1262  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1263  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1264  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1265 
1266  DVecSVecOuterExpr::selectSchurAssignKernel( ~lhs, x, y );
1267  }
1269  //**********************************************************************************************
1270 
1271  //**Default Schur product assignment to column dense matrices***********************************
1285  template< typename MT // Type of the left-hand side target matrix
1286  , typename VT3 // Type of the left-hand side vector operand
1287  , typename VT4 > // Type of the right-hand side vector operand
1289  selectSchurAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1290  {
1292 
1293  const ConstIterator end( y.end() );
1294 
1295  size_t j( 0UL );
1296 
1297  for( ConstIterator element=y.begin(); element!=end; ++element )
1298  {
1299  if( isDefault( element->value() ) ) continue;
1300 
1301  for( ; j<element->index(); ++j ) {
1302  for( size_t i=0UL; i<x.size(); ++i )
1303  reset( (~A)(i,j) );
1304  }
1305 
1306  for( size_t i=0UL; i<x.size(); ++i ) {
1307  (~A)(i,element->index()) *= x[i] * element->value();
1308  }
1309 
1310  ++j;
1311  }
1312 
1313  for( ; j<y.size(); ++j ) {
1314  for( size_t i=0UL; i<x.size(); ++i )
1315  reset( (~A)(i,j) );
1316  }
1317  }
1319  //**********************************************************************************************
1320 
1321  //**Vectorized Schur product assignment to column-major dense matrices**************************
1335  template< typename MT // Type of the left-hand side target matrix
1336  , typename VT3 // Type of the left-hand side vector operand
1337  , typename VT4 > // Type of the right-hand side vector operand
1339  selectSchurAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1340  {
1342 
1343  constexpr bool remainder( !IsPadded<MT>::value || !IsPadded<VT3>::value );
1344 
1345  const size_t M( (~A).rows() );
1346  const size_t N( (~A).columns() );
1347 
1348  const size_t ipos( remainder ? ( M & size_t(-SIMDSIZE) ) : M );
1349  BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % SIMDSIZE ) ) == ipos, "Invalid end calculation" );
1350 
1351  const ConstIterator begin( y.begin() );
1352  const ConstIterator end ( y.end() );
1353 
1354  size_t j( 0UL );
1355 
1356  for( ConstIterator element=begin; element!=end; ++element )
1357  {
1358  if( isDefault( element->value() ) ) continue;
1359 
1360  for( ; j<element->index(); ++j ) {
1361  for( size_t i=0UL; i<M; ++i )
1362  reset( (~A)(i,j) );
1363  }
1364 
1365  const SIMDTrait_<ElementType> y1( set( element->value() ) );
1366 
1367  size_t i( 0UL );
1368 
1369  for( ; i<ipos; i+=SIMDSIZE ) {
1370  (~A).store( i, element->index(), (~A).load(i,element->index()) * ( x.load(i) * y1 ) );
1371  }
1372  for( ; remainder && i<M; ++i ) {
1373  (~A)(i,element->index()) *= x[i] * element->value();
1374  }
1375 
1376  ++j;
1377  }
1378 
1379  for( ; j<N; ++j ) {
1380  for( size_t i=0UL; i<M; ++i )
1381  reset( (~A)(i,j) );
1382  }
1383  }
1385  //**********************************************************************************************
1386 
1387  //**Schur product assignment to sparse matrices*************************************************
1388  // No special implementation for the Schur product assignment to sparse matrices.
1389  //**********************************************************************************************
1390 
1391  //**Multiplication assignment to dense matrices*************************************************
1392  // No special implementation for the multiplication assignment to dense matrices.
1393  //**********************************************************************************************
1394 
1395  //**Multiplication assignment to sparse matrices************************************************
1396  // No special implementation for the multiplication assignment to sparse matrices.
1397  //**********************************************************************************************
1398 
1399  //**Compile time checks*************************************************************************
1407  //**********************************************************************************************
1408 };
1409 //*************************************************************************************************
1410 
1411 
1412 
1413 
1414 //=================================================================================================
1415 //
1416 // GLOBAL BINARY ARITHMETIC OPERATORS
1417 //
1418 //=================================================================================================
1419 
1420 //*************************************************************************************************
1449 template< typename VT1 // Type of the left-hand side dense vector
1450  , typename VT2 > // Type of the right-hand side sparse vector
1451 inline decltype(auto)
1452  operator*( const DenseVector<VT1,false>& lhs, const SparseVector<VT2,true>& rhs )
1453 {
1455 
1456  using ReturnType = const DVecSVecOuterExpr<VT1,VT2>;
1457  return ReturnType( ~lhs, ~rhs );
1458 }
1459 //*************************************************************************************************
1460 
1461 
1462 
1463 
1464 //=================================================================================================
1465 //
1466 // SIZE SPECIALIZATIONS
1467 //
1468 //=================================================================================================
1469 
1470 //*************************************************************************************************
1472 template< typename VT1, typename VT2 >
1473 struct Size< DVecSVecOuterExpr<VT1,VT2>, 0UL >
1474  : public Size<VT1,0UL>
1475 {};
1476 
1477 template< typename VT1, typename VT2 >
1478 struct Size< DVecSVecOuterExpr<VT1,VT2>, 1UL >
1479  : public Size<VT2,0UL>
1480 {};
1482 //*************************************************************************************************
1483 
1484 } // namespace blaze
1485 
1486 #endif
ConstIterator_< RemoveReference_< RightOperand > > IteratorType
Iterator type of the sparse vector expression.
Definition: DVecSVecOuterExpr.h:218
CompositeType_< VT2 > CT2
Composite type of the right-hand side sparse vector expression.
Definition: DVecSVecOuterExpr.h:110
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecSVecOuterExpr.h:533
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:71
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:105
LeftElement v_
Element of the left-hand side dense vector expression.
Definition: DVecSVecOuterExpr.h:329
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:69
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:522
Header file for basic type definitions.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DVecSVecOuterExpr.h:428
ElementType_< VT2 > ET2
Element type of the right-hand side sparse vector expression.
Definition: DVecSVecOuterExpr.h:112
#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:189
Expression object for dense vector-sparse vector outer products.The DVecSVecOuterExpr class represent...
Definition: DVecSVecOuterExpr.h:99
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:259
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:183
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DVecSVecOuterExpr.h:380
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:291
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:195
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:80
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:438
Constraint on the data type.
size_t index() const
Access to the current index of the sparse element.
Definition: DVecSVecOuterExpr.h:289
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DVecSVecOuterExpr.h:408
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:330
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:227
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:58
Header file for the If class template.
DVecSVecOuterExpr(const VT1 &lhs, const VT2 &rhs) noexcept
Constructor for the DVecSVecOuterExpr class.
Definition: DVecSVecOuterExpr.h:351
Iterator over the elements of the dense vector-sparse vector outer product expression.
Definition: DVecSVecOuterExpr.h:207
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:475
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecSVecOuterExpr.h:521
#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
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecSVecOuterExpr.h:311
If_< IsExpression< VT1 >, const VT1, const VT1 &> LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecSVecOuterExpr.h:192
ResultType_< VT2 > RT2
Result type of the right-hand side sparse vector expression.
Definition: DVecSVecOuterExpr.h:106
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
CompositeType_< VT1 > CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecSVecOuterExpr.h:109
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:76
#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:201
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:300
Constraint on the data type.
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DVecSVecOuterExpr.h:186
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:279
ElementType_< VT1 > ET1
Element type of the left-hand side dense vector expression.
Definition: DVecSVecOuterExpr.h:111
Header file for the IsNumeric type trait.
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse vector operand.
Definition: DVecSVecOuterExpr.h:509
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: DVecSVecOuterExpr.h:462
#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:215
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:488
MultExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: DVecSVecOuterExpr.h:125
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:322
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
#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:107
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:220
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
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:540
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:364
RightOperand rhs_
Right-hand side sparse vector of the multiplication expression.
Definition: DVecSVecOuterExpr.h:541
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:237
ReturnType_< VT2 > RN2
Return type of the right-hand side sparse vector expression.
Definition: DVecSVecOuterExpr.h:108
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DVecSVecOuterExpr.h:397
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:198
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecSVecOuterExpr.h:248
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecSVecOuterExpr.h:499
#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
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
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:449
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DVecSVecOuterExpr.h:418
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:182
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:269
MultTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: DVecSVecOuterExpr.h:180
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DVecSVecOuterExpr.h:181