All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TSMatSVecMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_TSMATSVECMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TSMATSVECMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <stdexcept>
44 #include <vector>
54 #include <blaze/math/shims/Reset.h>
64 #include <blaze/util/Assert.h>
66 #include <blaze/util/DisableIf.h>
67 #include <blaze/util/EnableIf.h>
69 #include <blaze/util/SelectType.h>
70 #include <blaze/util/Types.h>
72 
73 
74 namespace blaze {
75 
76 //=================================================================================================
77 //
78 // CLASS SMATDVECMULTEXPR
79 //
80 //=================================================================================================
81 
82 //*************************************************************************************************
89 template< typename MT // Type of the left-hand side sparse matrix
90  , typename VT > // Type of the right-hand side sparse vector
91 class TSMatSVecMultExpr : public SparseVector< TSMatSVecMultExpr<MT,VT>, false >
92  , private MatVecMultExpr
93  , private Computation
94 {
95  private:
96  //**Type definitions****************************************************************************
97  typedef typename MT::ResultType MRT;
98  typedef typename VT::ResultType VRT;
99  typedef typename MT::CompositeType MCT;
100  typedef typename VT::CompositeType VCT;
101  //**********************************************************************************************
102 
103  //**********************************************************************************************
105  enum { evaluateMatrix = RequiresEvaluation<MT>::value };
106  //**********************************************************************************************
107 
108  //**********************************************************************************************
110  enum { evaluateVector = IsComputation<VT>::value };
111  //**********************************************************************************************
112 
113  //**********************************************************************************************
115 
118  template< typename T1, typename T2, typename T3 >
119  struct UseSMPAssignKernel {
120  enum { value = evaluateMatrix || evaluateVector };
121  };
123  //**********************************************************************************************
124 
125  public:
126  //**Type definitions****************************************************************************
131  typedef const ElementType ReturnType;
132 
134  typedef const ResultType CompositeType;
135 
137  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type LeftOperand;
138 
140  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type RightOperand;
141 
143  typedef MCT LT;
144 
147  //**********************************************************************************************
148 
149  //**Compilation flags***************************************************************************
151  enum { smpAssignable = !evaluateMatrix && !evaluateVector };
152  //**********************************************************************************************
153 
154  //**Constructor*********************************************************************************
160  explicit inline TSMatSVecMultExpr( const MT& mat, const VT& vec )
161  : mat_( mat ) // Left-hand side sparse matrix of the multiplication expression
162  , vec_( vec ) // Right-hand side sparse vector of the multiplication expression
163  {
164  BLAZE_INTERNAL_ASSERT( mat_.columns() == vec_.size(), "Invalid matrix and vector sizes" );
165  }
166  //**********************************************************************************************
167 
168  //**Subscript operator**************************************************************************
174  inline ReturnType operator[]( size_t index ) const {
175  BLAZE_INTERNAL_ASSERT( index < mat_.rows(), "Invalid vector access index" );
176 
177  typedef typename RemoveReference<MCT>::Type::ConstIterator MatrixIterator;
178  typedef typename RemoveReference<VCT>::Type::ConstIterator VectorIterator;
179 
180  MCT A( mat_ ); // Evaluation of the left-hand side sparse matrix operand
181  VCT x( vec_ ); // Evaluation of the right-hand side sparse vector operand
182 
183  BLAZE_INTERNAL_ASSERT( A.rows() == mat_.rows() , "Invalid number of rows" );
184  BLAZE_INTERNAL_ASSERT( A.columns() == mat_.columns(), "Invalid number of columns" );
185  BLAZE_INTERNAL_ASSERT( x.size() == vec_.size() , "Invalid vector size" );
186 
187  ElementType res;
188 
189  const VectorIterator vend( x.end() );
190  VectorIterator velem( x.begin() );
191 
192  if( vec_.size() > 0UL && velem != vend ) {
193  res = A( index, velem->index() ) * velem->value();
194  ++velem;
195  for( ; velem!=vend; ++velem )
196  res += A( index, velem->index() ) * velem->value();
197  }
198  else {
199  reset( res );
200  }
201 
202  return res;
203  }
204  //**********************************************************************************************
205 
206  //**Size function*******************************************************************************
211  inline size_t size() const {
212  return mat_.rows();
213  }
214  //**********************************************************************************************
215 
216  //**NonZeros function***************************************************************************
221  inline size_t nonZeros() const {
222  return mat_.rows();
223  }
224  //**********************************************************************************************
225 
226  //**Left operand access*************************************************************************
231  inline LeftOperand leftOperand() const {
232  return mat_;
233  }
234  //**********************************************************************************************
235 
236  //**Right operand function**********************************************************************
241  inline RightOperand rightOperand() const {
242  return vec_;
243  }
244  //**********************************************************************************************
245 
246  //**********************************************************************************************
252  template< typename T >
253  inline bool canAlias( const T* alias ) const {
254  return ( mat_.isAliased( alias ) || vec_.isAliased( alias ) );
255  }
256  //**********************************************************************************************
257 
258  //**********************************************************************************************
264  template< typename T >
265  inline bool isAliased( const T* alias ) const {
266  return ( mat_.isAliased( alias ) || vec_.isAliased( alias ) );
267  }
268  //**********************************************************************************************
269 
270  //**********************************************************************************************
275  inline bool canSMPAssign() const {
276  return ( size() > SMP_SMATSVECMULT_THRESHOLD );
277  }
278  //**********************************************************************************************
279 
280  private:
281  //**Member variables****************************************************************************
284  //**********************************************************************************************
285 
286  //**Assignment to dense vectors*****************************************************************
299  template< typename VT1 > // Type of the target dense vector
300  friend inline void assign( DenseVector<VT1,false>& lhs, const TSMatSVecMultExpr& rhs )
301  {
303 
304  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
305 
306  // Resetting the left-hand side target dense vector
307  reset( ~lhs );
308 
309  // Evaluation of the right-hand side sparse vector operand
310  RT x( rhs.vec_ );
311  if( x.nonZeros() == 0UL ) return;
312 
313  // Evaluation of the left-hand side sparse matrix operand
314  LT A( rhs.mat_ );
315 
316  // Checking the evaluated operators
317  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
318  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
319  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
320  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).size() , "Invalid vector size" );
321 
322  // Performing the transpose sparse matrix-sparse vector multiplication
323  TSMatSVecMultExpr::selectAssignKernel( ~lhs, A, x );
324  }
326  //**********************************************************************************************
327 
328  //**Serial assignment to dense vectors**********************************************************
342  template< typename VT1 // Type of the left-hand side target vector
343  , typename MT1 // Type of the left-hand side matrix operand
344  , typename VT2 > // Type of the right-hand side vector operand
345  static inline typename DisableIf< UseSMPAssignKernel<VT1,MT1,VT2> >::Type
346  selectAssignKernel( VT1& y, const MT1& A, const VT2& x )
347  {
348  typedef typename RemoveReference<MT1>::Type::ConstIterator MatrixIterator;
349  typedef typename RemoveReference<VT2>::Type::ConstIterator VectorIterator;
350 
351  const VectorIterator vend ( x.end() );
352  VectorIterator velem( x.begin() );
353 
354  for( ; velem!=vend; ++velem )
355  {
356  const MatrixIterator mend ( A.end ( velem->index() ) );
357  MatrixIterator melem( A.begin( velem->index() ) );
358 
359  for( ; melem!=mend; ++melem ) {
361  isDefault( y[melem->index()] ) )
362  y[melem->index()] = melem->value() * velem->value();
363  else
364  y[melem->index()] += melem->value() * velem->value();
365  }
366  }
367  }
369  //**********************************************************************************************
370 
371  //**SMP assignment to dense vectors*************************************************************
385  template< typename VT1 // Type of the left-hand side target vector
386  , typename MT1 // Type of the left-hand side matrix operand
387  , typename VT2 > // Type of the right-hand side vector operand
388  static inline typename EnableIf< UseSMPAssignKernel<VT1,MT1,VT2> >::Type
389  selectAssignKernel( VT1& y, const MT1& A, const VT2& x )
390  {
391  smpAssign( y, A * x );
392  }
394  //**********************************************************************************************
395 
396  //**Assignment to sparse vectors****************************************************************
408  template< typename VT1 > // Type of the target sparse vector
409  friend inline void assign( SparseVector<VT1,false>& lhs, const TSMatSVecMultExpr& rhs )
410  {
412 
413  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
414 
415  typedef typename RemoveReference<LT>::Type::ConstIterator MatrixIterator;
416  typedef typename RemoveReference<RT>::Type::ConstIterator VectorIterator;
417 
418  RT x( rhs.vec_ ); // Evaluation of the right-hand side sparse vector operand
419  if( x.nonZeros() == 0UL ) return;
420 
421  LT A( rhs.mat_ ); // Evaluation of the left-hand side sparse matrix operand
422 
423  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
424  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
425  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
426  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).size() , "Invalid vector size" );
427 
428  DynamicVector<ElementType> tmp( (~lhs).size() );
429  std::vector<bool> indices( (~lhs).size(), false );
430  size_t nonzeros( 0UL );
431 
432  const VectorIterator vend ( x.end() );
433  VectorIterator velem( x.begin() );
434 
435  for( ; velem!=vend; ++velem )
436  {
437  const MatrixIterator mend ( A.end( velem->index() ) );
438  MatrixIterator melem( A.begin( velem->index() ) );
439 
440  for( ; melem!=mend; ++melem ) {
441  if( !indices[melem->index()] ) {
442  indices[melem->index()] = true;
443  ++nonzeros;
444  tmp[melem->index()] = melem->value() * velem->value();
445  }
446  else {
447  tmp[melem->index()] += melem->value() * velem->value();
448  }
449  }
450  }
451 
452  (~lhs).reserve( nonzeros );
453 
454  for( size_t i=0UL; i<(~lhs).size(); ++i ) {
455  if( indices[i] ) {
456  (~lhs).append( i, tmp[i] );
457  }
458  }
459  }
461  //**********************************************************************************************
462 
463  //**Addition assignment to dense vectors********************************************************
476  template< typename VT1 > // Type of the target dense vector
477  friend inline void addAssign( DenseVector<VT1,false>& lhs, const TSMatSVecMultExpr& rhs )
478  {
480 
481  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
482 
483  // Evaluation of the right-hand side sparse vector operand
484  RT x( rhs.vec_ );
485  if( x.nonZeros() == 0UL ) return;
486 
487  // Evaluation of the left-hand side sparse matrix operand
488  LT A( rhs.mat_ );
489 
490  // Checking the evaluated operators
491  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
492  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
493  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
494  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).size() , "Invalid vector size" );
495 
496  // Performing the transpose sparse matrix-sparse vector multiplication
497  TSMatSVecMultExpr::selectAddAssignKernel( ~lhs, A, x );
498  }
500  //**********************************************************************************************
501 
502  //**Serial addition assignment to dense vectors*************************************************
516  template< typename VT1 // Type of the left-hand side target vector
517  , typename MT1 // Type of the left-hand side matrix operand
518  , typename VT2 > // Type of the right-hand side vector operand
519  static inline typename DisableIf< UseSMPAssignKernel<VT1,MT1,VT2> >::Type
520  selectAddAssignKernel( VT1& y, const MT1& A, const VT2& x )
521  {
522  typedef typename RemoveReference<MT1>::Type::ConstIterator MatrixIterator;
523  typedef typename RemoveReference<VT2>::Type::ConstIterator VectorIterator;
524 
525  const VectorIterator vend ( x.end() );
526  VectorIterator velem( x.begin() );
527 
528  for( ; velem!=vend; ++velem )
529  {
530  const MatrixIterator mend ( A.end ( velem->index() ) );
531  MatrixIterator melem( A.begin( velem->index() ) );
532 
533  for( ; melem!=mend; ++melem ) {
534  y[melem->index()] += melem->value() * velem->value();
535  }
536  }
537  }
539  //**********************************************************************************************
540 
541  //**SMP addition assignment to dense vectors****************************************************
555  template< typename VT1 // Type of the left-hand side target vector
556  , typename MT1 // Type of the left-hand side matrix operand
557  , typename VT2 > // Type of the right-hand side vector operand
558  static inline typename EnableIf< UseSMPAssignKernel<VT1,MT1,VT2> >::Type
559  selectAddAssignKernel( VT1& y, const MT1& A, const VT2& x )
560  {
561  smpAddAssign( y, A * x );
562  }
564  //**********************************************************************************************
565 
566  //**Addition assignment to sparse vectors*******************************************************
567  // No special implementation for the addition assignment to sparse vectors.
568  //**********************************************************************************************
569 
570  //**Subtraction assignment to dense vectors*****************************************************
583  template< typename VT1 > // Type of the target dense vector
584  friend inline void subAssign( DenseVector<VT1,false>& lhs, const TSMatSVecMultExpr& rhs )
585  {
587 
588  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
589 
590  // Evaluation of the right-hand side sparse vector operand
591  RT x( rhs.vec_ );
592  if( x.nonZeros() == 0UL ) return;
593 
594  // Evaluation of the left-hand side sparse matrix operand
595  LT A( rhs.mat_ );
596 
597  // Checking the evaluated operators
598  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
599  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
600  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
601  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).size() , "Invalid vector size" );
602 
603  // Performing the transpose sparse matrix-sparse vector multiplication
604  TSMatSVecMultExpr::selectSubAssignKernel( ~lhs, A, x );
605  }
607  //**********************************************************************************************
608 
609  //**Serial subtraction assignment to dense vectors**********************************************
623  template< typename VT1 // Type of the left-hand side target vector
624  , typename MT1 // Type of the left-hand side matrix operand
625  , typename VT2 > // Type of the right-hand side vector operand
626  static inline typename DisableIf< UseSMPAssignKernel<VT1,MT1,VT2> >::Type
627  selectSubAssignKernel( VT1& y, const MT1& A, const VT2& x )
628  {
629  typedef typename RemoveReference<MT1>::Type::ConstIterator MatrixIterator;
630  typedef typename RemoveReference<VT2>::Type::ConstIterator VectorIterator;
631 
632  const VectorIterator vend ( x.end() );
633  VectorIterator velem( x.begin() );
634 
635  for( ; velem!=vend; ++velem )
636  {
637  const MatrixIterator mend ( A.end ( velem->index() ) );
638  MatrixIterator melem( A.begin( velem->index() ) );
639 
640  for( ; melem!=mend; ++melem ) {
641  y[melem->index()] -= melem->value() * velem->value();
642  }
643  }
644  }
646  //**********************************************************************************************
647 
648  //**SMP subtraction assignment to dense vectors*************************************************
662  template< typename VT1 // Type of the left-hand side target vector
663  , typename MT1 // Type of the left-hand side matrix operand
664  , typename VT2 > // Type of the right-hand side vector operand
665  static inline typename EnableIf< UseSMPAssignKernel<VT1,MT1,VT2> >::Type
666  selectSubAssignKernel( VT1& y, const MT1& A, const VT2& x )
667  {
668  smpSubAssign( y, A * x );
669  }
671  //**********************************************************************************************
672 
673  //**Subtraction assignment to sparse vectors****************************************************
674  // No special implementation for the subtraction assignment to sparse vectors.
675  //**********************************************************************************************
676 
677  //**Multiplication assignment to dense vectors**************************************************
690  template< typename VT1 > // Type of the target dense vector
691  friend inline void multAssign( DenseVector<VT1,false>& lhs, const TSMatSVecMultExpr& rhs )
692  {
694 
698 
699  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
700 
701  const ResultType tmp( rhs );
702  smpMultAssign( ~lhs, tmp );
703  }
705  //**********************************************************************************************
706 
707  //**Multiplication assignment to sparse vectors*************************************************
708  // No special implementation for the multiplication assignment to sparse vectors.
709  //**********************************************************************************************
710 
711  //**Compile time checks*************************************************************************
718  //**********************************************************************************************
719 };
720 //*************************************************************************************************
721 
722 
723 
724 
725 //=================================================================================================
726 //
727 // GLOBAL BINARY ARITHMETIC OPERATORS
728 //
729 //=================================================================================================
730 
731 //*************************************************************************************************
762 template< typename T1 // Type of the left-hand side sparse matrix
763  , typename T2 > // Type of the right-hand side sparse vector
764 inline const typename DisableIf< IsMatMatMultExpr<T1>, TSMatSVecMultExpr<T1,T2> >::Type
766 {
768 
769  if( (~mat).columns() != (~vec).size() )
770  throw std::invalid_argument( "Matrix and vector sizes do not match" );
771 
772  return TSMatSVecMultExpr<T1,T2>( ~mat, ~vec );
773 }
774 //*************************************************************************************************
775 
776 
777 
778 
779 //=================================================================================================
780 //
781 // EXPRESSION TRAIT SPECIALIZATIONS
782 //
783 //=================================================================================================
784 
785 //*************************************************************************************************
787 template< typename MT, typename VT, bool AF >
788 struct SubvectorExprTrait< TSMatSVecMultExpr<MT,VT>, AF >
789 {
790  public:
791  //**********************************************************************************************
792  typedef typename MultExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type, VT >::Type Type;
793  //**********************************************************************************************
794 };
796 //*************************************************************************************************
797 
798 } // namespace blaze
799 
800 #endif
VT::CompositeType VCT
Composite type of the right-hand side sparse vector expression.
Definition: TSMatSVecMultExpr.h:100
const size_t SMP_SMATSVECMULT_THRESHOLD
SMP row-major sparse matrix/sparse vector multiplication threshold.This threshold represents the syst...
Definition: Thresholds.h:295
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
void reset(DynamicMatrix< Type, SO > &m)
Resetting the given dense matrix.
Definition: DynamicMatrix.h:4579
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:4075
size_t nonZeros() const
Returns an estimation for the number of non-zero elements in the sparse vector.
Definition: TSMatSVecMultExpr.h:221
Header file for the SparseVector base class.
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatSVecMultExpr.h:137
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:151
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a column dense or sparse vector type...
Definition: TransposeFlag.h:159
const ResultType CompositeType
Data type for composite expression templates.
Definition: TSMatSVecMultExpr.h:134
bool isDefault(const DynamicMatrix< Type, SO > &m)
Returns whether the given dense matrix is in default state.
Definition: DynamicMatrix.h:4622
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:197
void smpMultAssign(DenseVector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:178
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: TSMatSVecMultExpr.h:265
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2384
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:249
size_t size() const
Returns the current size/dimension of the vector.
Definition: TSMatSVecMultExpr.h:211
SelectType< evaluateVector, const VRT, VCT >::Type RT
Type for the assignment of the right-hand side sparse vector operand.
Definition: TSMatSVecMultExpr.h:146
Header file for the Computation base class.
MCT LT
Type for the assignment of the left-hand side sparse matrix operand.
Definition: TSMatSVecMultExpr.h:143
Header file for the RequiresEvaluation type trait.
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type RightOperand
Composite type of the right-hand side sparse vector expression.
Definition: TSMatSVecMultExpr.h:140
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:104
Constraint on the data type.
MT::ResultType MRT
Result type of the left-hand side sparse matrix expression.
Definition: TSMatSVecMultExpr.h:97
Constraint on the data type.
void smpAddAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:121
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:251
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the DisableIf class template.
Header file for the multiplication trait.
Header file for the dense vector SMP implementation.
Expression object for sparse matrix-sparse vector multiplications.The TSMatSVecMultExpr class represe...
Definition: Forward.h:138
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: StorageOrder.h:161
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2388
Header file for the IsMatMatMultExpr type trait class.
void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:179
ResultType::ElementType ElementType
Resulting element type.
Definition: TSMatSVecMultExpr.h:130
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:79
Constraint on the data type.
LeftOperand leftOperand() const
Returns the left-hand side transpose sparse matrix operand.
Definition: TSMatSVecMultExpr.h:231
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:78
TSMatSVecMultExpr< MT, VT > This
Type of this TSMatSVecMultExpr instance.
Definition: TSMatSVecMultExpr.h:127
LeftOperand mat_
Left-hand side sparse matrix of the multiplication expression.
Definition: TSMatSVecMultExpr.h:282
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: TSMatSVecMultExpr.h:253
void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:269
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Header file for the complete DynamicVector implementation.
Header file for the EnableIf class template.
void smpAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:91
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:75
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
Header file for run time assertion macros.
RightOperand vec_
Right-hand side sparse vector of the multiplication expression.
Definition: TSMatSVecMultExpr.h:283
Base template for the MultTrait class.
Definition: MultTrait.h:141
void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:209
Header file for the reset shim.
void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:239
Header file for the isDefault shim.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: TSMatSVecMultExpr.h:174
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: TSMatSVecMultExpr.h:275
Header file for the RemoveReference type trait.
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TSMatSVecMultExpr.h:131
VT::ResultType VRT
Result type of the right-hand side sparse vector expression.
Definition: TSMatSVecMultExpr.h:98
Header file for the IsComputation type trait class.
Header file for the sparse vector SMP implementation.
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:105
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2379
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: TSMatSVecMultExpr.h:129
size_t columns(const Matrix< MT, SO > &m)
Returns the current number of columns of the matrix.
Definition: Matrix.h:154
MultTrait< MRT, VRT >::Type ResultType
Result type for expression template evaluations.
Definition: TSMatSVecMultExpr.h:128
Header file for basic type definitions.
TSMatSVecMultExpr(const MT &mat, const VT &vec)
Constructor for the TSMatSVecMultExpr class.
Definition: TSMatSVecMultExpr.h:160
RightOperand rightOperand() const
Returns the right-hand side sparse vector operand.
Definition: TSMatSVecMultExpr.h:241
Header file for the MatVecMultExpr base class.
Header file for the IsResizable type trait.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:79
MT::CompositeType MCT
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatSVecMultExpr.h:99
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.