All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TSVecTSMatMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_TSVECTSMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TSVECTSMATMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <stdexcept>
53 #include <blaze/math/shims/Reset.h>
59 #include <blaze/util/Assert.h>
61 #include <blaze/util/DisableIf.h>
63 #include <blaze/util/SelectType.h>
64 #include <blaze/util/Types.h>
66 
67 
68 namespace blaze {
69 
70 //=================================================================================================
71 //
72 // CLASS TSVECTSMATMULTEXPR
73 //
74 //=================================================================================================
75 
76 //*************************************************************************************************
83 template< typename VT // Type of the left-hand side sparse vector
84  , typename MT > // Type of the right-hand side sparse matrix
85 class TSVecTSMatMultExpr : public SparseVector< TSVecTSMatMultExpr<VT,MT>, true >
86  , private TVecMatMultExpr
87  , private Computation
88 {
89  private:
90  //**Type definitions****************************************************************************
91  typedef typename VT::ResultType VRT;
92  typedef typename MT::ResultType MRT;
93  typedef typename VT::CompositeType VCT;
94  typedef typename MT::CompositeType MCT;
95  //**********************************************************************************************
96 
97  public:
98  //**Type definitions****************************************************************************
103  typedef const ElementType ReturnType;
104  typedef const ResultType CompositeType;
105 
107  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type LeftOperand;
108 
110  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type RightOperand;
111 
113  typedef typename SelectType< IsComputation<VT>::value, const VRT, VCT >::Type LT;
114 
116  typedef MCT RT;
117  //**********************************************************************************************
118 
119  //**Constructor*********************************************************************************
125  explicit inline TSVecTSMatMultExpr( const VT& vec, const MT& mat )
126  : vec_( vec ) // Left-hand side sparse vector of the multiplication expression
127  , mat_( mat ) // Right-hand side sparse matrix of the multiplication expression
128  {
129  BLAZE_INTERNAL_ASSERT( vec_.size() == mat_.rows(), "Invalid vector and matrix sizes" );
130  }
131  //**********************************************************************************************
132 
133  //**Subscript operator**************************************************************************
139  inline ReturnType operator[]( size_t index ) const {
140  BLAZE_INTERNAL_ASSERT( index < mat_.columns(), "Invalid vector access index" );
141 
142  typedef typename RemoveReference<VCT>::Type::ConstIterator VectorIterator;
143  typedef typename RemoveReference<MCT>::Type::ConstIterator MatrixIterator;
144 
145  VCT x( vec_ ); // Evaluation of the left-hand side sparse vector operand
146  MCT A( mat_ ); // Evaluation of the right-hand side sparse matrix operand
147 
148  BLAZE_INTERNAL_ASSERT( x.size() == vec_.size() , "Invalid vector size" );
149  BLAZE_INTERNAL_ASSERT( A.rows() == mat_.rows() , "Invalid number of rows" );
150  BLAZE_INTERNAL_ASSERT( A.columns() == mat_.columns(), "Invalid number of columns" );
151 
152  ElementType res = ElementType();
153 
154  VectorIterator velem( x.begin() );
155  const VectorIterator vend( x.end() );
156  if( velem == vend ) {
157  reset( res );
158  return res;
159  }
160 
161  MatrixIterator melem( A.begin(index) );
162  const MatrixIterator mend( A.end(index) );
163  if( melem == mend ) {
164  reset( res );
165  return res;
166  }
167 
168  while( true ) {
169  if( velem->index() < melem->index() ) {
170  ++velem;
171  if( velem == vend ) break;
172  }
173  else if( melem->index() < velem->index() ) {
174  ++melem;
175  if( melem == mend ) break;
176  }
177  else {
178  res = velem->value() * melem->value();
179  ++velem;
180  ++melem;
181  break;
182  }
183  }
184 
185  if( melem != mend && velem != vend )
186  {
187  while( true ) {
188  if( velem->index() < melem->index() ) {
189  ++velem;
190  if( velem == vend ) break;
191  }
192  else if( melem->index() < velem->index() ) {
193  ++melem;
194  if( melem == mend ) break;
195  }
196  else {
197  res += velem->value() * melem->value();
198  ++velem;
199  if( velem == vend ) break;
200  ++melem;
201  if( melem == mend ) break;
202  }
203  }
204  }
205 
206  return res;
207  }
208  //**********************************************************************************************
209 
210  //**Size function*******************************************************************************
215  inline size_t size() const {
216  return mat_.columns();
217  }
218  //**********************************************************************************************
219 
220  //**NonZeros function***************************************************************************
225  inline size_t nonZeros() const {
226  return mat_.columns();
227  }
228  //**********************************************************************************************
229 
230  //**Left operand access*************************************************************************
235  inline LeftOperand leftOperand() const {
236  return vec_;
237  }
238  //**********************************************************************************************
239 
240  //**Right operand access************************************************************************
245  inline RightOperand rightOperand() const {
246  return mat_;
247  }
248  //**********************************************************************************************
249 
250  //**********************************************************************************************
256  template< typename T >
257  inline bool canAlias( const T* alias ) const {
258  return ( vec_.isAliased( alias ) || mat_.isAliased( alias ) );
259  }
260  //**********************************************************************************************
261 
262  //**********************************************************************************************
268  template< typename T >
269  inline bool isAliased( const T* alias ) const {
270  return ( vec_.isAliased( alias ) || mat_.isAliased( alias ) );
271  }
272  //**********************************************************************************************
273 
274  private:
275  //**Member variables****************************************************************************
278  //**********************************************************************************************
279 
280  //**Assignment to dense vectors*****************************************************************
293  template< typename VT1 > // Type of the target dense vector
294  friend inline void assign( DenseVector<VT1,true>& lhs, const TSVecTSMatMultExpr& rhs )
295  {
297 
298  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
299 
300  typedef typename RemoveReference<LT>::Type::ConstIterator VectorIterator;
301  typedef typename RemoveReference<RT>::Type::ConstIterator MatrixIterator;
302 
303  // Resetting the left-hand side target dense vector
304  reset( ~lhs );
305 
306  // Evaluation of the left-hand side sparse vector operand
307  LT x( rhs.vec_ );
308  if( x.nonZeros() == 0UL ) return;
309 
310  // Evaluation of the right-hand side sparse matrix operand
311  RT A( rhs.mat_ );
312 
313  // Checking the evaluated operands
314  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
315  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
316  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
317  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).size() , "Invalid vector size" );
318 
319  // Performing the sparse vector-sparse matrix multiplication
320  const VectorIterator vend( x.end() );
321 
322  for( size_t j=0UL; j<A.columns(); ++j )
323  {
324  const MatrixIterator mend ( A.end(j) );
325  MatrixIterator melem( A.begin(j) );
326 
327  if( melem == mend ) continue;
328 
329  VectorIterator velem( x.begin() );
330 
331  while( true ) {
332  if( velem->index() < melem->index() ) {
333  ++velem;
334  if( velem == vend ) break;
335  }
336  else if( melem->index() < velem->index() ) {
337  ++melem;
338  if( melem == mend ) break;
339  }
340  else {
341  (~lhs)[j] = velem->value() * melem->value();
342  ++velem;
343  ++melem;
344  break;
345  }
346  }
347 
348  if( velem != vend && melem != mend )
349  {
350  while( true ) {
351  if( velem->index() < melem->index() ) {
352  ++velem;
353  if( velem == vend ) break;
354  }
355  else if( melem->index() < velem->index() ) {
356  ++melem;
357  if( melem == mend ) break;
358  }
359  else {
360  (~lhs)[j] += velem->value() * melem->value();
361  ++velem;
362  if( velem == vend ) break;
363  ++melem;
364  if( melem == mend ) break;
365  }
366  }
367  }
368  }
369  }
371  //**********************************************************************************************
372 
373  //**Assignment to sparse vectors****************************************************************
386  template< typename VT1 > // Type of the target sparse vector
387  friend inline void assign( SparseVector<VT1,true>& lhs, const TSVecTSMatMultExpr& rhs )
388  {
390 
391  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
392 
393  typedef typename RemoveReference<LT>::Type::ConstIterator VectorIterator;
394  typedef typename RemoveReference<RT>::Type::ConstIterator MatrixIterator;
395 
396  // Evaluation of the left-hand side sparse vector operand
397  LT x( rhs.vec_ );
398  if( x.nonZeros() == 0UL ) return;
399 
400  // Evaluation of the right-hand side sparse matrix operand
401  RT A( rhs.mat_ );
402 
403  // Checking the evaluated operands
404  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
405  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
406  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
407  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).size() , "Invalid vector size" );
408 
409  // Performing the sparse vector-sparse matrix multiplication
410  ElementType accu;
411  const VectorIterator vend( x.end() );
412 
413  for( size_t j=0UL; j<A.columns(); ++j )
414  {
415  const MatrixIterator mend ( A.end(j) );
416  MatrixIterator melem( A.begin(j) );
417 
418  if( melem == mend ) continue;
419 
420  VectorIterator velem( x.begin() );
421 
422  reset( accu );
423 
424  while( true ) {
425  if( velem->index() < melem->index() ) {
426  ++velem;
427  if( velem == vend ) break;
428  }
429  else if( melem->index() < velem->index() ) {
430  ++melem;
431  if( melem == mend ) break;
432  }
433  else {
434  accu = velem->value() * melem->value();
435  ++velem;
436  ++melem;
437  break;
438  }
439  }
440 
441  if( velem != vend && melem != mend )
442  {
443  while( true ) {
444  if( velem->index() < melem->index() ) {
445  ++velem;
446  if( velem == vend ) break;
447  }
448  else if( melem->index() < velem->index() ) {
449  ++melem;
450  if( melem == mend ) break;
451  }
452  else {
453  accu += velem->value() * melem->value();
454  ++velem;
455  if( velem == vend ) break;
456  ++melem;
457  if( melem == mend ) break;
458  }
459  }
460  }
461 
462  if( !isDefault( accu ) )
463  (~lhs).insert( j, accu );
464  }
465  }
467  //**********************************************************************************************
468 
469  //**Addition assignment to dense vectors********************************************************
482  template< typename VT1 > // Type of the target dense vector
483  friend inline void addAssign( DenseVector<VT1,true>& lhs, const TSVecTSMatMultExpr& rhs )
484  {
486 
487  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
488 
489  typedef typename RemoveReference<LT>::Type::ConstIterator VectorIterator;
490  typedef typename RemoveReference<RT>::Type::ConstIterator MatrixIterator;
491 
492  // Evaluation of the left-hand side sparse vector operand
493  LT x( rhs.vec_ );
494  if( x.nonZeros() == 0UL ) return;
495 
496  // Evaluation of the right-hand side sparse matrix operand
497  RT A( rhs.mat_ );
498 
499  // Checking the evaluated operands
500  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
501  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
502  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
503  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).size() , "Invalid vector size" );
504 
505  // Performing the sparse matrix-sparse vector multiplication
506  const VectorIterator vend( x.end() );
507 
508  for( size_t j=0UL; j<A.columns(); ++j )
509  {
510  const MatrixIterator mend ( A.end(j) );
511  MatrixIterator melem( A.begin(j) );
512 
513  if( melem == mend ) continue;
514 
515  VectorIterator velem( x.begin() );
516 
517  while( true ) {
518  if( velem->index() < melem->index() ) {
519  ++velem;
520  if( velem == vend ) break;
521  }
522  else if( melem->index() < velem->index() ) {
523  ++melem;
524  if( melem == mend ) break;
525  }
526  else {
527  (~lhs)[j] += velem->value() * melem->value();
528  ++velem;
529  if( velem == vend ) break;
530  ++melem;
531  if( melem == mend ) break;
532  }
533  }
534  }
535  }
537  //**********************************************************************************************
538 
539  //**Addition assignment to sparse vectors*******************************************************
540  // No special implementation for the addition assignment to sparse vectors.
541  //**********************************************************************************************
542 
543  //**Subtraction assignment to dense vectors*****************************************************
556  template< typename VT1 > // Type of the target dense vector
557  friend inline void subAssign( DenseVector<VT1,true>& lhs, const TSVecTSMatMultExpr& rhs )
558  {
560 
561  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
562 
563  typedef typename RemoveReference<LT>::Type::ConstIterator VectorIterator;
564  typedef typename RemoveReference<RT>::Type::ConstIterator MatrixIterator;
565 
566  // Evaluation of the left-hand side sparse vector operand
567  LT x( rhs.vec_ );
568  if( x.nonZeros() == 0UL ) return;
569 
570  // Evaluation of the right-hand side sparse matrix operand
571  RT A( rhs.mat_ );
572 
573  // Checking the evaluated operands
574  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
575  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
576  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
577  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).size() , "Invalid vector size" );
578 
579  // Performing the sparse matrix-sparse vector multiplication
580  const VectorIterator vend( x.end() );
581 
582  for( size_t j=0UL; j<A.columns(); ++j )
583  {
584  const MatrixIterator mend ( A.end(j) );
585  MatrixIterator melem( A.begin(j) );
586 
587  if( melem == mend ) continue;
588 
589  VectorIterator velem( x.begin() );
590 
591  while( true ) {
592  if( velem->index() < melem->index() ) {
593  ++velem;
594  if( velem == vend ) break;
595  }
596  else if( melem->index() < velem->index() ) {
597  ++melem;
598  if( melem == mend ) break;
599  }
600  else {
601  (~lhs)[j] -= velem->value() * melem->value();
602  ++velem;
603  if( velem == vend ) break;
604  ++melem;
605  if( melem == mend ) break;
606  }
607  }
608  }
609  }
611  //**********************************************************************************************
612 
613  //**Subtraction assignment to sparse vectors****************************************************
614  // No special implementation for the subtraction assignment to sparse vectors.
615  //**********************************************************************************************
616 
617  //**Multiplication assignment to dense vectors**************************************************
630  template< typename VT1 > // Type of the target dense vector
631  friend inline void multAssign( DenseVector<VT1,true>& lhs, const TSVecTSMatMultExpr& rhs )
632  {
634 
638 
639  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
640 
641  const ResultType tmp( rhs );
642  multAssign( ~lhs, tmp );
643  }
645  //**********************************************************************************************
646 
647  //**Multiplication assignment to sparse vectors*************************************************
648  // No special implementation for the multiplication assignment to sparse vectors.
649  //**********************************************************************************************
650 
651  //**Compile time checks*************************************************************************
658  //**********************************************************************************************
659 };
660 //*************************************************************************************************
661 
662 
663 
664 
665 //=================================================================================================
666 //
667 // GLOBAL BINARY ARITHMETIC OPERATORS
668 //
669 //=================================================================================================
670 
671 //*************************************************************************************************
702 template< typename T1 // Type of the left-hand side sparse vector
703  , typename T2 > // Type of the right-hand side sparse matrix
704 inline const typename DisableIf< IsMatMatMultExpr<T2>, TSVecTSMatMultExpr<T1,T2> >::Type
706 {
708 
709  if( (~vec).size() != (~mat).rows() )
710  throw std::invalid_argument( "Vector and matrix sizes do not match" );
711 
712  return TSVecTSMatMultExpr<T1,T2>( ~vec, ~mat );
713 }
714 //*************************************************************************************************
715 
716 
717 
718 
719 //=================================================================================================
720 //
721 // EXPRESSION TRAIT SPECIALIZATIONS
722 //
723 //=================================================================================================
724 
725 //*************************************************************************************************
727 template< typename VT, typename MT >
728 struct SubvectorExprTrait< TSVecTSMatMultExpr<VT,MT> >
729 {
730  public:
731  //**********************************************************************************************
732  typedef typename MultExprTrait< VT, typename SubmatrixExprTrait<const MT>::Type >::Type Type;
733  //**********************************************************************************************
734 };
736 //*************************************************************************************************
737 
738 } // namespace blaze
739 
740 #endif
SelectType< IsComputation< VT >::value, const VRT, VCT >::Type LT
Type for the assignment of the left-hand side sparse vector operand.
Definition: TSVecTSMatMultExpr.h:113
void reset(DynamicMatrix< Type, SO > &m)
Resetting the given dense matrix.
Definition: DynamicMatrix.h:4512
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:3703
size_t size() const
Returns the current size/dimension of the vector.
Definition: TSVecTSMatMultExpr.h:215
Header file for the SparseVector base class.
bool isDefault(const DynamicMatrix< Type, SO > &m)
Returns whether the given dense matrix is in default state.
Definition: DynamicMatrix.h:4555
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:196
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2375
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:248
Header file for the Computation base class.
TSVecTSMatMultExpr< VT, MT > This
Type of this TSVecTSMatMultExpr instance.
Definition: TSVecTSMatMultExpr.h:99
Header file for the RequiresEvaluation type trait.
MT::CompositeType MCT
Composite type of the right-hand side sparse matrix expression.
Definition: TSVecTSMatMultExpr.h:94
LeftOperand leftOperand() const
Returns the left-hand side sparse vector operand.
Definition: TSVecTSMatMultExpr.h:235
TSVecTSMatMultExpr(const VT &vec, const MT &mat)
Constructor for the TSVecTSMatMultExpr class.
Definition: TSVecTSMatMultExpr.h:125
LeftOperand vec_
Left-hand side sparse vector of the multiplication expression.
Definition: TSVecTSMatMultExpr.h:276
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.
Constraint on the data type.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:250
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.
MCT RT
Type for the assignment of the right-hand side sparse matrix operand.
Definition: TSVecTSMatMultExpr.h:116
#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:2379
Expression object for sparse vector-sparse matrix multiplications.The TSVecTSMatMultExpr class repres...
Definition: Forward.h:146
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
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.
#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
size_t nonZeros() const
Returns an estimation for the number of non-zero elements in the sparse vector.
Definition: TSVecTSMatMultExpr.h:225
Constraints on the storage order of matrix types.
MultTrait< VRT, MRT >::Type ResultType
Result type for expression template evaluations.
Definition: TSVecTSMatMultExpr.h:100
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2373
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.
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TSVecTSMatMultExpr.h:110
const ResultType CompositeType
Data type for composite expression templates.
Definition: TSVecTSMatMultExpr.h:104
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: TSVecTSMatMultExpr.h:101
MT::ResultType MRT
Result type of the right-hand side sparse matrix expression.
Definition: TSVecTSMatMultExpr.h:92
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.
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
VT::CompositeType VCT
Composite type of the left-hand side sparse vector expression.
Definition: TSVecTSMatMultExpr.h:93
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
ResultType::ElementType ElementType
Resulting element type.
Definition: TSVecTSMatMultExpr.h:102
Header file for the isDefault shim.
Header file for the TVecMatMultExpr base class.
Header file for the RemoveReference type trait.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: TSVecTSMatMultExpr.h:269
Header file for the IsComputation type trait class.
RightOperand mat_
Right-hand side sparse matrix of the multiplication expression.
Definition: TSVecTSMatMultExpr.h:277
VT::ResultType VRT
Result type of the left-hand side sparse vector expression.
Definition: TSVecTSMatMultExpr.h:91
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TSVecTSMatMultExpr.h:103
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: TSVecTSMatMultExpr.h:139
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
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: TSVecTSMatMultExpr.h:107
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2370
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: TSVecTSMatMultExpr.h:257
Header file for basic type definitions.
#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: TransposeFlag.h:81
size_t rows(const Matrix< MT, SO > &m)
Returns the current number of rows of the matrix.
Definition: Matrix.h:138
#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
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
RightOperand rightOperand() const
Returns the right-hand side transpose sparse matrix operand.
Definition: TSVecTSMatMultExpr.h:245