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****************************************************************************
264  LeftOperand lhs_;
265  RightOperand rhs_;
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  BLAZE_INTERNAL_ASSERT( (~lhs).capacity() >= rhs.nonZeros(), "Insufficient capacity" );
381 
382  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
383  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
384 
385  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
386  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
387 
388  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
389  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
390  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
391  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
392 
393  const LeftIterator lend( x.end() );
394  const RightIterator rend( y.end() );
395  size_t index( 0UL );
396 
397  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
398  if( !isDefault( lelem->value() ) ) {
399  for( ; index < lelem->index(); ++index ) {
400  (~lhs).finalize( index );
401  }
402  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
403  (~lhs).append( lelem->index(), relem->index(), lelem->value() * relem->value() );
404  }
405  (~lhs).finalize( index++ );
406  }
407  }
408 
409  for( ; index < x.size(); ++index ) {
410  (~lhs).finalize( index );
411  }
412  }
414  //**********************************************************************************************
415 
416  //**Assignment to column-major sparse matrices**************************************************
429  template< typename MT > // Type of the target sparse matrix
430  friend inline void assign( SparseMatrix<MT,true>& lhs, const SVecTSVecMultExpr& rhs )
431  {
433 
435 
436  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
437  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns() , "Invalid number of columns" );
438  BLAZE_INTERNAL_ASSERT( (~lhs).capacity() >= rhs.nonZeros(), "Insufficient capacity" );
439 
440  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
441  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
442 
443  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
444  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
445 
446  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
447  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
448  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
449  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
450 
451  const LeftIterator lend( x.end() );
452  const RightIterator rend( y.end() );
453  size_t index( 0UL );
454 
455  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
456  if( !isDefault( relem->value() ) ) {
457  for( ; index < relem->index(); ++index ) {
458  (~lhs).finalize( index );
459  }
460  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
461  (~lhs).append( lelem->index(), relem->index(), lelem->value() * relem->value() );
462  }
463  (~lhs).finalize( index++ );
464  }
465  }
466 
467  for( ; index < y.size(); ++index ) {
468  (~lhs).finalize( index );
469  }
470  }
472  //**********************************************************************************************
473 
474  //**Addition assignment to row-major dense matrices*********************************************
487  template< typename MT > // Type of the target dense matrix
488  friend inline void addAssign( DenseMatrix<MT,false>& lhs, const SVecTSVecMultExpr& rhs )
489  {
491 
492  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
493  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
494 
495  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
496  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
497 
498  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
499  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
500 
501  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
502  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
503  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
504  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
505 
506  const LeftIterator lend( x.end() );
507  const RightIterator rend( y.end() );
508 
509  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
510  if( !isDefault( lelem->value() ) ) {
511  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
512  (~lhs)(lelem->index(),relem->index()) += lelem->value() * relem->value();
513  }
514  }
515  }
516  }
518  //**********************************************************************************************
519 
520  //**Addition assignment to column-major dense matrices******************************************
533  template< typename MT > // Type of the target dense matrix
534  friend inline void addAssign( DenseMatrix<MT,true>& lhs, const SVecTSVecMultExpr& rhs )
535  {
537 
539 
540  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
541  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
542 
543  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
544  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
545 
546  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
547  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
548 
549  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
550  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
551  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
552  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
553 
554  const LeftIterator lend( x.end() );
555  const RightIterator rend( y.end() );
556 
557  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
558  if( !isDefault( relem->value() ) ) {
559  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
560  (~lhs)(lelem->index(),relem->index()) += lelem->value() * relem->value();
561  }
562  }
563  }
564  }
566  //**********************************************************************************************
567 
568  //**Addition assignment to sparse matrices******************************************************
569  // No special implementation for the addition assignment to sparse matrices.
570  //**********************************************************************************************
571 
572  //**Subtraction assignment to row-major dense matrices******************************************
585  template< typename MT > // Type of the target dense matrix
586  friend inline void subAssign( DenseMatrix<MT,false>& lhs, const SVecTSVecMultExpr& rhs )
587  {
589 
590  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
591  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
592 
593  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
594  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
595 
596  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
597  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
598 
599  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
600  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
601  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
602  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
603 
604  const LeftIterator lend( x.end() );
605  const RightIterator rend( y.end() );
606 
607  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
608  if( !isDefault( lelem->value() ) ) {
609  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
610  (~lhs)(lelem->index(),relem->index()) -= lelem->value() * relem->value();
611  }
612  }
613  }
614  }
616  //**********************************************************************************************
617 
618  //**Subtraction assignment to column-major dense matrices***************************************
631  template< typename MT > // Type of the target dense matrix
632  friend inline void subAssign( DenseMatrix<MT,true>& lhs, const SVecTSVecMultExpr& rhs )
633  {
635 
637 
638  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
639  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
640 
641  typedef typename RemoveReference<LT>::Type::ConstIterator LeftIterator;
642  typedef typename RemoveReference<RT>::Type::ConstIterator RightIterator;
643 
644  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
645  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
646 
647  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
648  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
649  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
650  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
651 
652  const LeftIterator lend( x.end() );
653  const RightIterator rend( y.end() );
654 
655  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
656  if( !isDefault( relem->value() ) ) {
657  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
658  (~lhs)(lelem->index(),relem->index()) -= lelem->value() * relem->value();
659  }
660  }
661  }
662  }
664  //**********************************************************************************************
665 
666  //**Subtraction assignment to sparse matrices***************************************************
667  // No special implementation for the subtraction assignment to sparse matrices.
668  //**********************************************************************************************
669 
670  //**Multiplication assignment to dense matrices*************************************************
671  // No special implementation for the multiplication assignment to dense matrices.
672  //**********************************************************************************************
673 
674  //**Multiplication assignment to sparse matrices************************************************
675  // No special implementation for the multiplication assignment to sparse matrices.
676  //**********************************************************************************************
677 
678  //**Compile time checks*************************************************************************
686  //**********************************************************************************************
687 };
688 //*************************************************************************************************
689 
690 
691 
692 
693 //=================================================================================================
694 //
695 // GLOBAL BINARY ARITHMETIC OPERATORS
696 //
697 //=================================================================================================
698 
699 //*************************************************************************************************
726 template< typename T1 // Type of the left-hand side sparse vector
727  , typename T2 > // Type of the right-hand side sparse vector
728 inline const SVecTSVecMultExpr<T1,T2>
730 {
732 
733  return SVecTSVecMultExpr<T1,T2>( ~lhs, ~rhs );
734 }
735 //*************************************************************************************************
736 
737 
738 
739 
740 //=================================================================================================
741 //
742 // ROWS SPECIALIZATIONS
743 //
744 //=================================================================================================
745 
746 //*************************************************************************************************
748 template< typename VT1, typename VT2 >
749 struct Rows< SVecTSVecMultExpr<VT1,VT2> > : public Size<VT1>
750 {};
752 //*************************************************************************************************
753 
754 
755 
756 
757 //=================================================================================================
758 //
759 // COLUMNS SPECIALIZATIONS
760 //
761 //=================================================================================================
762 
763 //*************************************************************************************************
765 template< typename VT1, typename VT2 >
766 struct Columns< SVecTSVecMultExpr<VT1,VT2> > : public Size<VT2>
767 {};
769 //*************************************************************************************************
770 
771 
772 
773 
774 //=================================================================================================
775 //
776 // EXPRESSION TRAIT SPECIALIZATIONS
777 //
778 //=================================================================================================
779 
780 //*************************************************************************************************
782 template< typename VT1, typename VT2, bool AF >
783 struct SubmatrixExprTrait< SVecTSVecMultExpr<VT1,VT2>, AF >
784 {
785  public:
786  //**********************************************************************************************
787  typedef typename MultExprTrait< typename SubvectorExprTrait<const VT1,AF>::Type
788  , typename SubvectorExprTrait<const VT2,AF>::Type >::Type Type;
789  //**********************************************************************************************
790 };
792 //*************************************************************************************************
793 
794 
795 //*************************************************************************************************
797 template< typename VT1, typename VT2 >
798 struct RowExprTrait< SVecTSVecMultExpr<VT1,VT2> >
799 {
800  public:
801  //**********************************************************************************************
802  typedef typename MultExprTrait< typename VT1::ReturnType, VT2 >::Type Type;
803  //**********************************************************************************************
804 };
806 //*************************************************************************************************
807 
808 
809 //*************************************************************************************************
811 template< typename VT1, typename VT2 >
812 struct ColumnExprTrait< SVecTSVecMultExpr<VT1,VT2> >
813 {
814  public:
815  //**********************************************************************************************
816  typedef typename MultExprTrait< VT1, typename VT2::ReturnType >::Type Type;
817  //**********************************************************************************************
818 };
820 //*************************************************************************************************
821 
822 } // namespace blaze
823 
824 #endif
VT1::ReturnType RN1
Return type of the left-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:99
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
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
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:8247
Header file for basic type definitions.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SVecTSVecMultExpr.h:257
#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:209
RightOperand rhs_
Right-hand side sparse vector of the multiplication expression.
Definition: SVecTSVecMultExpr.h:265
Header file for the ColumnExprTrait class template.
ResultType::ElementType ElementType
Resulting element type.
Definition: SVecTSVecMultExpr.h:124
LeftOperand lhs_
Left-hand side sparse vector of the multiplication expression.
Definition: SVecTSVecMultExpr.h:264
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2507
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix)
Returns the maximum capacity of the matrix.
Definition: Matrix.h:348
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:261
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:699
Header file for the Computation base class.
RightOperand rightOperand() const
Returns the right-hand side sparse vector operand.
Definition: SVecTSVecMultExpr.h:233
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SVecTSVecMultExpr.h:192
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:861
Constraint on the data type.
Header file for the SparseMatrix base class.
Constraint on the data type.
Header file for the MultExprTrait class template.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SVecTSVecMultExpr.h:169
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 IsTemporary type trait class.
Header file for the multiplication trait.
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
VT2::ResultType RT2
Result type of the right-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:98
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
VT2::CompositeType CT2
Composite type of the right-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:102
SVecTSVecMultExpr(const VT1 &lhs, const VT2 &rhs)
Constructor for the SVecTSVecMultExpr class.
Definition: SVecTSVecMultExpr.h:156
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
#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.
VT1::ResultType RT1
Result type of the left-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:97
const ResultType CompositeType
Data type for composite expression templates.
Definition: SVecTSVecMultExpr.h:130
#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
MultTrait< RT1, RT2 >::Type ResultType
Result type for expression template evaluations.
Definition: SVecTSVecMultExpr.h:121
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.
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SVecTSVecMultExpr.h:245
#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:2506
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.
SVecTSVecMultExpr< VT1, VT2 > This
Type of this SVecTSVecMultExpr instance.
Definition: SVecTSVecMultExpr.h:120
Base template for the MultTrait class.
Definition: MultTrait.h:150
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
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SVecTSVecMultExpr.h:122
LeftOperand leftOperand() const
Returns the left-hand side sparse vector operand.
Definition: SVecTSVecMultExpr.h:223
Header file for the isDefault shim.
Constraint on the data type.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SVecTSVecMultExpr.h:182
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SVecTSVecMultExpr.h:127
Constraint on the data type.
Header file for the RemoveReference type trait.
SelectType< IsExpression< VT2 >::value, const VT2, const VT2 & >::Type RightOperand
Composite type of the right-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:136
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:2502
SelectType< IsExpression< VT1 >::value, const VT1, const VT1 & >::Type LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:133
#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.
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.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SVecTSVecMultExpr.h:202
#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
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SVecTSVecMultExpr.h:123
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
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SVecTSVecMultExpr.h:213