DVecTSVecMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECTSVECMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECTSVECMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <blaze/math/Aliases.h>
53 #include <blaze/math/Exception.h>
60 #include <blaze/math/SIMD.h>
76 #include <blaze/util/Assert.h>
78 #include <blaze/util/EnableIf.h>
80 #include <blaze/util/mpl/If.h>
81 #include <blaze/util/Types.h>
85 #include <blaze/util/Unused.h>
86 
87 
88 namespace blaze {
89 
90 //=================================================================================================
91 //
92 // CLASS DVECTSVECMULTEXPR
93 //
94 //=================================================================================================
95 
96 //*************************************************************************************************
103 template< typename VT1 // Type of the left-hand side dense vector
104  , typename VT2 > // Type of the right-hand side sparse vector
105 class DVecTSVecMultExpr : public SparseMatrix< DVecTSVecMultExpr<VT1,VT2>, false >
106  , private VecTVecMultExpr
107  , private Computation
108 {
109  private:
110  //**Type definitions****************************************************************************
119  //**********************************************************************************************
120 
121  //**Return type evaluation**********************************************************************
123 
128  enum : bool { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
129 
132  //**********************************************************************************************
133 
134  //**Evaluation strategy*************************************************************************
136 
143  enum : bool { useAssign = ( IsComputation<VT1>::value || !IsNumeric<ET1>::value ||
145 
147  template< typename MT >
149  struct UseAssign {
150  enum : bool { value = useAssign };
151  };
153  //**********************************************************************************************
154 
155  //**********************************************************************************************
157 
160  template< typename T1, typename T2, typename T3 >
161  struct UseVectorizedKernel {
162  enum : bool { value = useOptimizedKernels &&
163  T1::simdEnabled && T2::simdEnabled &&
165  IsSame< ElementType_<T1>, ElementType_<T3> >::value &&
167  };
169  //**********************************************************************************************
170 
171  //**********************************************************************************************
173 
176  template< typename T1, typename T2, typename T3 >
177  struct UseDefaultKernel {
178  enum : bool { value = !UseVectorizedKernel<T1,T2,T3>::value };
179  };
181  //**********************************************************************************************
182 
183  public:
184  //**Type definitions****************************************************************************
190 
193 
196 
198  typedef If_< IsExpression<VT1>, const VT1, const VT1& > LeftOperand;
199 
201  typedef If_< IsExpression<VT2>, const VT2, const VT2& > RightOperand;
202 
204  typedef If_< IsComputation<VT1>, const RT1, CT1 > LT;
205 
207  typedef If_< IsComputation<VT2>, const RT2, CT2 > RT;
208  //**********************************************************************************************
209 
210  //**ConstIterator class definition**************************************************************
214  {
215  public:
216  //**Type definitions*************************************************************************
219 
221  typedef ET1 LeftElement;
222 
225 
226  typedef std::forward_iterator_tag IteratorCategory;
227  typedef Element ValueType;
228  typedef ValueType* PointerType;
229  typedef ValueType& ReferenceType;
231 
232  // STL iterator requirements
233  typedef IteratorCategory iterator_category;
234  typedef ValueType value_type;
235  typedef PointerType pointer;
236  typedef ReferenceType reference;
237  typedef DifferenceType difference_type;
238  //*******************************************************************************************
239 
240  //**Constructor******************************************************************************
243  inline ConstIterator( LeftElement v, IteratorType it )
244  : v_ ( v ) // Element of the left-hand side dense vector expression.
245  , it_( it ) // Iterator over the elements of the right-hand side sparse vector expression
246  {}
247  //*******************************************************************************************
248 
249  //**Prefix increment operator****************************************************************
255  ++it_;
256  return *this;
257  }
258  //*******************************************************************************************
259 
260  //**Element access operator******************************************************************
265  inline const Element operator*() const {
266  return Element( v_ * it_->value(), it_->index() );
267  }
268  //*******************************************************************************************
269 
270  //**Element access operator******************************************************************
275  inline const ConstIterator* operator->() const {
276  return this;
277  }
278  //*******************************************************************************************
279 
280  //**Value function***************************************************************************
285  inline ReturnType value() const {
286  return v_ * it_->value();
287  }
288  //*******************************************************************************************
289 
290  //**Index function***************************************************************************
295  inline size_t index() const {
296  return it_->index();
297  }
298  //*******************************************************************************************
299 
300  //**Equality operator************************************************************************
306  inline bool operator==( const ConstIterator& rhs ) const {
307  return it_ == rhs.it_;
308  }
309  //*******************************************************************************************
310 
311  //**Inequality operator**********************************************************************
317  inline bool operator!=( const ConstIterator& rhs ) const {
318  return it_ != rhs.it_;
319  }
320  //*******************************************************************************************
321 
322  //**Subtraction operator*********************************************************************
328  inline DifferenceType operator-( const ConstIterator& rhs ) const {
329  return it_ - rhs.it_;
330  }
331  //*******************************************************************************************
332 
333  private:
334  //**Member variables*************************************************************************
335  LeftElement v_;
336  IteratorType it_;
337  //*******************************************************************************************
338  };
339  //**********************************************************************************************
340 
341  //**Compilation flags***************************************************************************
343  enum : bool { smpAssignable = false };
344  //**********************************************************************************************
345 
346  //**SIMD properties*****************************************************************************
348  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
349  //**********************************************************************************************
350 
351  //**Constructor*********************************************************************************
357  explicit inline DVecTSVecMultExpr( const VT1& lhs, const VT2& rhs ) noexcept
358  : lhs_( lhs ) // Left-hand side dense vector of the multiplication expression
359  , rhs_( rhs ) // Right-hand side sparse vector of the multiplication expression
360  {}
361  //**********************************************************************************************
362 
363  //**Access operator*****************************************************************************
370  inline ReturnType operator()( size_t i, size_t j ) const {
371  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
372  BLAZE_INTERNAL_ASSERT( j < rhs_.size(), "Invalid column access index" );
373 
374  return lhs_[i] * rhs_[j];
375  }
376  //**********************************************************************************************
377 
378  //**At function*********************************************************************************
386  inline ReturnType at( size_t i, size_t j ) const {
387  if( i >= lhs_.size() ) {
388  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
389  }
390  if( j >= rhs_.size() ) {
391  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
392  }
393  return (*this)(i,j);
394  }
395  //**********************************************************************************************
396 
397  //**Begin function******************************************************************************
403  inline ConstIterator begin( size_t i ) const {
404  return ConstIterator( lhs_[i], rhs_.begin() );
405  }
406  //**********************************************************************************************
407 
408  //**End function********************************************************************************
414  inline ConstIterator end( size_t i ) const {
415  return ConstIterator( lhs_[i], rhs_.end() );
416  }
417  //**********************************************************************************************
418 
419  //**Rows function*******************************************************************************
424  inline size_t rows() const noexcept {
425  return lhs_.size();
426  }
427  //**********************************************************************************************
428 
429  //**Columns function****************************************************************************
434  inline size_t columns() const noexcept {
435  return rhs_.size();
436  }
437  //**********************************************************************************************
438 
439  //**NonZeros function***************************************************************************
444  inline size_t nonZeros() const {
445  return lhs_.size() * rhs_.nonZeros();
446  }
447  //**********************************************************************************************
448 
449  //**NonZeros function***************************************************************************
455  inline size_t nonZeros( size_t i ) const {
456  UNUSED_PARAMETER( i );
457  return rhs_.nonZeros();
458  }
459  //**********************************************************************************************
460 
461  //**Find function*******************************************************************************
468  inline ConstIterator find( size_t i, size_t j ) const {
470  return ConstIterator( lhs_[i], rhs_.find( j ) );
471  }
472  //**********************************************************************************************
473 
474  //**LowerBound function*************************************************************************
481  inline ConstIterator lowerBound( size_t i, size_t j ) const {
483  return ConstIterator( lhs_[i], rhs_.lowerBound( j ) );
484  }
485  //**********************************************************************************************
486 
487  //**UpperBound function*************************************************************************
494  inline ConstIterator upperBound( size_t i, size_t j ) const {
496  return ConstIterator( lhs_[i], rhs_.upperBound( j ) );
497  }
498  //**********************************************************************************************
499 
500  //**Left operand access*************************************************************************
505  inline LeftOperand leftOperand() const noexcept {
506  return lhs_;
507  }
508  //**********************************************************************************************
509 
510  //**Right operand access************************************************************************
515  inline RightOperand rightOperand() const noexcept {
516  return rhs_;
517  }
518  //**********************************************************************************************
519 
520  //**********************************************************************************************
526  template< typename T >
527  inline bool canAlias( const T* alias ) const noexcept {
528  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
529  }
530  //**********************************************************************************************
531 
532  //**********************************************************************************************
538  template< typename T >
539  inline bool isAliased( const T* alias ) const noexcept {
540  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
541  }
542  //**********************************************************************************************
543 
544  private:
545  //**Member variables****************************************************************************
546  LeftOperand lhs_;
547  RightOperand rhs_;
548  //**********************************************************************************************
549 
550  //**Assignment to row-major dense matrices******************************************************
565  template< typename MT > // Type of the target dense matrix
566  friend inline EnableIf_< UseAssign<MT> >
567  assign( DenseMatrix<MT,false>& lhs, const DVecTSVecMultExpr& rhs )
568  {
570 
571  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
572  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
573 
575 
576  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
577  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
578 
579  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
580  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
581  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
582  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
583 
584  const ConstIterator begin( y.begin() );
585  const ConstIterator end ( y.end() );
586 
587  for( size_t i=0UL; i<(~lhs).rows(); ++i ) {
588  for( ConstIterator element=begin; element!=end; ++element ) {
589  (~lhs)(i,element->index()) = x[i] * element->value();
590  }
591  }
592  }
594  //**********************************************************************************************
595 
596  //**Assignment to column-major dense matrices***************************************************
609  template< typename MT > // Type of the target dense matrix
610  friend inline void assign( DenseMatrix<MT,true>& lhs, const DVecTSVecMultExpr& rhs )
611  {
613 
615 
616  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
617  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
618 
619  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
620  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
621 
622  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
623  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
624  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
625  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
626 
627  DVecTSVecMultExpr::selectAssignKernel( ~lhs, x, y );
628  }
630  //**********************************************************************************************
631 
632  //**Default assignment to column-major dense matrices*******************************************
646  template< typename MT // Type of the left-hand side target matrix
647  , typename VT3 // Type of the left-hand side vector operand
648  , typename VT4 > // Type of the right-hand side vector operand
649  static inline EnableIf_< UseDefaultKernel<MT,VT3,VT4> >
650  selectAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
651  {
652  typedef ConstIterator_< RemoveReference_<RT> > ConstIterator;
653 
654  const ConstIterator begin( y.begin() );
655  const ConstIterator end ( y.end() );
656 
657  for( ConstIterator element=begin; element!=end; ++element ) {
658  for( size_t i=0UL; i<(~A).rows(); ++i ) {
659  (~A)(i,element->index()) = x[i] * element->value();
660  }
661  }
662  }
664  //**********************************************************************************************
665 
666  //**Vectorized assignment to column-major dense matrices****************************************
680  template< typename MT // Type of the left-hand side target matrix
681  , typename VT3 // Type of the left-hand side vector operand
682  , typename VT4 > // Type of the right-hand side vector operand
683  static inline EnableIf_< UseVectorizedKernel<MT,VT3,VT4> >
684  selectAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
685  {
686  typedef ConstIterator_< RemoveReference_<RT> > ConstIterator;
687 
688  const size_t M( (~A).rows() );
689 
690  const bool remainder( !IsPadded<MT>::value || !IsPadded<VT3>::value );
691 
692  const size_t ipos( remainder ? ( M & size_t(-SIMDSIZE) ) : M );
693  BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % SIMDSIZE ) ) == ipos, "Invalid end calculation" );
694 
695  const ConstIterator begin( y.begin() );
696  const ConstIterator end ( y.end() );
697 
698  for( ConstIterator element=begin; element!=end; ++element )
699  {
700  const SIMDTrait_<ElementType> y1( set( element->value() ) );
701 
702  size_t i( 0UL );
703 
704  for( ; i<ipos; i+=SIMDSIZE ) {
705  (~A).store( i, element->index(), x.load(i) * y1 );
706  }
707  for( ; remainder && i<M; ++i ) {
708  (~A)(i,element->index()) = x[i] * element->value();
709  }
710  }
711  }
713  //**********************************************************************************************
714 
715  //**Assignment to row-major sparse matrices*****************************************************
730  template< typename MT > // Type of the target sparse matrix
731  friend inline EnableIf_< UseAssign<MT> >
732  assign( SparseMatrix<MT,false>& lhs, const DVecTSVecMultExpr& rhs )
733  {
735 
736  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
737  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns() , "Invalid number of columns" );
738  BLAZE_INTERNAL_ASSERT( (~lhs).capacity() >= rhs.nonZeros(), "Insufficient capacity" );
739 
740  typedef ConstIterator_< RemoveReference_<RT> > ConstIterator;
741 
742  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
743  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
744 
745  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
746  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
747  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
748  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
749 
750  const ConstIterator begin( y.begin() );
751  const ConstIterator end ( y.end() );
752 
753  if( begin == end )
754  return;
755 
756  for( size_t i=0UL; i<x.size(); ++i ) {
757  if( !isDefault( x[i] ) ) {
758  for( ConstIterator element=begin; element!=end; ++element ) {
759  (~lhs).append( i, element->index(), x[i] * element->value() );
760  }
761  }
762  (~lhs).finalize( i );
763  }
764  }
766  //**********************************************************************************************
767 
768  //**Assignment to column-major sparse matrices*****************************************************
781  template< typename MT > // Type of the target sparse matrix
782  friend inline void assign( SparseMatrix<MT,true>& lhs, const DVecTSVecMultExpr& rhs )
783  {
785 
787 
788  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
789  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns() , "Invalid number of columns" );
790 
791  typedef ConstIterator_< RemoveReference_<RT> > ConstIterator;
792 
793  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
794  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
795 
796  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
797  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
798  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
799  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
800 
801  const ConstIterator begin( y.begin() );
802  const ConstIterator end ( y.end() );
803 
804  if( begin == end )
805  return;
806 
807  (~lhs).reserve( begin->index(), rhs.nonZeros() );
808 
809  size_t index( 0UL );
810 
811  for( ConstIterator element=begin; element!=end; ++element ) {
812  if( !isDefault( element->value() ) ) {
813  for( ; index < element->index(); ++index ) {
814  (~lhs).finalize( index );
815  }
816  for( size_t i=0UL; i<(~lhs).rows(); ++i ) {
817  (~lhs).append( i, element->index(), x[i] * element->value() );
818  }
819  (~lhs).finalize( index++ );
820  }
821  }
822 
823  for( ; index < y.size(); ++index ) {
824  (~lhs).finalize( index );
825  }
826  }
828  //**********************************************************************************************
829 
830  //**Addition assignment to row-major dense matrices*********************************************
846  template< typename MT > // Type of the target dense matrix
847  friend inline EnableIf_< UseAssign<MT> >
848  addAssign( DenseMatrix<MT,false>& lhs, const DVecTSVecMultExpr& rhs )
849  {
851 
852  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
853  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
854 
855  typedef ConstIterator_< RemoveReference_<RT> > ConstIterator;
856 
857  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
858  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
859 
860  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
861  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
862  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
863  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
864 
865  const ConstIterator begin( y.begin() );
866  const ConstIterator end ( y.end() );
867 
868  for( size_t i=0UL; i<(~lhs).rows(); ++i ) {
869  for( ConstIterator element=begin; element!=end; ++element ) {
870  (~lhs)(i,element->index()) += x[i] * element->value();
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 DVecTSVecMultExpr& 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  DVecTSVecMultExpr::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
930  static inline EnableIf_< UseDefaultKernel<MT,VT3,VT4> >
931  selectAddAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
932  {
933  typedef ConstIterator_< RemoveReference_<RT> > ConstIterator;
934 
935  const ConstIterator begin( y.begin() );
936  const ConstIterator end ( y.end() );
937 
938  for( ConstIterator element=begin; element!=end; ++element ) {
939  for( size_t i=0UL; i<(~A).rows(); ++i ) {
940  (~A)(i,element->index()) += x[i] * element->value();
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
964  static inline EnableIf_< UseVectorizedKernel<MT,VT3,VT4> >
965  selectAddAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
966  {
967  typedef ConstIterator_< RemoveReference_<RT> > ConstIterator;
968 
969  const size_t M( (~A).rows() );
970 
971  const bool remainder( !IsPadded<MT>::value || !IsPadded<VT3>::value );
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  const SIMDTrait_<ElementType> y1( set( element->value() ) );
982 
983  size_t i( 0UL );
984 
985  for( ; i<ipos; i+=SIMDSIZE ) {
986  (~A).store( i, element->index(), (~A).load(i,element->index()) + x.load(i) * y1 );
987  }
988  for( ; remainder && i<M; ++i ) {
989  (~A)(i,element->index()) += x[i] * element->value();
990  }
991  }
992  }
994  //**********************************************************************************************
995 
996  //**Addition assignment to sparse matrices******************************************************
997  // No special implementation for the addition assignment to sparse matrices.
998  //**********************************************************************************************
999 
1000  //**Subtraction assignment to row-major dense matrices******************************************
1016  template< typename MT > // Type of the target dense matrix
1017  friend inline EnableIf_< UseAssign<MT> >
1018  subAssign( DenseMatrix<MT,false>& lhs, const DVecTSVecMultExpr& rhs )
1019  {
1021 
1022  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1023  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1024 
1025  typedef ConstIterator_< RemoveReference_<RT> > ConstIterator;
1026 
1027  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1028  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
1029 
1030  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1031  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1032  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1033  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1034 
1035  const ConstIterator begin( y.begin() );
1036  const ConstIterator end ( y.end() );
1037 
1038  for( size_t i=0UL; i<(~lhs).rows(); ++i ) {
1039  for( ConstIterator element=begin; element!=end; ++element ) {
1040  (~lhs)(i,element->index()) -= x[i] * element->value();
1041  }
1042  }
1043  }
1045  //**********************************************************************************************
1046 
1047  //**Subtraction assignment to column-major dense matrices***************************************
1060  template< typename MT > // Type of the target dense matrix
1061  friend inline void subAssign( DenseMatrix<MT,true>& lhs, const DVecTSVecMultExpr& rhs )
1062  {
1064 
1066 
1067  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1068  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1069 
1070  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
1071  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
1072 
1073  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1074  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1075  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1076  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1077 
1078  DVecTSVecMultExpr::selectSubAssignKernel( ~lhs, x, y );
1079  }
1081  //**********************************************************************************************
1082 
1083  //**Default subtraction assignment to column dense matrices*************************************
1097  template< typename MT // Type of the left-hand side target matrix
1098  , typename VT3 // Type of the left-hand side vector operand
1099  , typename VT4 > // Type of the right-hand side vector operand
1100  static inline EnableIf_< UseDefaultKernel<MT,VT3,VT4> >
1101  selectSubAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1102  {
1103  typedef ConstIterator_< RemoveReference_<RT> > ConstIterator;
1104 
1105  const ConstIterator begin( y.begin() );
1106  const ConstIterator end ( y.end() );
1107 
1108  for( ConstIterator element=begin; element!=end; ++element ) {
1109  for( size_t i=0UL; i<(~A).rows(); ++i ) {
1110  (~A)(i,element->index()) -= x[i] * element->value();
1111  }
1112  }
1113  }
1115  //**********************************************************************************************
1116 
1117  //**Vectorized subtraction assignment to column-major dense matrices****************************
1131  template< typename MT // Type of the left-hand side target matrix
1132  , typename VT3 // Type of the left-hand side vector operand
1133  , typename VT4 > // Type of the right-hand side vector operand
1134  static inline EnableIf_< UseVectorizedKernel<MT,VT3,VT4> >
1135  selectSubAssignKernel( DenseMatrix<MT,true>& A, const VT3& x, const VT4& y )
1136  {
1137  typedef ConstIterator_< RemoveReference_<RT> > ConstIterator;
1138 
1139  const size_t M( (~A).rows() );
1140 
1141  const bool remainder( !IsPadded<MT>::value || !IsPadded<VT3>::value );
1142 
1143  const size_t ipos( remainder ? ( M & size_t(-SIMDSIZE) ) : M );
1144  BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % SIMDSIZE ) ) == ipos, "Invalid end calculation" );
1145 
1146  const ConstIterator begin( y.begin() );
1147  const ConstIterator end ( y.end() );
1148 
1149  for( ConstIterator element=begin; element!=end; ++element )
1150  {
1151  const SIMDTrait_<ElementType> y1( set( element->value() ) );
1152 
1153  size_t i( 0UL );
1154 
1155  for( ; i<ipos; i+=SIMDSIZE ) {
1156  (~A).store( i, element->index(), (~A).load(i,element->index()) - x.load(i) * y1 );
1157  }
1158  for( ; remainder && i<M; ++i ) {
1159  (~A)(i,element->index()) -= x[i] * element->value();
1160  }
1161  }
1162  }
1164  //**********************************************************************************************
1165 
1166  //**Subtraction assignment to sparse matrices***************************************************
1167  // No special implementation for the subtraction assignment to sparse matrices.
1168  //**********************************************************************************************
1169 
1170  //**Multiplication assignment to dense matrices*************************************************
1171  // No special implementation for the multiplication assignment to dense matrices.
1172  //**********************************************************************************************
1173 
1174  //**Multiplication assignment to sparse matrices************************************************
1175  // No special implementation for the multiplication assignment to sparse matrices.
1176  //**********************************************************************************************
1177 
1178  //**Compile time checks*************************************************************************
1186  //**********************************************************************************************
1187 };
1188 //*************************************************************************************************
1189 
1190 
1191 
1192 
1193 //=================================================================================================
1194 //
1195 // GLOBAL BINARY ARITHMETIC OPERATORS
1196 //
1197 //=================================================================================================
1198 
1199 //*************************************************************************************************
1228 template< typename T1 // Type of the left-hand side dense vector
1229  , typename T2 > // Type of the right-hand side sparse vector
1230 inline const DVecTSVecMultExpr<T1,T2>
1232 {
1234 
1235  return DVecTSVecMultExpr<T1,T2>( ~lhs, ~rhs );
1236 }
1237 //*************************************************************************************************
1238 
1239 
1240 
1241 
1242 //=================================================================================================
1243 //
1244 // ROWS SPECIALIZATIONS
1245 //
1246 //=================================================================================================
1247 
1248 //*************************************************************************************************
1250 template< typename VT1, typename VT2 >
1251 struct Rows< DVecTSVecMultExpr<VT1,VT2> > : public Size<VT1>
1252 {};
1254 //*************************************************************************************************
1255 
1256 
1257 
1258 
1259 //=================================================================================================
1260 //
1261 // COLUMNS SPECIALIZATIONS
1262 //
1263 //=================================================================================================
1264 
1265 //*************************************************************************************************
1267 template< typename VT1, typename VT2 >
1268 struct Columns< DVecTSVecMultExpr<VT1,VT2> > : public Size<VT2>
1269 {};
1271 //*************************************************************************************************
1272 
1273 
1274 
1275 
1276 //=================================================================================================
1277 //
1278 // EXPRESSION TRAIT SPECIALIZATIONS
1279 //
1280 //=================================================================================================
1281 
1282 //*************************************************************************************************
1284 template< typename VT1, typename VT2, bool AF >
1285 struct SubmatrixExprTrait< DVecTSVecMultExpr<VT1,VT2>, AF >
1286 {
1287  public:
1288  //**********************************************************************************************
1289  using Type = MultExprTrait_< SubvectorExprTrait_<const VT1,AF>
1290  , SubvectorExprTrait_<const VT2,AF> >;
1291  //**********************************************************************************************
1292 };
1294 //*************************************************************************************************
1295 
1296 
1297 //*************************************************************************************************
1299 template< typename VT1, typename VT2 >
1300 struct RowExprTrait< DVecTSVecMultExpr<VT1,VT2> >
1301 {
1302  public:
1303  //**********************************************************************************************
1304  using Type = MultExprTrait_< ReturnType_<VT1>, VT2 >;
1305  //**********************************************************************************************
1306 };
1308 //*************************************************************************************************
1309 
1310 
1311 //*************************************************************************************************
1313 template< typename VT1, typename VT2 >
1314 struct ColumnExprTrait< DVecTSVecMultExpr<VT1,VT2> >
1315 {
1316  public:
1317  //**********************************************************************************************
1318  using Type = MultExprTrait_< VT1, ReturnType_<VT2> >;
1319  //**********************************************************************************************
1320 };
1322 //*************************************************************************************************
1323 
1324 } // namespace blaze
1325 
1326 #endif
ValueType * PointerType
Pointer return type.
Definition: DVecTSVecMultExpr.h:228
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
constexpr bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
PointerType pointer
Pointer return type.
Definition: DVecTSVecMultExpr.h:235
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.
ValueType & ReferenceType
Reference return type.
Definition: DVecTSVecMultExpr.h:229
Header file for the UNUSED_PARAMETER function template.
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7800
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:346
Header file for basic type definitions.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecTSVecMultExpr.h:230
#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.
ConstIterator lowerBound(size_t i, size_t j) const
Returns an iterator to the first index not less then the given index.
Definition: DVecTSVecMultExpr.h:481
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecTSVecMultExpr.h:505
Header file for the ColumnExprTrait class template.
Header file for the IsSame and IsStrictlySame type traits.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecTSVecMultExpr.h:317
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:162
const ConstIterator * operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: DVecTSVecMultExpr.h:275
ElementType_< VT1 > ET1
Element type of the left-hand side dense vector expression.
Definition: DVecTSVecMultExpr.h:117
CompositeType_< VT2 > CT2
Composite type of the right-hand side sparse vector expression.
Definition: DVecTSVecMultExpr.h:116
IteratorType it_
Iterator over the elements of the right-hand side sparse vector expression.
Definition: DVecTSVecMultExpr.h:336
MultTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: DVecTSVecMultExpr.h:186
size_t index() const
Access to the current index of the sparse element.
Definition: DVecTSVecMultExpr.h:295
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: DVecTSVecMultExpr.h:226
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:245
Header file for the Computation base class.
If_< IsExpression< VT1 >, const VT1, const VT1 & > LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecTSVecMultExpr.h:198
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:138
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DVecTSVecMultExpr.h:370
System settings for performance optimizations.
MultExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: DVecTSVecMultExpr.h:131
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DVecTSVecMultExpr.h:189
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
Element ValueType
Type of the underlying pointers.
Definition: DVecTSVecMultExpr.h:227
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: DVecTSVecMultExpr.h:265
If_< IsComputation< VT1 >, const RT1, CT1 > LT
Type for the assignment of the left-hand side dense vector operand.
Definition: DVecTSVecMultExpr.h:204
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:109
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Constraint on the data type.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecTSVecMultExpr.h:527
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
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse vector operand.
Definition: DVecTSVecMultExpr.h:515
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
Header file for the SparseMatrix base class.
Constraint on the transpose flag of vector types.
Constraint on the data type.
typename MultExprTrait< T1, T2 >::Type MultExprTrait_
Auxiliary alias declaration for the MultExprTrait class template.The MultExprTrait_ alias declaration...
Definition: MultExprTrait.h:344
Header file for the MultExprTrait class template.
ValueType value_type
Type of the underlying pointers.
Definition: DVecTSVecMultExpr.h:234
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DVecTSVecMultExpr.h:403
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.
ResultType_< VT2 > RT2
Result type of the right-hand side sparse vector expression.
Definition: DVecTSVecMultExpr.h:112
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecTSVecMultExpr.h:254
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
#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:105
LeftOperand lhs_
Left-hand side dense vector of the multiplication expression.
Definition: DVecTSVecMultExpr.h:546
#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
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DVecTSVecMultExpr.h:424
Header file for the Columns type trait.
Expression object for dense vector-sparse vector outer products.The DVecTSVecMultExpr class represent...
Definition: DVecTSVecMultExpr.h:105
ConstIterator(LeftElement v, IteratorType it)
Constructor for the ConstIterator class.
Definition: DVecTSVecMultExpr.h:243
If_< IsExpression< VT2 >, const VT2, const VT2 & > RightOperand
Composite type of the right-hand side sparse vector expression.
Definition: DVecTSVecMultExpr.h:201
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecTSVecMultExpr.h:306
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
IteratorCategory iterator_category
The iterator category.
Definition: DVecTSVecMultExpr.h:233
#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
ReturnType_< VT2 > RN2
Return type of the right-hand side sparse vector expression.
Definition: DVecTSVecMultExpr.h:114
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DVecTSVecMultExpr.h:192
Constraint on the data type.
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecTSVecMultExpr.h:188
Header file for the exception macros of the math module.
DifferenceType difference_type
Difference between two iterators.
Definition: DVecTSVecMultExpr.h:237
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecTSVecMultExpr.h:539
Constraint on the data type.
Header file for the RowExprTrait class template.
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.
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: DVecTSVecMultExpr.h:468
ConstIterator_< RemoveReference_< RightOperand > > IteratorType
Iterator type of the sparse vector expression.
Definition: DVecTSVecMultExpr.h:224
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DVecTSVecMultExpr.h:434
Header file for the IsNumeric type trait.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:76
DVecTSVecMultExpr(const VT1 &lhs, const VT2 &rhs) noexcept
Constructor for the DVecTSVecMultExpr class.
Definition: DVecTSVecMultExpr.h:357
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DVecTSVecMultExpr.h:414
Iterator over the elements of the dense vector-sparse vector outer product expression.
Definition: DVecTSVecMultExpr.h:213
If_< IsComputation< VT2 >, const RT2, CT2 > RT
Type for the assignment of the right-hand side dense vector operand.
Definition: DVecTSVecMultExpr.h:207
IfTrue_< useAssign, const ResultType, const DVecTSVecMultExpr & > CompositeType
Data type for composite expression templates.
Definition: DVecTSVecMultExpr.h:195
#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 SubmatrixExprTrait class template.
Header file for the HasSIMDMult type trait.
Header file for run time assertion macros.
CompositeType_< VT1 > CT1
Composite type of the left-hand side dense vector expression.
Definition: DVecTSVecMultExpr.h:115
RightOperand rhs_
Right-hand side sparse vector of the multiplication expression.
Definition: DVecTSVecMultExpr.h:547
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:160
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DVecTSVecMultExpr.h:187
ResultType_< VT1 > RT1
Result type of the left-hand side dense vector expression.
Definition: DVecTSVecMultExpr.h:111
DVecTSVecMultExpr< VT1, VT2 > This
Type of this DVecTSVecMultExpr instance.
Definition: DVecTSVecMultExpr.h:185
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: DVecTSVecMultExpr.h:218
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: DVecTSVecMultExpr.h:455
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
Header file for the isDefault shim.
ReferenceType reference
Reference return type.
Definition: DVecTSVecMultExpr.h:236
Constraint on the data type.
ReturnType value() const
Access to the current value of the sparse element.
Definition: DVecTSVecMultExpr.h:285
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DVecTSVecMultExpr.h:386
#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
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:223
Base class for all outer product expression templates.The VecTVecMultExpr class serves as a tag for a...
Definition: VecTVecMultExpr.h:66
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
ET1 LeftElement
Element type of the dense vector expression.
Definition: DVecTSVecMultExpr.h:221
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
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:70
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:59
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:110
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
LeftElement v_
Element of the left-hand side dense vector expression.
Definition: DVecTSVecMultExpr.h:335
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: DVecTSVecMultExpr.h:328
ReturnType_< VT1 > RN1
Return type of the left-hand side dense vector expression.
Definition: DVecTSVecMultExpr.h:113
#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
Header file for the SubvectorExprTrait class template.
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: DVecTSVecMultExpr.h:444
ElementType_< VT2 > ET2
Element type of the right-hand side sparse vector expression.
Definition: DVecTSVecMultExpr.h:118
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
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: DVecTSVecMultExpr.h:494
Constraint on the transpose flag of vector types.
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.