SVecTDVecMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECTDVECMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SVECTDVECMULTEXPR_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 SVECTDVECMULTEXPR
93 //
94 //=================================================================================================
95 
96 //*************************************************************************************************
103 template< typename VT1 // Type of the left-hand side sparse vector
104  , typename VT2 > // Type of the right-hand side dense vector
105 class SVecTDVecMultExpr : public SparseMatrix< SVecTDVecMultExpr<VT1,VT2>, true >
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 
142  enum : bool { useAssign = ( IsComputation<VT1>::value || !IsNumeric<ET1>::value ||
144 
146  template< typename MT >
148  struct UseAssign {
149  enum : bool { value = useAssign };
150  };
152  //**********************************************************************************************
153 
154  //**********************************************************************************************
156 
159  template< typename T1, typename T2, typename T3 >
160  struct UseVectorizedKernel {
161  enum : bool { value = useOptimizedKernels &&
162  T1::simdEnabled && T3::simdEnabled &&
164  IsSame< ElementType_<T1>, ElementType_<T3> >::value &&
166  };
168  //**********************************************************************************************
169 
170  //**********************************************************************************************
172 
175  template< typename T1, typename T2, typename T3 >
176  struct UseDefaultKernel {
177  enum : bool { value = !UseVectorizedKernel<T1,T2,T3>::value };
178  };
180  //**********************************************************************************************
181 
182  public:
183  //**Type definitions****************************************************************************
189 
192 
195 
197  typedef If_< IsExpression<VT1>, const VT1, const VT1& > LeftOperand;
198 
200  typedef If_< IsExpression<VT2>, const VT2, const VT2& > RightOperand;
201 
203  typedef If_< IsComputation<VT1>, const RT1, CT1 > LT;
204 
206  typedef If_< IsComputation<VT2>, const RT2, CT2 > RT;
207  //**********************************************************************************************
208 
209  //**ConstIterator class definition**************************************************************
213  {
214  public:
215  //**Type definitions*************************************************************************
218 
221 
223  typedef ET2 RightElement;
224 
225  typedef std::forward_iterator_tag IteratorCategory;
226  typedef Element ValueType;
227  typedef ValueType* PointerType;
228  typedef ValueType& ReferenceType;
230 
231  // STL iterator requirements
232  typedef IteratorCategory iterator_category;
233  typedef ValueType value_type;
234  typedef PointerType pointer;
235  typedef ReferenceType reference;
236  typedef DifferenceType difference_type;
237  //*******************************************************************************************
238 
239  //**Constructor******************************************************************************
242  inline ConstIterator( IteratorType it, RightElement v )
243  : it_( it ) // Iterator over the elements of the left-hand side sparse vector expression
244  , v_ ( v ) // Element of the right-hand side dense vector expression.
245  {}
246  //*******************************************************************************************
247 
248  //**Prefix increment operator****************************************************************
254  ++it_;
255  return *this;
256  }
257  //*******************************************************************************************
258 
259  //**Element access operator******************************************************************
264  inline const Element operator*() const {
265  return Element( it_->value() * v_, it_->index() );
266  }
267  //*******************************************************************************************
268 
269  //**Element access operator******************************************************************
274  inline const ConstIterator* operator->() const {
275  return this;
276  }
277  //*******************************************************************************************
278 
279  //**Value function***************************************************************************
284  inline ReturnType value() const {
285  return it_->value() * v_;
286  }
287  //*******************************************************************************************
288 
289  //**Index function***************************************************************************
294  inline size_t index() const {
295  return it_->index();
296  }
297  //*******************************************************************************************
298 
299  //**Equality operator************************************************************************
305  inline bool operator==( const ConstIterator& rhs ) const {
306  return it_ == rhs.it_;
307  }
308  //*******************************************************************************************
309 
310  //**Inequality operator**********************************************************************
316  inline bool operator!=( const ConstIterator& rhs ) const {
317  return it_ != rhs.it_;
318  }
319  //*******************************************************************************************
320 
321  //**Subtraction operator*********************************************************************
327  inline DifferenceType operator-( const ConstIterator& rhs ) const {
328  return it_ - rhs.it_;
329  }
330  //*******************************************************************************************
331 
332  private:
333  //**Member variables*************************************************************************
334  IteratorType it_;
335  RightElement v_;
336  //*******************************************************************************************
337  };
338  //**********************************************************************************************
339 
340  //**Compilation flags***************************************************************************
342  enum : bool { smpAssignable = false };
343  //**********************************************************************************************
344 
345  //**SIMD properties*****************************************************************************
347  enum : size_t { SIMDSIZE = SIMDTrait<ElementType>::size };
348  //**********************************************************************************************
349 
350  //**Constructor*********************************************************************************
356  explicit inline SVecTDVecMultExpr( const VT1& lhs, const VT2& rhs ) noexcept
357  : lhs_( lhs ) // Left-hand side sparse vector of the multiplication expression
358  , rhs_( rhs ) // Right-hand side dense vector of the multiplication expression
359  {}
360  //**********************************************************************************************
361 
362  //**Access operator*****************************************************************************
369  inline ReturnType operator()( size_t i, size_t j ) const {
370  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
371  BLAZE_INTERNAL_ASSERT( j < rhs_.size(), "Invalid column access index" );
372 
373  return lhs_[i] * rhs_[j];
374  }
375  //**********************************************************************************************
376 
377  //**At function*********************************************************************************
385  inline ReturnType at( size_t i, size_t j ) const {
386  if( i >= lhs_.size() ) {
387  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
388  }
389  if( j >= rhs_.size() ) {
390  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
391  }
392  return (*this)(i,j);
393  }
394  //**********************************************************************************************
395 
396  //**Begin function******************************************************************************
402  inline ConstIterator begin( size_t i ) const {
403  return ConstIterator( lhs_.begin(), rhs_[i] );
404  }
405  //**********************************************************************************************
406 
407  //**End function********************************************************************************
413  inline ConstIterator end( size_t i ) const {
414  return ConstIterator( lhs_.end(), rhs_[i] );
415  }
416  //**********************************************************************************************
417 
418  //**Rows function*******************************************************************************
423  inline size_t rows() const noexcept {
424  return lhs_.size();
425  }
426  //**********************************************************************************************
427 
428  //**Columns function****************************************************************************
433  inline size_t columns() const noexcept {
434  return rhs_.size();
435  }
436  //**********************************************************************************************
437 
438  //**NonZeros function***************************************************************************
443  inline size_t nonZeros() const {
444  return lhs_.nonZeros() * rhs_.size();
445  }
446  //**********************************************************************************************
447 
448  //**NonZeros function***************************************************************************
454  inline size_t nonZeros( size_t i ) const {
455  UNUSED_PARAMETER( i );
456  return lhs_.nonZeros();
457  }
458  //**********************************************************************************************
459 
460  //**Find function*******************************************************************************
467  inline ConstIterator find( size_t i, size_t j ) const {
469  return ConstIterator( lhs_.find( i ), rhs_[j] );
470  }
471  //**********************************************************************************************
472 
473  //**LowerBound function*************************************************************************
480  inline ConstIterator lowerBound( size_t i, size_t j ) const {
482  return ConstIterator( lhs_.lowerBound( i ), rhs_[j] );
483  }
484  //**********************************************************************************************
485 
486  //**UpperBound function*************************************************************************
493  inline ConstIterator upperBound( size_t i, size_t j ) const {
495  return ConstIterator( lhs_.upperBound( i ), rhs_[j] );
496  }
497  //**********************************************************************************************
498 
499  //**Left operand access*************************************************************************
504  inline LeftOperand leftOperand() const noexcept {
505  return lhs_;
506  }
507  //**********************************************************************************************
508 
509  //**Right operand access************************************************************************
514  inline RightOperand rightOperand() const noexcept {
515  return rhs_;
516  }
517  //**********************************************************************************************
518 
519  //**********************************************************************************************
525  template< typename T >
526  inline bool canAlias( const T* alias ) const noexcept {
527  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
528  }
529  //**********************************************************************************************
530 
531  //**********************************************************************************************
537  template< typename T >
538  inline bool isAliased( const T* alias ) const noexcept {
539  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
540  }
541  //**********************************************************************************************
542 
543  private:
544  //**Member variables****************************************************************************
545  LeftOperand lhs_;
546  RightOperand rhs_;
547  //**********************************************************************************************
548 
549  //**Assignment to row-major dense matrices******************************************************
561  template< typename MT > // Type of the target dense matrix
562  friend inline void assign( DenseMatrix<MT,false>& lhs, const SVecTDVecMultExpr& rhs )
563  {
565 
567 
568  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
569  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
570 
571  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
572  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
573 
574  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
575  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
576  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
577  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
578 
579  SVecTDVecMultExpr::selectAssignKernel( ~lhs, x, y );
580  }
582  //**********************************************************************************************
583 
584  //**Default assignment to row-major dense matrices**********************************************
598  template< typename MT // Type of the left-hand side target matrix
599  , typename VT3 // Type of the left-hand side vector operand
600  , typename VT4 > // Type of the right-hand side vector operand
602  selectAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
603  {
605 
606  const ConstIterator end( x.end() );
607 
608  for( ConstIterator element=x.begin(); element!=end; ++element ) {
609  if( !isDefault( element->value() ) ) {
610  for( size_t j=0UL; j<y.size(); ++j ) {
611  (~A)(element->index(),j) = element->value() * y[j];
612  }
613  }
614  }
615  }
617  //**********************************************************************************************
618 
619  //**Vectorized assignment to row-major dense matrices*******************************************
633  template< typename MT // Type of the left-hand side target matrix
634  , typename VT3 // Type of the left-hand side vector operand
635  , typename VT4 > // Type of the right-hand side vector operand
636  static inline EnableIf_< UseVectorizedKernel<MT,VT3,VT4> >
637  selectAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
638  {
639  typedef ConstIterator_< RemoveReference_<LT> > ConstIterator;
640 
641  const size_t N( (~A).columns() );
642 
643  const bool remainder( !IsPadded<MT>::value || !IsPadded<VT4>::value );
644 
645  const size_t jpos( remainder ? ( N & size_t(-SIMDSIZE) ) : N );
646  BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % SIMDSIZE ) ) == jpos, "Invalid end calculation" );
647 
648  const ConstIterator begin( x.begin() );
649  const ConstIterator end ( x.end() );
650 
651  for( ConstIterator element=begin; element!=end; ++element )
652  {
653  const SIMDTrait_<ElementType> x1( set( element->value() ) );
654 
655  size_t j( 0UL );
656 
657  for( ; j<jpos; j+=SIMDSIZE ) {
658  (~A).store( element->index(), j, x1 * y.load(j) );
659  }
660  for( ; remainder && j<N; ++j ) {
661  (~A)(element->index(),j) = element->value() * y[j];
662  }
663  }
664  }
666  //**********************************************************************************************
667 
668  //**Assignment to column-major dense matrices***************************************************
684  template< typename MT > // Type of the target dense matrix
685  friend inline EnableIf_< UseAssign<MT> >
686  assign( DenseMatrix<MT,true>& lhs, const SVecTDVecMultExpr& rhs )
687  {
689 
690  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
691  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
692 
693  typedef ConstIterator_< RemoveReference_<LT> > ConstIterator;
694 
695  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
696  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
697 
698  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
699  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
700  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
701  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
702 
703  const ConstIterator end( x.end() );
704 
705  for( size_t i=0UL; i<y.size(); ++i ) {
706  if( !isDefault( y[i] ) ) {
707  for( ConstIterator element=x.begin(); element!=end; ++element ) {
708  (~lhs)(element->index(),i) = element->value() * y[i];
709  }
710  }
711  }
712  }
714  //**********************************************************************************************
715 
716  //**Assignment to row-major sparse matrices*****************************************************
728  template< typename MT > // Type of the target sparse matrix
729  friend inline void assign( SparseMatrix<MT,false>& lhs, const SVecTDVecMultExpr& rhs )
730  {
732 
734 
735  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
736  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns() , "Invalid number of columns" );
737 
738  typedef ConstIterator_< RemoveReference_<LT> > ConstIterator;
739 
740  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
741  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
742 
743  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
744  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
745  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
746  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
747 
748  const ConstIterator begin( x.begin() );
749  const ConstIterator end ( x.end() );
750 
751  if( begin == end )
752  return;
753 
754  (~lhs).reserve( begin->index(), rhs.nonZeros() );
755 
756  size_t index( 0UL );
757 
758  for( ConstIterator element=begin; element!=end; ++element ) {
759  if( !isDefault( element->value() ) ) {
760  for( ; index < element->index(); ++index ) {
761  (~lhs).finalize( index );
762  }
763  for( size_t i=0UL; i<y.size(); ++i ) {
764  (~lhs).append( element->index(), i, element->value() * y[i] );
765  }
766  (~lhs).finalize( index++ );
767  }
768  }
769 
770  for( ; index < x.size(); ++index ) {
771  (~lhs).finalize( index );
772  }
773  }
775  //**********************************************************************************************
776 
777  //**Assignment to column-major sparse matrices**************************************************
793  template< typename MT > // Type of the target sparse matrix
794  friend inline EnableIf_< UseAssign<MT> >
795  assign( SparseMatrix<MT,true>& lhs, const SVecTDVecMultExpr& rhs )
796  {
798 
799  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
800  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns() , "Invalid number of columns" );
801  BLAZE_INTERNAL_ASSERT( (~lhs).capacity() >= rhs.nonZeros(), "Insufficient capacity" );
802 
803  typedef ConstIterator_< RemoveReference_<LT> > ConstIterator;
804 
805  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
806  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
807 
808  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
809  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
810  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
811  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
812 
813  const ConstIterator begin( x.begin() );
814  const ConstIterator end ( x.end() );
815 
816  if( begin == end )
817  return;
818 
819  for( size_t i=0UL; i<y.size(); ++i ) {
820  if( !isDefault( y[i] ) ) {
821  for( ConstIterator element=begin; element!=end; ++element ) {
822  (~lhs).append( element->index(), i, element->value() * y[i] );
823  }
824  }
825  (~lhs).finalize( i );
826  }
827  }
829  //**********************************************************************************************
830 
831  //**Addition assignment to row-major dense matrices*********************************************
844  template< typename MT > // Type of the target dense matrix
845  friend inline void addAssign( DenseMatrix<MT,false>& lhs, const SVecTDVecMultExpr& rhs )
846  {
848 
850 
851  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
852  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
853 
854  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
855  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
856 
857  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
858  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
859  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
860  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
861 
862  SVecTDVecMultExpr::selectAddAssignKernel( ~lhs, x, y );
863  }
865  //**********************************************************************************************
866 
867  //**Default addition assignment to row-major dense matrices*************************************
881  template< typename MT // Type of the left-hand side target matrix
882  , typename VT3 // Type of the left-hand side vector operand
883  , typename VT4 > // Type of the right-hand side vector operand
884  static inline EnableIf_< UseDefaultKernel<MT,VT3,VT4> >
885  selectAddAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
886  {
887  typedef ConstIterator_< RemoveReference_<LT> > ConstIterator;
888 
889  const ConstIterator end( x.end() );
890 
891  for( ConstIterator element=x.begin(); element!=end; ++element ) {
892  if( !isDefault( element->value() ) ) {
893  for( size_t i=0UL; i<y.size(); ++i ) {
894  (~A)(element->index(),i) += element->value() * y[i];
895  }
896  }
897  }
898  }
900  //**********************************************************************************************
901 
902  //**Vectorized addition assignment to row-major dense matrices**********************************
916  template< typename MT // Type of the left-hand side target matrix
917  , typename VT3 // Type of the left-hand side vector operand
918  , typename VT4 > // Type of the right-hand side vector operand
919  static inline EnableIf_< UseVectorizedKernel<MT,VT3,VT4> >
920  selectAddAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
921  {
922  typedef ConstIterator_< RemoveReference_<LT> > ConstIterator;
923 
924  const size_t N( (~A).columns() );
925 
926  const bool remainder( !IsPadded<MT>::value || !IsPadded<VT4>::value );
927 
928  const size_t jpos( remainder ? ( N & size_t(-SIMDSIZE) ) : N );
929  BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % SIMDSIZE ) ) == jpos, "Invalid end calculation" );
930 
931  const ConstIterator begin( x.begin() );
932  const ConstIterator end ( x.end() );
933 
934  for( ConstIterator element=begin; element!=end; ++element )
935  {
936  const SIMDTrait_<ElementType> x1( set( element->value() ) );
937 
938  size_t j( 0UL );
939 
940  for( ; j<jpos; j+=SIMDSIZE ) {
941  (~A).store( element->index(), j, (~A).load(element->index(),j) + x1 * y.load(j) );
942  }
943  for( ; remainder && j<N; ++j ) {
944  (~A)(element->index(),j) += element->value() * y[j];
945  }
946  }
947  }
949  //**********************************************************************************************
950 
951  //**Addition assignment to column-major dense matrices******************************************
967  template< typename MT > // Type of the target dense matrix
968  friend inline EnableIf_< UseAssign<MT> >
969  addAssign( DenseMatrix<MT,true>& lhs, const SVecTDVecMultExpr& rhs )
970  {
972 
973  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
974  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
975 
976  typedef ConstIterator_< RemoveReference_<LT> > ConstIterator;
977 
978  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
979  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
980 
981  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
982  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
983  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
984  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
985 
986  const ConstIterator end( x.end() );
987 
988  for( size_t i=0UL; i<y.size(); ++i ) {
989  if( !isDefault( y[i] ) ) {
990  for( ConstIterator element=x.begin(); element!=end; ++element ) {
991  (~lhs)(element->index(),i) += element->value() * y[i];
992  }
993  }
994  }
995  }
997  //**********************************************************************************************
998 
999  //**Addition assignment to sparse matrices******************************************************
1000  // No special implementation for the addition assignment to sparse matrices.
1001  //**********************************************************************************************
1002 
1003  //**Subtraction assignment to row-major dense matrices******************************************
1016  template< typename MT > // Type of the target dense matrix
1017  friend inline void subAssign( DenseMatrix<MT,false>& lhs, const SVecTDVecMultExpr& rhs )
1018  {
1020 
1022 
1023  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1024  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1025 
1026  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
1027  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
1028 
1029  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1030  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1031  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1032  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1033 
1034  SVecTDVecMultExpr::selectSubAssignKernel( ~lhs, x, y );
1035  }
1037  //**********************************************************************************************
1038 
1039  //**Default subtraction assignment to row-major dense matrices**********************************
1053  template< typename MT // Type of the left-hand side target matrix
1054  , typename VT3 // Type of the left-hand side vector operand
1055  , typename VT4 > // Type of the right-hand side vector operand
1056  static inline EnableIf_< UseDefaultKernel<MT,VT3,VT4> >
1057  selectSubAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
1058  {
1059  typedef ConstIterator_< RemoveReference_<LT> > ConstIterator;
1060 
1061  const ConstIterator end( x.end() );
1062 
1063  for( ConstIterator element=x.begin(); element!=end; ++element ) {
1064  if( !isDefault( element->value() ) ) {
1065  for( size_t i=0UL; i<y.size(); ++i ) {
1066  (~A)(element->index(),i) -= element->value() * y[i];
1067  }
1068  }
1069  }
1070  }
1072  //**********************************************************************************************
1073 
1074  //**Vectorized subtraction assignment to row-major dense matrices*******************************
1088  template< typename MT // Type of the left-hand side target matrix
1089  , typename VT3 // Type of the left-hand side vector operand
1090  , typename VT4 > // Type of the right-hand side vector operand
1091  static inline EnableIf_< UseVectorizedKernel<MT,VT3,VT4> >
1092  selectSubAssignKernel( DenseMatrix<MT,false>& A, const VT3& x, const VT4& y )
1093  {
1094  typedef ConstIterator_< RemoveReference_<LT> > ConstIterator;
1095 
1096  const size_t N( (~A).columns() );
1097 
1098  const bool remainder( !IsPadded<MT>::value || !IsPadded<VT4>::value );
1099 
1100  const size_t jpos( remainder ? ( N & size_t(-SIMDSIZE) ) : N );
1101  BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % SIMDSIZE ) ) == jpos, "Invalid end calculation" );
1102 
1103  const ConstIterator begin( x.begin() );
1104  const ConstIterator end ( x.end() );
1105 
1106  for( ConstIterator element=begin; element!=end; ++element )
1107  {
1108  const SIMDTrait_<ElementType> x1( set( element->value() ) );
1109 
1110  size_t j( 0UL );
1111 
1112  for( ; j<jpos; j+=SIMDSIZE ) {
1113  (~A).store( element->index(), j, (~A).load(element->index(),j) - x1 * y.load(j) );
1114  }
1115  for( ; remainder && j<N; ++j ) {
1116  (~A)(element->index(),j) -= element->value() * y[j];
1117  }
1118  }
1119  }
1121  //**********************************************************************************************
1122 
1123  //**Subtraction assignment to column-major dense matrices***************************************
1139  template< typename MT > // Type of the target dense matrix
1140  friend inline EnableIf_< UseAssign<MT> >
1141  subAssign( DenseMatrix<MT,true>& lhs, const SVecTDVecMultExpr& rhs )
1142  {
1144 
1145  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
1146  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
1147 
1148  typedef ConstIterator_< RemoveReference_<LT> > ConstIterator;
1149 
1150  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
1151  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
1152 
1153  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
1154  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
1155  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
1156  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
1157 
1158  const ConstIterator end( x.end() );
1159 
1160  for( size_t i=0UL; i<y.size(); ++i ) {
1161  if( !isDefault( y[i] ) ) {
1162  for( ConstIterator element=x.begin(); element!=end; ++element ) {
1163  (~lhs)(element->index(),i) -= element->value() * y[i];
1164  }
1165  }
1166  }
1167  }
1169  //**********************************************************************************************
1170 
1171  //**Subtraction assignment to sparse matrices***************************************************
1172  // No special implementation for the subtraction assignment to sparse matrices.
1173  //**********************************************************************************************
1174 
1175  //**Multiplication assignment to dense matrices*************************************************
1176  // No special implementation for the multiplication assignment to dense matrices.
1177  //**********************************************************************************************
1178 
1179  //**Multiplication assignment to sparse matrices************************************************
1180  // No special implementation for the multiplication assignment to sparse matrices.
1181  //**********************************************************************************************
1182 
1183  //**Compile time checks*************************************************************************
1191  //**********************************************************************************************
1192 };
1193 //*************************************************************************************************
1194 
1195 
1196 
1197 
1198 //=================================================================================================
1199 //
1200 // GLOBAL BINARY ARITHMETIC OPERATORS
1201 //
1202 //=================================================================================================
1203 
1204 //*************************************************************************************************
1233 template< typename T1 // Type of the left-hand side sparse vector
1234  , typename T2 > // Type of the right-hand side dense vector
1235 inline const SVecTDVecMultExpr<T1,T2>
1237 {
1239 
1240  return SVecTDVecMultExpr<T1,T2>( ~lhs, ~rhs );
1241 }
1242 //*************************************************************************************************
1243 
1244 
1245 
1246 
1247 //=================================================================================================
1248 //
1249 // ROWS SPECIALIZATIONS
1250 //
1251 //=================================================================================================
1252 
1253 //*************************************************************************************************
1255 template< typename VT1, typename VT2 >
1256 struct Rows< SVecTDVecMultExpr<VT1,VT2> > : public Size<VT1>
1257 {};
1259 //*************************************************************************************************
1260 
1261 
1262 
1263 
1264 //=================================================================================================
1265 //
1266 // COLUMNS SPECIALIZATIONS
1267 //
1268 //=================================================================================================
1269 
1270 //*************************************************************************************************
1272 template< typename VT1, typename VT2 >
1273 struct Columns< SVecTDVecMultExpr<VT1,VT2> > : public Size<VT2>
1274 {};
1276 //*************************************************************************************************
1277 
1278 
1279 
1280 
1281 //=================================================================================================
1282 //
1283 // EXPRESSION TRAIT SPECIALIZATIONS
1284 //
1285 //=================================================================================================
1286 
1287 //*************************************************************************************************
1289 template< typename VT1, typename VT2, bool AF >
1290 struct SubmatrixExprTrait< SVecTDVecMultExpr<VT1,VT2>, AF >
1291 {
1292  public:
1293  //**********************************************************************************************
1294  using Type = MultExprTrait_< SubvectorExprTrait_<const VT1,AF>
1295  , SubvectorExprTrait_<const VT2,AF> >;
1296  //**********************************************************************************************
1297 };
1299 //*************************************************************************************************
1300 
1301 
1302 //*************************************************************************************************
1304 template< typename VT1, typename VT2 >
1305 struct RowExprTrait< SVecTDVecMultExpr<VT1,VT2> >
1306 {
1307  public:
1308  //**********************************************************************************************
1309  using Type = MultExprTrait_< ReturnType_<VT1>, VT2 >;
1310  //**********************************************************************************************
1311 };
1313 //*************************************************************************************************
1314 
1315 
1316 //*************************************************************************************************
1318 template< typename VT1, typename VT2 >
1319 struct ColumnExprTrait< SVecTDVecMultExpr<VT1,VT2> >
1320 {
1321  public:
1322  //**********************************************************************************************
1323  using Type = MultExprTrait_< VT1, ReturnType_<VT2> >;
1324  //**********************************************************************************************
1325 };
1327 //*************************************************************************************************
1328 
1329 } // namespace blaze
1330 
1331 #endif
CompositeType_< VT2 > CT2
Composite type of the right-hand side dense vector expression.
Definition: SVecTDVecMultExpr.h:116
Pointer difference type of the Blaze library.
Header file for auxiliary alias declarations.
MultExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: SVecTDVecMultExpr.h:131
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
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:70
Header file for the Rows type trait.
Header file for the UNUSED_PARAMETER function template.
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
Iterator over the elements of the sparse vector-dense vector outer product expression.
Definition: SVecTDVecMultExpr.h:212
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.
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SVecTDVecMultExpr.h:423
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SVecTDVecMultExpr.h:225
ElementType_< VT1 > ET1
Element type of the left-hand side sparse vector expression.
Definition: SVecTDVecMultExpr.h:117
MultTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: SVecTDVecMultExpr.h:185
#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
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SVecTDVecMultExpr.h:433
Header file for the serial shim.
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified column.
Definition: SVecTDVecMultExpr.h:454
Header file for the ColumnExprTrait class template.
Header file for the IsSame and IsStrictlySame type traits.
DifferenceType difference_type
Difference between two iterators.
Definition: SVecTDVecMultExpr.h:236
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:162
ValueType * PointerType
Pointer return type.
Definition: SVecTDVecMultExpr.h:227
Expression object for sparse vector-dense vector outer products.The SVecTDVecMultExpr class represent...
Definition: Forward.h:124
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SVecTDVecMultExpr.h:443
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of column i.
Definition: SVecTDVecMultExpr.h:402
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
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of column i.
Definition: SVecTDVecMultExpr.h:413
If_< IsComputation< VT2 >, const RT2, CT2 > RT
Type for the assignment of the right-hand side dense vector operand.
Definition: SVecTDVecMultExpr.h:206
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:138
ElementType_< ResultType > ElementType
Resulting element type.
Definition: SVecTDVecMultExpr.h:188
System settings for performance optimizations.
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SVecTDVecMultExpr.h:217
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
SVecTDVecMultExpr< VT1, VT2 > This
Type of this SVecTDVecMultExpr instance.
Definition: SVecTDVecMultExpr.h:184
RightElement v_
Element of the right-hand side dense vector expression.
Definition: SVecTDVecMultExpr.h:335
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
ValueType value_type
Type of the underlying pointers.
Definition: SVecTDVecMultExpr.h:233
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Constraint on the data type.
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: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.
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
const ConstIterator * operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SVecTDVecMultExpr.h:274
IteratorType it_
Iterator over the elements of the left-hand side sparse vector expression.
Definition: SVecTDVecMultExpr.h:334
Header file for the ValueIndexPair class.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SVecTDVecMultExpr.h:538
ReferenceType reference
Reference return type.
Definition: SVecTDVecMultExpr.h:235
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
CompositeType_< VT1 > CT1
Composite type of the left-hand side sparse vector expression.
Definition: SVecTDVecMultExpr.h:115
RightOperand rightOperand() const noexcept
Returns the right-hand side dense vector operand.
Definition: SVecTDVecMultExpr.h:514
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse vector operand.
Definition: SVecTDVecMultExpr.h:504
ResultType_< VT1 > RT1
Result type of the left-hand side sparse vector expression.
Definition: SVecTDVecMultExpr.h:111
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SVecTDVecMultExpr.h:316
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
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SVecTDVecMultExpr.h:305
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the Columns type trait.
If_< IsComputation< VT1 >, const RT1, CT1 > LT
Type for the assignment of the left-hand side dense vector operand.
Definition: SVecTDVecMultExpr.h:203
ConstIterator find(size_t i, size_t j) const
Searches for a specific matrix element.
Definition: SVecTDVecMultExpr.h:467
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SVecTDVecMultExpr.h:327
Header file for all SIMD functionality.
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SVecTDVecMultExpr.h:186
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional vector type...
Definition: SparseVector.h:61
ReturnType value() const
Access to the current value of the sparse element.
Definition: SVecTDVecMultExpr.h:284
Constraint on the data type.
LeftOperand lhs_
Left-hand side sparse vector of the multiplication expression.
Definition: SVecTDVecMultExpr.h:545
Header file for the exception macros of the math module.
Constraint on the data type.
Header file for the RowExprTrait class template.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SVecTDVecMultExpr.h:526
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Header file for the VecTVecMultExpr base class.
RightOperand rhs_
Right-hand side dense vector of the multiplication expression.
Definition: SVecTDVecMultExpr.h:546
Header file for the EnableIf class template.
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SVecTDVecMultExpr.h:187
ReturnType_< VT1 > RN1
Return type of the left-hand side sparse vector expression.
Definition: SVecTDVecMultExpr.h:113
Element ValueType
Type of the underlying pointers.
Definition: SVecTDVecMultExpr.h:226
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
ConstIterator lowerBound(size_t i, size_t j) const
Returns an iterator to the first index not less then the given index.
Definition: SVecTDVecMultExpr.h:480
#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.
If_< IsExpression< VT2 >, const VT2, const VT2 & > RightOperand
Composite type of the right-hand side dense vector expression.
Definition: SVecTDVecMultExpr.h:200
Header file for run time assertion macros.
IfTrue_< useAssign, const ResultType, const SVecTDVecMultExpr & > CompositeType
Data type for composite expression templates.
Definition: SVecTDVecMultExpr.h:194
ConstIterator & operator++()
Pre-increment operator.
Definition: SVecTDVecMultExpr.h:253
SVecTDVecMultExpr(const VT1 &lhs, const VT2 &rhs) noexcept
Constructor for the SVecTDVecMultExpr class.
Definition: SVecTDVecMultExpr.h:356
ElementType_< VT2 > ET2
Element type of the right-hand side dense vector expression.
Definition: SVecTDVecMultExpr.h:118
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
ResultType_< VT2 > RT2
Result type of the right-hand side dense vector expression.
Definition: SVecTDVecMultExpr.h:112
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SVecTDVecMultExpr.h:264
Header file for the isDefault shim.
ReturnType_< VT2 > RN2
Return type of the right-hand side dense vector expression.
Definition: SVecTDVecMultExpr.h:114
Constraint on the data type.
ET2 RightElement
Element type of the dense vector expression.
Definition: SVecTDVecMultExpr.h:223
#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
ConstIterator upperBound(size_t i, size_t j) const
Returns an iterator to the first index greater then the given index.
Definition: SVecTDVecMultExpr.h:493
Constraint on the data type.
ConstIterator(IteratorType it, RightElement v)
Constructor for the ConstIterator class.
Definition: SVecTDVecMultExpr.h:242
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
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
ValueType & ReferenceType
Reference return type.
Definition: SVecTDVecMultExpr.h:228
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
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SVecTDVecMultExpr.h:369
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:70
IteratorCategory iterator_category
The iterator category.
Definition: SVecTDVecMultExpr.h:232
Header file for the IsComputation type trait class.
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
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: SVecTDVecMultExpr.h:191
#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.
ConstIterator_< RemoveReference_< LeftOperand > > IteratorType
Iterator type of the sparse vector expression.
Definition: SVecTDVecMultExpr.h:220
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 index() const
Access to the current index of the sparse element.
Definition: SVecTDVecMultExpr.h:294
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
If_< IsExpression< VT1 >, const VT1, const VT1 & > LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: SVecTDVecMultExpr.h:197
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SVecTDVecMultExpr.h:229
PointerType pointer
Pointer return type.
Definition: SVecTDVecMultExpr.h:234
Constraint on the transpose flag of vector types.
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SVecTDVecMultExpr.h:385