All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SVecTSVecMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECTSVECMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SVECTSVECMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
61 #include <blaze/util/Assert.h>
64 #include <blaze/util/SelectType.h>
65 #include <blaze/util/Types.h>
67 
68 
69 namespace blaze {
70 
71 //=================================================================================================
72 //
73 // CLASS SVECTSVECMULTEXPR
74 //
75 //=================================================================================================
76 
77 //*************************************************************************************************
84 template< typename VT1 // Type of the left-hand side sparse vector
85  , typename VT2 > // Type of the right-hand side sparse vector
86 class SVecTSVecMultExpr : public SparseMatrix< SVecTSVecMultExpr<VT1,VT2>, false >
87  , private VecTVecMultExpr
88  , private Computation
89 {
90  private:
91  //**Type definitions****************************************************************************
92  typedef typename VT1::ResultType RT1;
93  typedef typename VT2::ResultType RT2;
94  typedef typename VT1::ReturnType RN1;
95  typedef typename VT2::ReturnType RN2;
96  typedef typename VT1::CompositeType CT1;
97  typedef typename VT2::CompositeType CT2;
98  //**********************************************************************************************
99 
100  //**Return type evaluation**********************************************************************
102 
107  enum { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
108 
111  //**********************************************************************************************
112 
113  public:
114  //**Type definitions****************************************************************************
120 
123 
125  typedef const ResultType CompositeType;
126 
128  typedef typename SelectType< IsExpression<VT1>::value, const VT1, const VT1& >::Type LeftOperand;
129 
131  typedef typename SelectType< IsExpression<VT2>::value, const VT2, const VT2& >::Type RightOperand;
132 
134  typedef typename SelectType< IsComputation<VT1>::value, const RT1, CT1 >::Type LT;
135 
137  typedef typename SelectType< IsComputation<VT2>::value, const RT2, CT2 >::Type RT;
138  //**********************************************************************************************
139 
140  //**Compilation flags***************************************************************************
142  enum { smpAssignable = 0 };
143  //**********************************************************************************************
144 
145  //**Constructor*********************************************************************************
151  explicit inline SVecTSVecMultExpr( const VT1& lhs, const VT2& rhs )
152  : lhs_( lhs ) // Left-hand side sparse vector of the multiplication expression
153  , rhs_( rhs ) // Right-hand side sparse vector of the multiplication expression
154  {}
155  //**********************************************************************************************
156 
157  //**Access operator*****************************************************************************
164  inline ReturnType operator()( size_t i, size_t j ) const {
165  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
166  BLAZE_INTERNAL_ASSERT( j < rhs_.size(), "Invalid column access index" );
167 
168  return lhs_[i] * rhs_[j];
169  }
170  //**********************************************************************************************
171 
172  //**Rows function*******************************************************************************
177  inline size_t rows() const {
178  return lhs_.size();
179  }
180  //**********************************************************************************************
181 
182  //**Columns function****************************************************************************
187  inline size_t columns() const {
188  return rhs_.size();
189  }
190  //**********************************************************************************************
191 
192  //**NonZeros function***************************************************************************
197  inline size_t nonZeros() const {
198  return lhs_.nonZeros() * rhs_.nonZeros();
199  }
200  //**********************************************************************************************
201 
202  //**NonZeros function***************************************************************************
208  inline size_t nonZeros( size_t i ) const {
209  return ( isDefault( lhs_[i] ) )?( size_t(0) ):( rhs_.nonZeros(i) );
210  }
211  //**********************************************************************************************
212 
213  //**Left operand access*************************************************************************
218  inline LeftOperand leftOperand() const {
219  return lhs_;
220  }
221  //**********************************************************************************************
222 
223  //**Right operand access************************************************************************
228  inline RightOperand rightOperand() const {
229  return rhs_;
230  }
231  //**********************************************************************************************
232 
233  //**********************************************************************************************
239  template< typename T >
240  inline bool canAlias( const T* alias ) const {
241  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
242  }
243  //**********************************************************************************************
244 
245  //**********************************************************************************************
251  template< typename T >
252  inline bool isAliased( const T* alias ) const {
253  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
254  }
255  //**********************************************************************************************
256 
257  private:
258  //**Member variables****************************************************************************
261  //**********************************************************************************************
262 
263  //**Assignment to row-major dense matrices******************************************************
275  template< typename MT > // Type of the target dense matrix
276  friend inline void assign( DenseMatrix<MT,false>& lhs, const SVecTSVecMultExpr& rhs )
277  {
279 
280  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
281  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
282 
283  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
284  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
285 
286  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
287  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
288 
289  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
290  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
291  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
292  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
293 
294  const LeftIterator lend( x.end() );
295  const RightIterator rend( y.end() );
296 
297  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
298  if( !isDefault( lelem->value() ) ) {
299  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
300  (~lhs)(lelem->index(),relem->index()) = lelem->value() * relem->value();
301  }
302  }
303  }
304  }
306  //**********************************************************************************************
307 
308  //**Assignment to column-major dense matrices***************************************************
321  template< typename MT > // Type of the target dense matrix
322  friend inline void assign( DenseMatrix<MT,true>& lhs, const SVecTSVecMultExpr& rhs )
323  {
325 
326  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
327  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
328 
329  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
330  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
331 
332  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
333  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
334 
335  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
336  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
337  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
338  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
339 
340  const LeftIterator lend( x.end() );
341  const RightIterator rend( y.end() );
342 
343  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
344  if( !isDefault( relem->value() ) ) {
345  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
346  (~lhs)(lelem->index(),relem->index()) = lelem->value() * relem->value();
347  }
348  }
349  }
350  }
352  //**********************************************************************************************
353 
354  //**Assignment to row-major sparse matrices*****************************************************
366  template< typename MT > // Type of the target sparse matrix
367  friend inline void assign( SparseMatrix<MT,false>& lhs, const SVecTSVecMultExpr& rhs )
368  {
370 
371  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
372  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
373 
374  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
375  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
376 
377  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
378  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
379 
380  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
381  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
382  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
383  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
384 
385  const LeftIterator lend( x.end() );
386  const RightIterator rend( y.end() );
387 
388  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
389  if( !isDefault( lelem->value() ) ) {
390  (~lhs).reserve( lelem->index(), y.nonZeros() );
391  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
392  (~lhs).append( lelem->index(), relem->index(), lelem->value() * relem->value() );
393  }
394  }
395  }
396  }
398  //**********************************************************************************************
399 
400  //**Assignment to column-major sparse matrices**************************************************
413  template< typename MT > // Type of the target sparse matrix
414  friend inline void assign( SparseMatrix<MT,true>& lhs, const SVecTSVecMultExpr& rhs )
415  {
417 
418  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
419  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
420 
421  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
422  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
423 
424  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
425  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
426 
427  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
428  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
429  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
430  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
431 
432  const LeftIterator lend( x.end() );
433  const RightIterator rend( y.end() );
434 
435  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
436  if( !isDefault( relem->value() ) ) {
437  (~lhs).reserve( relem->index(), x.nonZeros() );
438  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
439  (~lhs).append( lelem->index(), relem->index(), lelem->value() * relem->value() );
440  }
441  }
442  }
443  }
445  //**********************************************************************************************
446 
447  //**Addition assignment to row-major dense matrices*********************************************
460  template< typename MT > // Type of the target dense matrix
461  friend inline void addAssign( DenseMatrix<MT,false>& lhs, const SVecTSVecMultExpr& rhs )
462  {
464 
465  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
466  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
467 
468  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
469  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
470 
471  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
472  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
473 
474  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
475  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
476  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
477  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
478 
479  const LeftIterator lend( x.end() );
480  const RightIterator rend( y.end() );
481 
482  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
483  if( !isDefault( lelem->value() ) ) {
484  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
485  (~lhs)(lelem->index(),relem->index()) += lelem->value() * relem->value();
486  }
487  }
488  }
489  }
491  //**********************************************************************************************
492 
493  //**Addition assignment to column-major dense matrices******************************************
506  template< typename MT > // Type of the target dense matrix
507  friend inline void addAssign( DenseMatrix<MT,true>& lhs, const SVecTSVecMultExpr& rhs )
508  {
510 
511  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
512  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
513 
514  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
515  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
516 
517  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
518  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
519 
520  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
521  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
522  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
523  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
524 
525  const LeftIterator lend( x.end() );
526  const RightIterator rend( y.end() );
527 
528  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
529  if( !isDefault( relem->value() ) ) {
530  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
531  (~lhs)(lelem->index(),relem->index()) += lelem->value() * relem->value();
532  }
533  }
534  }
535  }
537  //**********************************************************************************************
538 
539  //**Addition assignment to sparse matrices******************************************************
540  // No special implementation for the addition assignment to sparse matrices.
541  //**********************************************************************************************
542 
543  //**Subtraction assignment to row-major dense matrices******************************************
556  template< typename MT > // Type of the target dense matrix
557  friend inline void subAssign( DenseMatrix<MT,false>& lhs, const SVecTSVecMultExpr& rhs )
558  {
560 
561  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
562  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
563 
564  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
565  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
566 
567  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
568  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
569 
570  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
571  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
572  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
573  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
574 
575  const LeftIterator lend( x.end() );
576  const RightIterator rend( y.end() );
577 
578  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
579  if( !isDefault( lelem->value() ) ) {
580  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
581  (~lhs)(lelem->index(),relem->index()) -= lelem->value() * relem->value();
582  }
583  }
584  }
585  }
587  //**********************************************************************************************
588 
589  //**Subtraction assignment to column-major dense matrices***************************************
602  template< typename MT > // Type of the target dense matrix
603  friend inline void subAssign( DenseMatrix<MT,true>& lhs, const SVecTSVecMultExpr& rhs )
604  {
606 
607  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
608  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
609 
610  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
611  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
612 
613  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
614  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
615 
616  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
617  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
618  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
619  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
620 
621  const LeftIterator lend( x.end() );
622  const RightIterator rend( y.end() );
623 
624  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
625  if( !isDefault( relem->value() ) ) {
626  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
627  (~lhs)(lelem->index(),relem->index()) -= lelem->value() * relem->value();
628  }
629  }
630  }
631  }
633  //**********************************************************************************************
634 
635  //**Subtraction assignment to sparse matrices***************************************************
636  // No special implementation for the subtraction assignment to sparse matrices.
637  //**********************************************************************************************
638 
639  //**Multiplication assignment to dense matrices*************************************************
640  // No special implementation for the multiplication assignment to dense matrices.
641  //**********************************************************************************************
642 
643  //**Multiplication assignment to sparse matrices************************************************
644  // No special implementation for the multiplication assignment to sparse matrices.
645  //**********************************************************************************************
646 
647  //**Compile time checks*************************************************************************
654  //**********************************************************************************************
655 };
656 //*************************************************************************************************
657 
658 
659 
660 
661 //=================================================================================================
662 //
663 // GLOBAL BINARY ARITHMETIC OPERATORS
664 //
665 //=================================================================================================
666 
667 //*************************************************************************************************
694 template< typename T1 // Type of the left-hand side sparse vector
695  , typename T2 > // Type of the right-hand side sparse vector
696 inline const SVecTSVecMultExpr<T1,T2>
698 {
700 
701  return SVecTSVecMultExpr<T1,T2>( ~lhs, ~rhs );
702 }
703 //*************************************************************************************************
704 
705 
706 
707 
708 //=================================================================================================
709 //
710 // EXPRESSION TRAIT SPECIALIZATIONS
711 //
712 //=================================================================================================
713 
714 //*************************************************************************************************
716 template< typename VT1, typename VT2, bool AF >
717 struct SubmatrixExprTrait< SVecTSVecMultExpr<VT1,VT2>, AF >
718 {
719  public:
720  //**********************************************************************************************
721  typedef typename MultExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
722  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
723  //**********************************************************************************************
724 };
726 //*************************************************************************************************
727 
728 
729 //*************************************************************************************************
731 template< typename VT1, typename VT2 >
732 struct RowExprTrait< SVecTSVecMultExpr<VT1,VT2> >
733 {
734  public:
735  //**********************************************************************************************
736  typedef typename MultExprTrait< typename VT1::ReturnType, VT2 >::Type Type;
737  //**********************************************************************************************
738 };
740 //*************************************************************************************************
741 
742 
743 //*************************************************************************************************
745 template< typename VT1, typename VT2 >
746 struct ColumnExprTrait< SVecTSVecMultExpr<VT1,VT2> >
747 {
748  public:
749  //**********************************************************************************************
750  typedef typename MultExprTrait< VT1, typename VT2::ReturnType >::Type Type;
751  //**********************************************************************************************
752 };
754 //*************************************************************************************************
755 
756 } // namespace blaze
757 
758 #endif
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
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
#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
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
Header file for the ColumnExprTrait class template.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SVecTSVecMultExpr.h:164
SelectType< IsComputation< VT1 >::value, const RT1, CT1 >::Type LT
Type for the assignment of the left-hand side dense vector operand.
Definition: SVecTSVecMultExpr.h:134
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2408
SVecTSVecMultExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the SVecTSVecMultExpr class.
Definition: SVecTSVecMultExpr.h:151
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:251
VT1::ResultType RT1
Result type of the left-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:92
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SVecTSVecMultExpr.h:252
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
Header file for the Computation base class.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SVecTSVecMultExpr.h:187
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SVecTSVecMultExpr.h:197
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SVecTSVecMultExpr.h:118
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SVecTSVecMultExpr.h:240
ResultType::ElementType ElementType
Resulting element type.
Definition: SVecTSVecMultExpr.h:119
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Constraint on the data type.
Header file for the SparseMatrix base class.
Constraint on the data type.
Header file for the MultExprTrait class template.
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
VT2::CompositeType CT2
Composite type of the right-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:97
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SVecTSVecMultExpr.h:177
SelectType< IsExpression< VT2 >::value, const VT2, const VT2 & >::Type RightOperand
Composite type of the right-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:131
LeftOperand lhs_
Left-hand side sparse vector of the multiplication expression.
Definition: SVecTSVecMultExpr.h:259
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SVecTSVecMultExpr.h:208
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2412
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:271
#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.
Expression object for sparse vector-sparse vector outer products.The SVecTSVecMultExpr class represen...
Definition: Forward.h:124
MultExprTrait< RN1, RN2 >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SVecTSVecMultExpr.h:110
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Header file for the VecTVecMultExpr base class.
Header file for the serial shim.
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SVecTSVecMultExpr.h:117
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2407
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
RightOperand rhs_
Right-hand side sparse vector of the multiplication expression.
Definition: SVecTSVecMultExpr.h:260
VT1::CompositeType CT1
Composite type of the left-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:96
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:301
VT2::ReturnType RN2
Return type of the right-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:95
RightOperand rightOperand() const
Returns the right-hand side sparse vector operand.
Definition: SVecTSVecMultExpr.h:228
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:331
SelectType< IsExpression< VT1 >::value, const VT1, const VT1 & >::Type LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:128
Header file for the isDefault shim.
const ResultType CompositeType
Data type for composite expression templates.
Definition: SVecTSVecMultExpr.h:125
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: SVecTSVecMultExpr.h:116
Header file for the RemoveReference type trait.
VT1::ReturnType RN1
Return type of the left-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:94
SVecTSVecMultExpr< VT1, VT2 > This
Type of this SVecTSVecMultExpr instance.
Definition: SVecTSVecMultExpr.h:115
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
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.
VT2::ResultType RT2
Result type of the right-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:93
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SVecTSVecMultExpr.h:122
Evaluation of the resulting expression type of a multiplication.Via this type trait it is possible to...
Definition: MultExprTrait.h:137
Size type of the Blaze library.
#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
LeftOperand leftOperand() const
Returns the left-hand side sparse vector operand.
Definition: SVecTSVecMultExpr.h:218
SelectType< IsComputation< VT2 >::value, const RT2, CT2 >::Type RT
Type for the assignment of the right-hand side dense vector operand.
Definition: SVecTSVecMultExpr.h:137
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.