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 
66 #include <blaze/util/Assert.h>
69 #include <blaze/util/SelectType.h>
70 #include <blaze/util/Types.h>
72 
73 
74 namespace blaze {
75 
76 //=================================================================================================
77 //
78 // CLASS SVECTSVECMULTEXPR
79 //
80 //=================================================================================================
81 
82 //*************************************************************************************************
89 template< typename VT1 // Type of the left-hand side sparse vector
90  , typename VT2 > // Type of the right-hand side sparse vector
91 class SVecTSVecMultExpr : public SparseMatrix< SVecTSVecMultExpr<VT1,VT2>, false >
92  , private VecTVecMultExpr
93  , private Computation
94 {
95  private:
96  //**Type definitions****************************************************************************
97  typedef typename VT1::ResultType RT1;
98  typedef typename VT2::ResultType RT2;
99  typedef typename VT1::ReturnType RN1;
100  typedef typename VT2::ReturnType RN2;
101  typedef typename VT1::CompositeType CT1;
102  typedef typename VT2::CompositeType CT2;
103  //**********************************************************************************************
104 
105  //**Return type evaluation**********************************************************************
107 
112  enum { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
113 
116  //**********************************************************************************************
117 
118  public:
119  //**Type definitions****************************************************************************
125 
128 
130  typedef const ResultType CompositeType;
131 
133  typedef typename SelectType< IsExpression<VT1>::value, const VT1, const VT1& >::Type LeftOperand;
134 
136  typedef typename SelectType< IsExpression<VT2>::value, const VT2, const VT2& >::Type RightOperand;
137 
139  typedef typename SelectType< IsComputation<VT1>::value, const RT1, CT1 >::Type LT;
140 
142  typedef typename SelectType< IsComputation<VT2>::value, const RT2, CT2 >::Type RT;
143  //**********************************************************************************************
144 
145  //**Compilation flags***************************************************************************
147  enum { smpAssignable = 0 };
148  //**********************************************************************************************
149 
150  //**Constructor*********************************************************************************
156  explicit inline SVecTSVecMultExpr( const VT1& lhs, const VT2& rhs )
157  : lhs_( lhs ) // Left-hand side sparse vector of the multiplication expression
158  , rhs_( rhs ) // Right-hand side sparse vector of the multiplication expression
159  {}
160  //**********************************************************************************************
161 
162  //**Access operator*****************************************************************************
169  inline ReturnType operator()( size_t i, size_t j ) const {
170  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
171  BLAZE_INTERNAL_ASSERT( j < rhs_.size(), "Invalid column access index" );
172 
173  return lhs_[i] * rhs_[j];
174  }
175  //**********************************************************************************************
176 
177  //**Rows function*******************************************************************************
182  inline size_t rows() const {
183  return lhs_.size();
184  }
185  //**********************************************************************************************
186 
187  //**Columns function****************************************************************************
192  inline size_t columns() const {
193  return rhs_.size();
194  }
195  //**********************************************************************************************
196 
197  //**NonZeros function***************************************************************************
202  inline size_t nonZeros() const {
203  return lhs_.nonZeros() * rhs_.nonZeros();
204  }
205  //**********************************************************************************************
206 
207  //**NonZeros function***************************************************************************
213  inline size_t nonZeros( size_t i ) const {
214  return ( isDefault( lhs_[i] ) )?( size_t(0) ):( rhs_.nonZeros(i) );
215  }
216  //**********************************************************************************************
217 
218  //**Left operand access*************************************************************************
223  inline LeftOperand leftOperand() const {
224  return lhs_;
225  }
226  //**********************************************************************************************
227 
228  //**Right operand access************************************************************************
233  inline RightOperand rightOperand() const {
234  return rhs_;
235  }
236  //**********************************************************************************************
237 
238  //**********************************************************************************************
244  template< typename T >
245  inline bool canAlias( const T* alias ) const {
246  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
247  }
248  //**********************************************************************************************
249 
250  //**********************************************************************************************
256  template< typename T >
257  inline bool isAliased( const T* alias ) const {
258  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
259  }
260  //**********************************************************************************************
261 
262  private:
263  //**Member variables****************************************************************************
266  //**********************************************************************************************
267 
268  //**Assignment to row-major dense matrices******************************************************
280  template< typename MT > // Type of the target dense matrix
281  friend inline void assign( DenseMatrix<MT,false>& lhs, const SVecTSVecMultExpr& rhs )
282  {
284 
285  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
286  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
287 
288  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
289  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
290 
291  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
292  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
293 
294  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
295  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
296  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
297  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
298 
299  const LeftIterator lend( x.end() );
300  const RightIterator rend( y.end() );
301 
302  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
303  if( !isDefault( lelem->value() ) ) {
304  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
305  (~lhs)(lelem->index(),relem->index()) = lelem->value() * relem->value();
306  }
307  }
308  }
309  }
311  //**********************************************************************************************
312 
313  //**Assignment to column-major dense matrices***************************************************
326  template< typename MT > // Type of the target dense matrix
327  friend inline void assign( DenseMatrix<MT,true>& lhs, const SVecTSVecMultExpr& rhs )
328  {
330 
332 
333  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
334  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
335 
336  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
337  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
338 
339  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
340  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
341 
342  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
343  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
344  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
345  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
346 
347  const LeftIterator lend( x.end() );
348  const RightIterator rend( y.end() );
349 
350  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
351  if( !isDefault( relem->value() ) ) {
352  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
353  (~lhs)(lelem->index(),relem->index()) = lelem->value() * relem->value();
354  }
355  }
356  }
357  }
359  //**********************************************************************************************
360 
361  //**Assignment to row-major sparse matrices*****************************************************
373  template< typename MT > // Type of the target sparse matrix
374  friend inline void assign( SparseMatrix<MT,false>& lhs, const SVecTSVecMultExpr& rhs )
375  {
377 
378  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
379  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
380 
381  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
382  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
383 
384  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
385  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
386 
387  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
388  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
389  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
390  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
391 
392  const LeftIterator lend( x.end() );
393  const RightIterator rend( y.end() );
394 
395  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
396  if( !isDefault( lelem->value() ) ) {
397  (~lhs).reserve( lelem->index(), y.nonZeros() );
398  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
399  (~lhs).append( lelem->index(), relem->index(), lelem->value() * relem->value() );
400  }
401  }
402  }
403  }
405  //**********************************************************************************************
406 
407  //**Assignment to column-major sparse matrices**************************************************
420  template< typename MT > // Type of the target sparse matrix
421  friend inline void assign( SparseMatrix<MT,true>& lhs, const SVecTSVecMultExpr& rhs )
422  {
424 
426 
427  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
428  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
429 
430  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
431  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
432 
433  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
434  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
435 
436  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
437  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
438  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
439  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
440 
441  const LeftIterator lend( x.end() );
442  const RightIterator rend( y.end() );
443 
444  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
445  if( !isDefault( relem->value() ) ) {
446  (~lhs).reserve( relem->index(), x.nonZeros() );
447  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
448  (~lhs).append( lelem->index(), relem->index(), lelem->value() * relem->value() );
449  }
450  }
451  }
452  }
454  //**********************************************************************************************
455 
456  //**Addition assignment to row-major dense matrices*********************************************
469  template< typename MT > // Type of the target dense matrix
470  friend inline void addAssign( DenseMatrix<MT,false>& lhs, const SVecTSVecMultExpr& rhs )
471  {
473 
474  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
475  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
476 
477  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
478  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
479 
480  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
481  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
482 
483  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
484  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
485  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
486  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
487 
488  const LeftIterator lend( x.end() );
489  const RightIterator rend( y.end() );
490 
491  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
492  if( !isDefault( lelem->value() ) ) {
493  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
494  (~lhs)(lelem->index(),relem->index()) += lelem->value() * relem->value();
495  }
496  }
497  }
498  }
500  //**********************************************************************************************
501 
502  //**Addition assignment to column-major dense matrices******************************************
515  template< typename MT > // Type of the target dense matrix
516  friend inline void addAssign( DenseMatrix<MT,true>& lhs, const SVecTSVecMultExpr& rhs )
517  {
519 
521 
522  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
523  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
524 
525  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
526  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
527 
528  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
529  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
530 
531  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
532  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
533  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
534  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
535 
536  const LeftIterator lend( x.end() );
537  const RightIterator rend( y.end() );
538 
539  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
540  if( !isDefault( relem->value() ) ) {
541  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
542  (~lhs)(lelem->index(),relem->index()) += lelem->value() * relem->value();
543  }
544  }
545  }
546  }
548  //**********************************************************************************************
549 
550  //**Addition assignment to sparse matrices******************************************************
551  // No special implementation for the addition assignment to sparse matrices.
552  //**********************************************************************************************
553 
554  //**Subtraction assignment to row-major dense matrices******************************************
567  template< typename MT > // Type of the target dense matrix
568  friend inline void subAssign( DenseMatrix<MT,false>& lhs, const SVecTSVecMultExpr& rhs )
569  {
571 
572  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
573  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
574 
575  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
576  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
577 
578  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
579  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
580 
581  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
582  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
583  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
584  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
585 
586  const LeftIterator lend( x.end() );
587  const RightIterator rend( y.end() );
588 
589  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
590  if( !isDefault( lelem->value() ) ) {
591  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
592  (~lhs)(lelem->index(),relem->index()) -= lelem->value() * relem->value();
593  }
594  }
595  }
596  }
598  //**********************************************************************************************
599 
600  //**Subtraction assignment to column-major dense matrices***************************************
613  template< typename MT > // Type of the target dense matrix
614  friend inline void subAssign( DenseMatrix<MT,true>& lhs, const SVecTSVecMultExpr& rhs )
615  {
617 
619 
620  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
621  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
622 
623  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
624  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
625 
626  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
627  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
628 
629  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
630  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
631  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
632  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
633 
634  const LeftIterator lend( x.end() );
635  const RightIterator rend( y.end() );
636 
637  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
638  if( !isDefault( relem->value() ) ) {
639  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
640  (~lhs)(lelem->index(),relem->index()) -= lelem->value() * relem->value();
641  }
642  }
643  }
644  }
646  //**********************************************************************************************
647 
648  //**Subtraction assignment to sparse matrices***************************************************
649  // No special implementation for the subtraction assignment to sparse matrices.
650  //**********************************************************************************************
651 
652  //**Multiplication assignment to dense matrices*************************************************
653  // No special implementation for the multiplication assignment to dense matrices.
654  //**********************************************************************************************
655 
656  //**Multiplication assignment to sparse matrices************************************************
657  // No special implementation for the multiplication assignment to sparse matrices.
658  //**********************************************************************************************
659 
660  //**Compile time checks*************************************************************************
668  //**********************************************************************************************
669 };
670 //*************************************************************************************************
671 
672 
673 
674 
675 //=================================================================================================
676 //
677 // GLOBAL BINARY ARITHMETIC OPERATORS
678 //
679 //=================================================================================================
680 
681 //*************************************************************************************************
708 template< typename T1 // Type of the left-hand side sparse vector
709  , typename T2 > // Type of the right-hand side sparse vector
710 inline const SVecTSVecMultExpr<T1,T2>
712 {
714 
715  return SVecTSVecMultExpr<T1,T2>( ~lhs, ~rhs );
716 }
717 //*************************************************************************************************
718 
719 
720 
721 
722 //=================================================================================================
723 //
724 // ROWS SPECIALIZATIONS
725 //
726 //=================================================================================================
727 
728 //*************************************************************************************************
730 template< typename VT1, typename VT2 >
731 struct Rows< SVecTSVecMultExpr<VT1,VT2> > : public Size<VT1>
732 {};
734 //*************************************************************************************************
735 
736 
737 
738 
739 //=================================================================================================
740 //
741 // COLUMNS SPECIALIZATIONS
742 //
743 //=================================================================================================
744 
745 //*************************************************************************************************
747 template< typename VT1, typename VT2 >
748 struct Columns< SVecTSVecMultExpr<VT1,VT2> > : public Size<VT2>
749 {};
751 //*************************************************************************************************
752 
753 
754 
755 
756 //=================================================================================================
757 //
758 // EXPRESSION TRAIT SPECIALIZATIONS
759 //
760 //=================================================================================================
761 
762 //*************************************************************************************************
764 template< typename VT1, typename VT2, bool AF >
765 struct SubmatrixExprTrait< SVecTSVecMultExpr<VT1,VT2>, AF >
766 {
767  public:
768  //**********************************************************************************************
769  typedef typename MultExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
770  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
771  //**********************************************************************************************
772 };
774 //*************************************************************************************************
775 
776 
777 //*************************************************************************************************
779 template< typename VT1, typename VT2 >
780 struct RowExprTrait< SVecTSVecMultExpr<VT1,VT2> >
781 {
782  public:
783  //**********************************************************************************************
784  typedef typename MultExprTrait< typename VT1::ReturnType, VT2 >::Type Type;
785  //**********************************************************************************************
786 };
788 //*************************************************************************************************
789 
790 
791 //*************************************************************************************************
793 template< typename VT1, typename VT2 >
794 struct ColumnExprTrait< SVecTSVecMultExpr<VT1,VT2> >
795 {
796  public:
797  //**********************************************************************************************
798  typedef typename MultExprTrait< VT1, typename VT2::ReturnType >::Type Type;
799  //**********************************************************************************************
800 };
802 //*************************************************************************************************
803 
804 } // namespace blaze
805 
806 #endif
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
Header file for the Rows type trait.
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:4838
#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
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
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:169
SelectType< IsComputation< VT1 >::value, const RT1, CT1 >::Type LT
Type for the assignment of the left-hand side dense vector operand.
Definition: SVecTSVecMultExpr.h:139
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2478
SVecTSVecMultExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the SVecTSVecMultExpr class.
Definition: SVecTSVecMultExpr.h:156
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:257
VT1::ResultType RT1
Result type of the left-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:97
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SVecTSVecMultExpr.h:257
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:695
Header file for the Computation base class.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SVecTSVecMultExpr.h:192
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SVecTSVecMultExpr.h:202
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SVecTSVecMultExpr.h:123
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SVecTSVecMultExpr.h:245
ResultType::ElementType ElementType
Resulting element type.
Definition: SVecTSVecMultExpr.h:124
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:102
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:182
SelectType< IsExpression< VT2 >::value, const VT2, const VT2 & >::Type RightOperand
Composite type of the right-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:136
LeftOperand lhs_
Left-hand side sparse vector of the multiplication expression.
Definition: SVecTSVecMultExpr.h:264
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SVecTSVecMultExpr.h:213
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_VECTVECMULTEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid vector/vector ...
Definition: VecTVecMultExpr.h:161
BLAZE_ALWAYS_INLINE 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:635
Header file for the Columns type trait.
#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:115
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:122
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:116
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2477
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:142
RightOperand rhs_
Right-hand side sparse vector of the multiplication expression.
Definition: SVecTSVecMultExpr.h:265
BLAZE_ALWAYS_INLINE 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:742
VT1::CompositeType CT1
Composite type of the left-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:101
VT2::ReturnType RN2
Return type of the right-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:100
RightOperand rightOperand() const
Returns the right-hand side sparse vector operand.
Definition: SVecTSVecMultExpr.h:233
SelectType< IsExpression< VT1 >::value, const VT1, const VT1 & >::Type LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:133
Header file for the isDefault shim.
BLAZE_ALWAYS_INLINE bool isDefault(const NonNumericProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: NonNumericProxy.h:874
Constraint on the data type.
const ResultType CompositeType
Data type for composite expression templates.
Definition: SVecTSVecMultExpr.h:130
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: SVecTSVecMultExpr.h:121
Constraint on the data type.
Header file for the RemoveReference type trait.
VT1::ReturnType RN1
Return type of the left-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:99
SVecTSVecMultExpr< VT1, VT2 > This
Type of this SVecTSVecMultExpr instance.
Definition: SVecTSVecMultExpr.h:120
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:2473
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:98
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SVecTSVecMultExpr.h:127
Header file for the Size type trait.
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:223
SelectType< IsComputation< VT2 >::value, const RT2, CT2 >::Type RT
Type for the assignment of the right-hand side dense vector operand.
Definition: SVecTSVecMultExpr.h:142
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
BLAZE_ALWAYS_INLINE 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:849