All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TDVecSMatMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_TDVECSMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TDVECSMATMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <stdexcept>
53 #include <blaze/math/shims/Reset.h>
65 #include <blaze/util/Assert.h>
67 #include <blaze/util/DisableIf.h>
68 #include <blaze/util/EnableIf.h>
70 #include <blaze/util/SelectType.h>
71 #include <blaze/util/Types.h>
73 
74 
75 namespace blaze {
76 
77 //=================================================================================================
78 //
79 // CLASS TDVECSMATMULTEXPR
80 //
81 //=================================================================================================
82 
83 //*************************************************************************************************
90 template< typename VT // Type of the left-hand side dense vector
91  , typename MT > // Type of the right-hand side sparse matrix
92 class TDVecSMatMultExpr : public DenseVector< TDVecSMatMultExpr<VT,MT>, true >
93  , private TVecMatMultExpr
94  , private Computation
95 {
96  private:
97  //**Type definitions****************************************************************************
98  typedef typename VT::ResultType VRT;
99  typedef typename MT::ResultType MRT;
100  typedef typename VT::CompositeType VCT;
101  typedef typename MT::CompositeType MCT;
102  //**********************************************************************************************
103 
104  //**********************************************************************************************
106  enum { evaluateVector = IsComputation<VT>::value || RequiresEvaluation<VT>::value };
107  //**********************************************************************************************
108 
109  //**********************************************************************************************
111  enum { evaluateMatrix = RequiresEvaluation<MT>::value };
112  //**********************************************************************************************
113 
114  //**********************************************************************************************
116 
120  template< typename T1 >
121  struct UseSMPAssign {
122  enum { value = ( evaluateVector || evaluateMatrix ) };
123  };
125  //**********************************************************************************************
126 
127  public:
128  //**Type definitions****************************************************************************
133  typedef const ElementType ReturnType;
134  typedef const ResultType CompositeType;
135 
137  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type LeftOperand;
138 
140  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type RightOperand;
141 
144 
147  //**********************************************************************************************
148 
149  //**Compilation flags***************************************************************************
151  enum { vectorizable = 0 };
152 
154  enum { smpAssignable = !evaluateVector && VT::smpAssignable &&
155  !evaluateMatrix && MT::smpAssignable };
156  //**********************************************************************************************
157 
158  //**Constructor*********************************************************************************
161  explicit inline TDVecSMatMultExpr( const VT& vec, const MT& mat )
162  : vec_( vec ) // Left-hand side dense vector of the multiplication expression
163  , mat_( mat ) // Right-hand side sparse matrix of the multiplication expression
164  {
165  BLAZE_INTERNAL_ASSERT( vec_.size() == mat.rows(), "Invalid vector and matrix sizes" );
166  }
167  //**********************************************************************************************
168 
169  //**Subscript operator**************************************************************************
175  inline ReturnType operator[]( size_t index ) const {
176  BLAZE_INTERNAL_ASSERT( index < mat_.columns(), "Invalid vector access index" );
177 
178  ElementType res;
179 
180  if( vec_.size() != 0UL ) {
181  res = vec_[0UL] * mat_(0UL,index);
182  for( size_t i=1UL; i<vec_.size(); ++i ) {
183  res += vec_[i] * mat_(i,index);
184  }
185  }
186  else {
187  reset( res );
188  }
189 
190  return res;
191  }
192  //**********************************************************************************************
193 
194  //**Size function*******************************************************************************
199  inline size_t size() const {
200  return mat_.columns();
201  }
202  //**********************************************************************************************
203 
204  //**Left operand access*************************************************************************
209  inline LeftOperand leftOperand() const {
210  return vec_;
211  }
212  //**********************************************************************************************
213 
214  //**Right operand access************************************************************************
219  inline RightOperand rightOperand() const {
220  return mat_;
221  }
222  //**********************************************************************************************
223 
224  //**********************************************************************************************
230  template< typename T >
231  inline bool canAlias( const T* alias ) const {
232  return ( vec_.isAliased( alias ) || mat_.isAliased( alias ) );
233  }
234  //**********************************************************************************************
235 
236  //**********************************************************************************************
242  template< typename T >
243  inline bool isAliased( const T* alias ) const {
244  return ( vec_.isAliased( alias ) || mat_.isAliased( alias ) );
245  }
246  //**********************************************************************************************
247 
248  //**********************************************************************************************
253  inline bool isAligned() const {
254  return vec_.isAligned();
255  }
256  //**********************************************************************************************
257 
258  //**********************************************************************************************
263  inline bool canSMPAssign() const {
264  return ( size() > SMP_TDVECSMATMULT_THRESHOLD );
265  }
266  //**********************************************************************************************
267 
268  private:
269  //**Member variables****************************************************************************
272  //**********************************************************************************************
273 
274  //**Assignment to dense vectors*****************************************************************
286  template< typename VT2 > // Type of the target dense vector
287  friend inline void assign( DenseVector<VT2,true>& lhs, const TDVecSMatMultExpr& rhs )
288  {
290 
291  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
292 
293  reset( ~lhs );
294 
295  if( rhs.mat_.rows() == 0UL ) return;
296 
297  LT x( serial( rhs.vec_ ) ); // Evaluation of the left-hand side dense vector operator
298  RT A( serial( rhs.mat_ ) ); // Evaluation of the right-hand side sparse matrix operator
299 
300  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
301  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
302  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
303  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).size() , "Invalid vector size" );
304 
305  TDVecSMatMultExpr::selectAssignKernel( ~lhs, x, A );
306  }
307  //**********************************************************************************************
308 
309  //**Optimized assignment to dense vectors*******************************************************
323  template< typename VT1 // Type of the left-hand side target vector
324  , typename VT2 // Type of the left-hand side vector operand
325  , typename MT1 > // Type of the right-hand side matrix operand
326  static inline void selectAssignKernel( VT1& y, const VT2& x, const MT1& A )
327  {
329 
330  for( size_t i=0UL; i<x.size(); ++i )
331  {
332  const ConstIterator end( A.end(i) );
333  ConstIterator element( A.begin(i) );
334 
335  for( ; element!=end; ++element ) {
337  isDefault( y[element->index()] ) )
338  y[element->index()] = x[i] * element->value();
339  else
340  y[element->index()] += x[i] * element->value();
341  }
342  }
343  }
345  //**********************************************************************************************
346 
347  //**Assignment to sparse vectors****************************************************************
359  template< typename VT2 > // Type of the target sparse vector
360  friend inline void assign( SparseVector<VT2,true>& lhs, const TDVecSMatMultExpr& rhs )
361  {
363 
367 
368  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
369 
370  const ResultType tmp( serial( rhs ) );
371  assign( ~lhs, tmp );
372  }
373  //**********************************************************************************************
374 
375  //**Addition assignment to dense vectors********************************************************
387  template< typename VT2 > // Type of the target dense vector
388  friend inline void addAssign( DenseVector<VT2,true>& lhs, const TDVecSMatMultExpr& rhs )
389  {
391 
392  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
393 
395 
396  if( rhs.mat_.rows() == 0UL ) {
397  return;
398  }
399 
400  LT x( serial( rhs.vec_ ) ); // Evaluation of the left-hand side dense vector operator
401  RT A( serial( rhs.mat_ ) ); // Evaluation of the right-hand side sparse matrix operator
402 
403  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
404  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
405  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
406  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).size() , "Invalid vector size" );
407 
408  TDVecSMatMultExpr::selectAddAssignKernel( ~lhs, x, A );
409  }
410  //**********************************************************************************************
411 
412  //**Optimized addition assignment to dense vectors*************************************************
426  template< typename VT1 // Type of the left-hand side target vector
427  , typename VT2 // Type of the left-hand side vector operand
428  , typename MT1 > // Type of the right-hand side matrix operand
429  static inline void selectAddAssignKernel( VT1& y, const VT2& x, const MT1& A )
430  {
432 
433  for( size_t i=0UL; i<x.size(); ++i )
434  {
435  const ConstIterator end( A.end(i) );
436  ConstIterator element( A.begin(i) );
437 
438  for( ; element!=end; ++element ) {
439  y[element->index()] += x[i] * element->value();
440  }
441  }
442  }
444  //**********************************************************************************************
445 
446  //**Addition assignment to sparse vectors*******************************************************
447  // No special implementation for the addition assignment to sparse vectors.
448  //**********************************************************************************************
449 
450  //**Subtraction assignment to dense vectors*****************************************************
462  template< typename VT2 > // Type of the target dense vector
463  friend inline void subAssign( DenseVector<VT2,true>& lhs, const TDVecSMatMultExpr& rhs )
464  {
466 
467  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
468 
470 
471  if( rhs.mat_.rows() == 0UL ) {
472  return;
473  }
474 
475  LT x( serial( rhs.vec_ ) ); // Evaluation of the left-hand side dense vector operator
476  RT A( serial( rhs.mat_ ) ); // Evaluation of the right-hand side sparse matrix operator
477 
478  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
479  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
480  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
481  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).size() , "Invalid vector size" );
482 
483  TDVecSMatMultExpr::selectSubAssignKernel( ~lhs, x, A );
484  }
485  //**********************************************************************************************
486 
487  //**Optimized subtraction assignment to dense vectors**********************************************
501  template< typename VT1 // Type of the left-hand side target vector
502  , typename VT2 // Type of the left-hand side vector operand
503  , typename MT1 > // Type of the right-hand side matrix operand
504  static inline void selectSubAssignKernel( VT1& y, const VT2& x, const MT1& A )
505  {
507 
508  for( size_t i=0UL; i<x.size(); ++i )
509  {
510  const ConstIterator end( A.end(i) );
511  ConstIterator element( A.begin(i) );
512 
513  for( ; element!=end; ++element ) {
514  y[element->index()] -= x[i] * element->value();
515  }
516  }
517  }
519  //**********************************************************************************************
520 
521  //**Subtraction assignment to sparse vectors****************************************************
522  // No special implementation for the subtraction assignment to sparse vectors.
523  //**********************************************************************************************
524 
525  //**Multiplication assignment to dense vectors**************************************************
537  template< typename VT2 > // Type of the target dense vector
538  friend inline void multAssign( DenseVector<VT2,true>& lhs, const TDVecSMatMultExpr& rhs )
539  {
541 
545 
546  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
547 
548  const ResultType tmp( serial( rhs ) );
549  multAssign( ~lhs, tmp );
550  }
551  //**********************************************************************************************
552 
553  //**Multiplication assignment to sparse vectors*************************************************
554  // No special implementation for the multiplication assignment to sparse vectors.
555  //**********************************************************************************************
556 
557  //**SMP assignment to dense vectors*************************************************************
571  template< typename VT2 > // Type of the target dense vector
572  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
574  {
576 
577  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
578 
579  reset( ~lhs );
580 
581  if( rhs.mat_.rows() == 0UL ) return;
582 
583  LT x( rhs.vec_ ); // Evaluation of the left-hand side dense vector operator
584  RT A( rhs.mat_ ); // Evaluation of the right-hand side sparse matrix operator
585 
586  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
587  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
588  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
589  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).size() , "Invalid vector size" );
590 
591  smpAssign( ~lhs, x * A );
592  }
593  //**********************************************************************************************
594 
595  //**SMP assignment to sparse vectors************************************************************
609  template< typename VT2 > // Type of the target sparse vector
610  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
612  {
614 
618 
619  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
620 
621  const ResultType tmp( rhs );
622  smpAssign( ~lhs, tmp );
623  }
624  //**********************************************************************************************
625 
626  //**SMP addition assignment to dense vectors****************************************************
640  template< typename VT2 > // Type of the target dense vector
641  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
643  {
645 
646  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
647 
649 
650  if( rhs.mat_.rows() == 0UL ) {
651  return;
652  }
653 
654  LT x( rhs.vec_ ); // Evaluation of the left-hand side dense vector operator
655  RT A( rhs.mat_ ); // Evaluation of the right-hand side sparse matrix operator
656 
657  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
658  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
659  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
660  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).size() , "Invalid vector size" );
661 
662  smpAddAssign( ~lhs, x * A );
663  }
664  //**********************************************************************************************
665 
666  //**SMP addition assignment to sparse vectors***************************************************
667  // No special implementation for the SMP addition assignment to sparse vectors.
668  //**********************************************************************************************
669 
670  //**SMP subtraction assignment to dense vectors*************************************************
684  template< typename VT2 > // Type of the target dense vector
685  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
687  {
689 
690  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
691 
693 
694  if( rhs.mat_.rows() == 0UL ) {
695  return;
696  }
697 
698  LT x( rhs.vec_ ); // Evaluation of the left-hand side dense vector operator
699  RT A( rhs.mat_ ); // Evaluation of the right-hand side sparse matrix operator
700 
701  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
702  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
703  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
704  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).size() , "Invalid vector size" );
705 
706  smpSubAssign( ~lhs, x * A );
707  }
708  //**********************************************************************************************
709 
710  //**SMP subtraction assignment to sparse vectors************************************************
711  // No special implementation for the SMP subtraction assignment to sparse vectors.
712  //**********************************************************************************************
713 
714  //**SMP multiplication assignment to dense vectors**********************************************
728  template< typename VT2 > // Type of the target dense vector
729  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
731  {
733 
737 
738  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
739 
740  const ResultType tmp( rhs );
741  smpMultAssign( ~lhs, tmp );
742  }
743  //**********************************************************************************************
744 
745  //**SMP multiplication assignment to sparse vectors*********************************************
746  // No special implementation for the SMP multiplication assignment to sparse vectors.
747  //**********************************************************************************************
748 
749  //**Compile time checks*************************************************************************
756  //**********************************************************************************************
757 };
758 //*************************************************************************************************
759 
760 
761 
762 
763 //=================================================================================================
764 //
765 // GLOBAL BINARY ARITHMETIC OPERATORS
766 //
767 //=================================================================================================
768 
769 //*************************************************************************************************
800 template< typename T1 // Type of the left-hand side dense vector
801  , typename T2 > // Type of the right-hand side sparse matrix
802 inline const typename DisableIf< IsMatMatMultExpr<T2>, TDVecSMatMultExpr<T1,T2> >::Type
804 {
806 
807  if( (~vec).size() != (~mat).rows() )
808  throw std::invalid_argument( "Vector and matrix sizes do not match" );
809 
810  return TDVecSMatMultExpr<T1,T2>( ~vec, ~mat );
811 }
812 //*************************************************************************************************
813 
814 
815 
816 
817 //=================================================================================================
818 //
819 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
820 //
821 //=================================================================================================
822 
823 //*************************************************************************************************
836 template< typename T1 // Type of the left-hand side dense vector
837  , typename T2 // Type of the right-hand side sparse matrix
838  , bool SO > // Storage order of the right-hand side sparse matrix
839 inline const typename EnableIf< IsMatMatMultExpr<T2>, MultExprTrait<T1,T2> >::Type::Type
841 {
843 
844  return ( vec * (~mat).leftOperand() ) * (~mat).rightOperand();
845 }
846 //*************************************************************************************************
847 
848 
849 
850 
851 //=================================================================================================
852 //
853 // EXPRESSION TRAIT SPECIALIZATIONS
854 //
855 //=================================================================================================
856 
857 //*************************************************************************************************
859 template< typename VT, typename MT, bool AF >
860 struct SubvectorExprTrait< TDVecSMatMultExpr<VT,MT>, AF >
861 {
862  public:
863  //**********************************************************************************************
864  typedef typename MultExprTrait< VT, typename SubmatrixExprTrait<const MT,AF>::Type >::Type Type;
865  //**********************************************************************************************
866 };
868 //*************************************************************************************************
869 
870 } // namespace blaze
871 
872 #endif
MT::ResultType MRT
Result type of the right-hand side sparse matrix expression.
Definition: TDVecSMatMultExpr.h:99
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: TDVecSMatMultExpr.h:209
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:4599
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:4329
friend EnableIf< UseSMPAssign< VT2 > >::Type smpMultAssign(DenseVector< VT2, true > &lhs, const TDVecSMatMultExpr &rhs)
SMP multiplication assignment of a transpose dense vector-sparse matrix multiplication to a dense vec...
Definition: TDVecSMatMultExpr.h:730
Expression object for transpose dense vector-sparse matrix multiplications.The TDVecSMatMultExpr clas...
Definition: Forward.h:134
bool isDefault(const DynamicMatrix< Type, SO > &m)
Returns whether the given dense matrix is in default state.
Definition: DynamicMatrix.h:4642
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:199
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: TDVecSMatMultExpr.h:137
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2408
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:251
Header file for the DenseVector base class.
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:690
RightOperand mat_
Right-hand side sparse matrix of the multiplication expression.
Definition: TDVecSMatMultExpr.h:271
Header file for the Computation base class.
ResultType::ElementType ElementType
Resulting element type.
Definition: TDVecSMatMultExpr.h:132
Header file for the RequiresEvaluation type trait.
friend EnableIf< UseSMPAssign< VT2 > >::Type smpAssign(SparseVector< VT2, true > &lhs, const TDVecSMatMultExpr &rhs)
SMP assignment of a transpose dense vector-sparse matrix multiplication to a sparse vector ( )...
Definition: TDVecSMatMultExpr.h:611
SelectType< evaluateVector, const VRT, VCT >::Type LT
Composite type of the left-hand side dense vector expression.
Definition: TDVecSMatMultExpr.h:143
const ResultType CompositeType
Data type for composite expression templates.
Definition: TDVecSMatMultExpr.h:134
friend void assign(SparseVector< VT2, true > &lhs, const TDVecSMatMultExpr &rhs)
Assignment of a transpose dense vector-sparse matrix multiplication to a sparse vector ( )...
Definition: TDVecSMatMultExpr.h:360
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:107
Constraint on the data type.
Constraint on the data type.
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
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.
friend void subAssign(DenseVector< VT2, true > &lhs, const TDVecSMatMultExpr &rhs)
Subtraction assignment of a transpose dense vector-sparse matrix multiplication to a dense vector ( )...
Definition: TDVecSMatMultExpr.h:463
Header file for the multiplication trait.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: TDVecSMatMultExpr.h:131
TDVecSMatMultExpr< VT, MT > This
Type of this TDVecSMatMultExpr instance.
Definition: TDVecSMatMultExpr.h:129
friend void multAssign(DenseVector< VT2, true > &lhs, const TDVecSMatMultExpr &rhs)
Multiplication assignment of a transpose dense vector-sparse matrix multiplication to a dense vector ...
Definition: TDVecSMatMultExpr.h:538
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2412
Header file for the IsMatMatMultExpr type trait class.
VT::CompositeType VCT
Composite type of the left-hand side dense vector expression.
Definition: TDVecSMatMultExpr.h:100
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Constraint on the data type.
friend EnableIf< UseSMPAssign< VT2 > >::Type smpAddAssign(DenseVector< VT2, true > &lhs, const TDVecSMatMultExpr &rhs)
Addition assignment of a transpose dense vector-sparse matrix multiplication to a dense vector ( )...
Definition: TDVecSMatMultExpr.h:642
TDVecSMatMultExpr(const VT &vec, const MT &mat)
Constructor for the TDVecSMatMultExpr class.
Definition: TDVecSMatMultExpr.h:161
#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
Constraints on the storage order of matrix types.
Constraint on the data type.
LeftOperand vec_
Left-hand side dense vector of the multiplication expression.
Definition: TDVecSMatMultExpr.h:270
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
VT::ResultType VRT
Result type of the left-hand side dense vector expression.
Definition: TDVecSMatMultExpr.h:98
Header file for the EnableIf class template.
Header file for the serial shim.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: TDVecSMatMultExpr.h:175
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TDVecSMatMultExpr.h:133
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:75
Header file for the SubmatrixExprTrait class template.
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a row-major dense or sparse matrix t...
Definition: StorageOrder.h:81
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: TDVecSMatMultExpr.h:253
Header file for run time assertion macros.
Base template for the MultTrait class.
Definition: MultTrait.h:141
MT::CompositeType MCT
Composite type of the right-hand side sparse matrix expression.
Definition: TDVecSMatMultExpr.h:101
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Header file for the reset shim.
Header file for the isDefault shim.
Header file for the TVecMatMultExpr base class.
friend void addAssign(DenseVector< VT2, true > &lhs, const TDVecSMatMultExpr &rhs)
Addition assignment of a transpose dense vector-sparse matrix multiplication to a dense vector ( )...
Definition: TDVecSMatMultExpr.h:388
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: TDVecSMatMultExpr.h:231
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: TDVecSMatMultExpr.h:243
MultTrait< VRT, MRT >::Type ResultType
Result type for expression template evaluations.
Definition: TDVecSMatMultExpr.h:130
SelectType< evaluateMatrix, const MRT, MCT >::Type RT
Composite type of the right-hand side sparse matrix expression.
Definition: TDVecSMatMultExpr.h:146
Header file for the RemoveReference type trait.
friend EnableIf< UseSMPAssign< VT2 > >::Type smpAssign(DenseVector< VT2, true > &lhs, const TDVecSMatMultExpr &rhs)
SMP assignment of a transpose dense vector-sparse matrix multiplication to a dense vector ( )...
Definition: TDVecSMatMultExpr.h:573
friend EnableIf< UseSMPAssign< VT2 > >::Type smpSubAssign(DenseVector< VT2, true > &lhs, const TDVecSMatMultExpr &rhs)
SMP subtraction assignment of a transpose dense vector-sparse matrix multiplication to a dense vector...
Definition: TDVecSMatMultExpr.h:686
friend void assign(DenseVector< VT2, true > &lhs, const TDVecSMatMultExpr &rhs)
Assignment of a transpose dense vector-sparse matrix multiplication to a dense vector ( )...
Definition: TDVecSMatMultExpr.h:287
#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:79
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:108
#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
RightOperand rightOperand() const
Returns the right-hand side sparse matrix operand.
Definition: TDVecSMatMultExpr.h:219
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2403
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
Header file for the SubvectorExprTrait class template.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: TDVecSMatMultExpr.h:263
Header file for the IsResizable type trait.
const size_t SMP_TDVECSMATMULT_THRESHOLD
SMP dense vector/row-major sparse matrix multiplication threshold.This threshold specifies when a den...
Definition: Thresholds.h:552
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TDVecSMatMultExpr.h:140
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
size_t rows(const Matrix< MT, SO > &m)
Returns the current number of rows of the matrix.
Definition: Matrix.h:154
#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
size_t size() const
Returns the current size/dimension of the vector.
Definition: TDVecSMatMultExpr.h:199
#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.