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 
43 #include <blaze/math/Aliases.h>
50 #include <blaze/math/Exception.h>
69 #include <blaze/util/Assert.h>
72 #include <blaze/util/mpl/If.h>
73 #include <blaze/util/Types.h>
75 
76 
77 namespace blaze {
78 
79 //=================================================================================================
80 //
81 // CLASS SVECTSVECMULTEXPR
82 //
83 //=================================================================================================
84 
85 //*************************************************************************************************
92 template< typename VT1 // Type of the left-hand side sparse vector
93  , typename VT2 > // Type of the right-hand side sparse vector
94 class SVecTSVecMultExpr : public SparseMatrix< SVecTSVecMultExpr<VT1,VT2>, false >
95  , private VecTVecMultExpr
96  , private Computation
97 {
98  private:
99  //**Type definitions****************************************************************************
106  //**********************************************************************************************
107 
108  //**Return type evaluation**********************************************************************
110 
115  enum : bool { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
116 
119  //**********************************************************************************************
120 
121  public:
122  //**Type definitions****************************************************************************
128 
131 
133  typedef const ResultType CompositeType;
134 
136  typedef If_< IsExpression<VT1>, const VT1, const VT1& > LeftOperand;
137 
139  typedef If_< IsExpression<VT2>, const VT2, const VT2& > RightOperand;
140 
142  typedef If_< IsComputation<VT1>, const RT1, CT1 > LT;
143 
145  typedef If_< IsComputation<VT2>, const RT2, CT2 > RT;
146  //**********************************************************************************************
147 
148  //**Compilation flags***************************************************************************
150  enum : bool { smpAssignable = false };
151  //**********************************************************************************************
152 
153  //**Constructor*********************************************************************************
159  explicit inline SVecTSVecMultExpr( const VT1& lhs, const VT2& rhs ) noexcept
160  : lhs_( lhs ) // Left-hand side sparse vector of the multiplication expression
161  , rhs_( rhs ) // Right-hand side sparse vector of the multiplication expression
162  {}
163  //**********************************************************************************************
164 
165  //**Access operator*****************************************************************************
172  inline ReturnType operator()( size_t i, size_t j ) const {
173  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
174  BLAZE_INTERNAL_ASSERT( j < rhs_.size(), "Invalid column access index" );
175 
176  return lhs_[i] * rhs_[j];
177  }
178  //**********************************************************************************************
179 
180  //**At function*********************************************************************************
188  inline ReturnType at( size_t i, size_t j ) const {
189  if( i >= lhs_.size() ) {
190  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
191  }
192  if( j >= rhs_.size() ) {
193  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
194  }
195  return (*this)(i,j);
196  }
197  //**********************************************************************************************
198 
199  //**Rows function*******************************************************************************
204  inline size_t rows() const noexcept {
205  return lhs_.size();
206  }
207  //**********************************************************************************************
208 
209  //**Columns function****************************************************************************
214  inline size_t columns() const noexcept {
215  return rhs_.size();
216  }
217  //**********************************************************************************************
218 
219  //**NonZeros function***************************************************************************
224  inline size_t nonZeros() const {
225  return lhs_.nonZeros() * rhs_.nonZeros();
226  }
227  //**********************************************************************************************
228 
229  //**NonZeros function***************************************************************************
235  inline size_t nonZeros( size_t i ) const {
236  return ( isDefault( lhs_[i] ) )?( size_t(0) ):( rhs_.nonZeros(i) );
237  }
238  //**********************************************************************************************
239 
240  //**Left operand access*************************************************************************
245  inline LeftOperand leftOperand() const noexcept {
246  return lhs_;
247  }
248  //**********************************************************************************************
249 
250  //**Right operand access************************************************************************
255  inline RightOperand rightOperand() const noexcept {
256  return rhs_;
257  }
258  //**********************************************************************************************
259 
260  //**********************************************************************************************
266  template< typename T >
267  inline bool canAlias( const T* alias ) const noexcept {
268  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
269  }
270  //**********************************************************************************************
271 
272  //**********************************************************************************************
278  template< typename T >
279  inline bool isAliased( const T* alias ) const noexcept {
280  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
281  }
282  //**********************************************************************************************
283 
284  private:
285  //**Member variables****************************************************************************
286  LeftOperand lhs_;
287  RightOperand rhs_;
288  //**********************************************************************************************
289 
290  //**Assignment to row-major dense matrices******************************************************
302  template< typename MT > // Type of the target dense matrix
303  friend inline void assign( DenseMatrix<MT,false>& lhs, const SVecTSVecMultExpr& rhs )
304  {
306 
307  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
308  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
309 
310  typedef ConstIterator_< RemoveReference_<LT> > LeftIterator;
311  typedef ConstIterator_< RemoveReference_<RT> > RightIterator;
312 
313  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
314  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
315 
316  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
317  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
318  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
319  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
320 
321  const LeftIterator lend( x.end() );
322  const RightIterator rend( y.end() );
323 
324  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
325  if( !isDefault( lelem->value() ) ) {
326  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
327  (~lhs)(lelem->index(),relem->index()) = lelem->value() * relem->value();
328  }
329  }
330  }
331  }
333  //**********************************************************************************************
334 
335  //**Assignment to column-major dense matrices***************************************************
348  template< typename MT > // Type of the target dense matrix
349  friend inline void assign( DenseMatrix<MT,true>& lhs, const SVecTSVecMultExpr& rhs )
350  {
352 
354 
355  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
356  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
357 
358  typedef ConstIterator_< RemoveReference_<LT> > LeftIterator;
359  typedef ConstIterator_< RemoveReference_<RT> > RightIterator;
360 
361  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
362  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
363 
364  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
365  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
366  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
367  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
368 
369  const LeftIterator lend( x.end() );
370  const RightIterator rend( y.end() );
371 
372  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
373  if( !isDefault( relem->value() ) ) {
374  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
375  (~lhs)(lelem->index(),relem->index()) = lelem->value() * relem->value();
376  }
377  }
378  }
379  }
381  //**********************************************************************************************
382 
383  //**Assignment to row-major sparse matrices*****************************************************
395  template< typename MT > // Type of the target sparse matrix
396  friend inline void assign( SparseMatrix<MT,false>& lhs, const SVecTSVecMultExpr& rhs )
397  {
399 
400  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
401  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns() , "Invalid number of columns" );
402  BLAZE_INTERNAL_ASSERT( (~lhs).capacity() >= rhs.nonZeros(), "Insufficient capacity" );
403 
404  typedef ConstIterator_< RemoveReference_<LT> > LeftIterator;
405  typedef ConstIterator_< RemoveReference_<RT> > RightIterator;
406 
407  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
408  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
409 
410  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
411  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
412  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
413  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
414 
415  const LeftIterator lend( x.end() );
416  const RightIterator rend( y.end() );
417  size_t index( 0UL );
418 
419  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
420  if( !isDefault( lelem->value() ) ) {
421  for( ; index < lelem->index(); ++index ) {
422  (~lhs).finalize( index );
423  }
424  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
425  (~lhs).append( lelem->index(), relem->index(), lelem->value() * relem->value() );
426  }
427  (~lhs).finalize( index++ );
428  }
429  }
430 
431  for( ; index < x.size(); ++index ) {
432  (~lhs).finalize( index );
433  }
434  }
436  //**********************************************************************************************
437 
438  //**Assignment to column-major sparse matrices**************************************************
451  template< typename MT > // Type of the target sparse matrix
452  friend inline void assign( SparseMatrix<MT,true>& lhs, const SVecTSVecMultExpr& rhs )
453  {
455 
457 
458  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
459  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns() , "Invalid number of columns" );
460  BLAZE_INTERNAL_ASSERT( (~lhs).capacity() >= rhs.nonZeros(), "Insufficient capacity" );
461 
462  typedef ConstIterator_< RemoveReference_<LT> > LeftIterator;
463  typedef ConstIterator_< RemoveReference_<RT> > RightIterator;
464 
465  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
466  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
467 
468  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
469  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
470  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
471  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
472 
473  const LeftIterator lend( x.end() );
474  const RightIterator rend( y.end() );
475  size_t index( 0UL );
476 
477  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
478  if( !isDefault( relem->value() ) ) {
479  for( ; index < relem->index(); ++index ) {
480  (~lhs).finalize( index );
481  }
482  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
483  (~lhs).append( lelem->index(), relem->index(), lelem->value() * relem->value() );
484  }
485  (~lhs).finalize( index++ );
486  }
487  }
488 
489  for( ; index < y.size(); ++index ) {
490  (~lhs).finalize( index );
491  }
492  }
494  //**********************************************************************************************
495 
496  //**Addition assignment to row-major dense matrices*********************************************
509  template< typename MT > // Type of the target dense matrix
510  friend inline void addAssign( DenseMatrix<MT,false>& lhs, const SVecTSVecMultExpr& rhs )
511  {
513 
514  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
515  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
516 
517  typedef ConstIterator_< RemoveReference_<LT> > LeftIterator;
518  typedef ConstIterator_< RemoveReference_<RT> > RightIterator;
519 
520  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
521  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
522 
523  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
524  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
525  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
526  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
527 
528  const LeftIterator lend( x.end() );
529  const RightIterator rend( y.end() );
530 
531  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
532  if( !isDefault( lelem->value() ) ) {
533  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
534  (~lhs)(lelem->index(),relem->index()) += lelem->value() * relem->value();
535  }
536  }
537  }
538  }
540  //**********************************************************************************************
541 
542  //**Addition assignment to column-major dense matrices******************************************
555  template< typename MT > // Type of the target dense matrix
556  friend inline void addAssign( DenseMatrix<MT,true>& lhs, const SVecTSVecMultExpr& rhs )
557  {
559 
561 
562  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
563  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
564 
565  typedef ConstIterator_< RemoveReference_<LT> > LeftIterator;
566  typedef ConstIterator_< RemoveReference_<RT> > RightIterator;
567 
568  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
569  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
570 
571  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
572  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
573  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
574  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
575 
576  const LeftIterator lend( x.end() );
577  const RightIterator rend( y.end() );
578 
579  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
580  if( !isDefault( relem->value() ) ) {
581  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
582  (~lhs)(lelem->index(),relem->index()) += lelem->value() * relem->value();
583  }
584  }
585  }
586  }
588  //**********************************************************************************************
589 
590  //**Addition assignment to sparse matrices******************************************************
591  // No special implementation for the addition assignment to sparse matrices.
592  //**********************************************************************************************
593 
594  //**Subtraction assignment to row-major dense matrices******************************************
607  template< typename MT > // Type of the target dense matrix
608  friend inline void subAssign( DenseMatrix<MT,false>& lhs, const SVecTSVecMultExpr& rhs )
609  {
611 
612  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
613  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
614 
615  typedef ConstIterator_< RemoveReference_<LT> > LeftIterator;
616  typedef ConstIterator_< RemoveReference_<RT> > RightIterator;
617 
618  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
619  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
620 
621  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
622  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
623  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
624  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
625 
626  const LeftIterator lend( x.end() );
627  const RightIterator rend( y.end() );
628 
629  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
630  if( !isDefault( lelem->value() ) ) {
631  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
632  (~lhs)(lelem->index(),relem->index()) -= lelem->value() * relem->value();
633  }
634  }
635  }
636  }
638  //**********************************************************************************************
639 
640  //**Subtraction assignment to column-major dense matrices***************************************
653  template< typename MT > // Type of the target dense matrix
654  friend inline void subAssign( DenseMatrix<MT,true>& lhs, const SVecTSVecMultExpr& rhs )
655  {
657 
659 
660  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
661  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
662 
663  typedef ConstIterator_< RemoveReference_<LT> > LeftIterator;
664  typedef ConstIterator_< RemoveReference_<RT> > RightIterator;
665 
666  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
667  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
668 
669  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
670  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
671  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
672  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
673 
674  const LeftIterator lend( x.end() );
675  const RightIterator rend( y.end() );
676 
677  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
678  if( !isDefault( relem->value() ) ) {
679  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
680  (~lhs)(lelem->index(),relem->index()) -= lelem->value() * relem->value();
681  }
682  }
683  }
684  }
686  //**********************************************************************************************
687 
688  //**Subtraction assignment to sparse matrices***************************************************
689  // No special implementation for the subtraction assignment to sparse matrices.
690  //**********************************************************************************************
691 
692  //**Multiplication assignment to dense matrices*************************************************
693  // No special implementation for the multiplication assignment to dense matrices.
694  //**********************************************************************************************
695 
696  //**Multiplication assignment to sparse matrices************************************************
697  // No special implementation for the multiplication assignment to sparse matrices.
698  //**********************************************************************************************
699 
700  //**Compile time checks*************************************************************************
708  //**********************************************************************************************
709 };
710 //*************************************************************************************************
711 
712 
713 
714 
715 //=================================================================================================
716 //
717 // GLOBAL BINARY ARITHMETIC OPERATORS
718 //
719 //=================================================================================================
720 
721 //*************************************************************************************************
748 template< typename T1 // Type of the left-hand side sparse vector
749  , typename T2 > // Type of the right-hand side sparse vector
750 inline const SVecTSVecMultExpr<T1,T2>
752 {
754 
755  return SVecTSVecMultExpr<T1,T2>( ~lhs, ~rhs );
756 }
757 //*************************************************************************************************
758 
759 
760 
761 
762 //=================================================================================================
763 //
764 // ROWS SPECIALIZATIONS
765 //
766 //=================================================================================================
767 
768 //*************************************************************************************************
770 template< typename VT1, typename VT2 >
771 struct Rows< SVecTSVecMultExpr<VT1,VT2> > : public Size<VT1>
772 {};
774 //*************************************************************************************************
775 
776 
777 
778 
779 //=================================================================================================
780 //
781 // COLUMNS SPECIALIZATIONS
782 //
783 //=================================================================================================
784 
785 //*************************************************************************************************
787 template< typename VT1, typename VT2 >
788 struct Columns< SVecTSVecMultExpr<VT1,VT2> > : public Size<VT2>
789 {};
791 //*************************************************************************************************
792 
793 
794 
795 
796 //=================================================================================================
797 //
798 // EXPRESSION TRAIT SPECIALIZATIONS
799 //
800 //=================================================================================================
801 
802 //*************************************************************************************************
804 template< typename VT1, typename VT2, bool AF >
805 struct SubmatrixExprTrait< SVecTSVecMultExpr<VT1,VT2>, AF >
806 {
807  public:
808  //**********************************************************************************************
809  using Type = MultExprTrait_< SubvectorExprTrait_<const VT1,AF>
810  , SubvectorExprTrait_<const VT2,AF> >;
811  //**********************************************************************************************
812 };
814 //*************************************************************************************************
815 
816 
817 //*************************************************************************************************
819 template< typename VT1, typename VT2 >
820 struct RowExprTrait< SVecTSVecMultExpr<VT1,VT2> >
821 {
822  public:
823  //**********************************************************************************************
824  using Type = MultExprTrait_< ReturnType_<VT1>, VT2 >;
825  //**********************************************************************************************
826 };
828 //*************************************************************************************************
829 
830 
831 //*************************************************************************************************
833 template< typename VT1, typename VT2 >
834 struct ColumnExprTrait< SVecTSVecMultExpr<VT1,VT2> >
835 {
836  public:
837  //**********************************************************************************************
838  using Type = MultExprTrait_< VT1, ReturnType_<VT2> >;
839  //**********************************************************************************************
840 };
842 //*************************************************************************************************
843 
844 } // namespace blaze
845 
846 #endif
Header file for auxiliary alias declarations.
If_< IsExpression< VT2 >, const VT2, const VT2 & > RightOperand
Composite type of the right-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:139
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SVecTSVecMultExpr.h:204
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:70
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:7800
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:346
Header file for basic type definitions.
#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: ColumnVector.h:61
Header file for the serial shim.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SVecTSVecMultExpr.h:188
RightOperand rhs_
Right-hand side sparse vector of the multiplication expression.
Definition: SVecTSVecMultExpr.h:287
Header file for the ColumnExprTrait class template.
LeftOperand lhs_
Left-hand side sparse vector of the multiplication expression.
Definition: SVecTSVecMultExpr.h:286
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:245
Header file for the Computation base class.
ReturnType_< VT2 > RN2
Return type of the right-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:103
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SVecTSVecMultExpr.h:267
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Constraint on the data type.
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
ReturnType_< VT1 > RN1
Return type of the left-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:102
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
Header file for the SparseMatrix base class.
Constraint on the transpose flag of vector types.
Constraint on the data type.
SVecTSVecMultExpr(const VT1 &lhs, const VT2 &rhs) noexcept
Constructor for the SVecTSVecMultExpr class.
Definition: SVecTSVecMultExpr.h:159
typename MultExprTrait< T1, T2 >::Type MultExprTrait_
Auxiliary alias declaration for the MultExprTrait class template.The MultExprTrait_ alias declaration...
Definition: MultExprTrait.h:344
Header file for the MultExprTrait class template.
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SVecTSVecMultExpr.h:172
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
If_< IsExpression< VT1 >, const VT1, const VT1 & > LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:136
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
#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:105
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the Columns type trait.
CompositeType_< VT1 > CT1
Composite type of the left-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:104
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: SVecTSVecMultExpr.h:130
const ResultType CompositeType
Data type for composite expression templates.
Definition: SVecTSVecMultExpr.h:133
#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:61
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SVecTSVecMultExpr.h:125
Expression object for sparse vector-sparse vector outer products.The SVecTSVecMultExpr class represen...
Definition: Forward.h:127
ResultType_< VT2 > RT2
Result type of the right-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:101
Header file for the exception macros of the math module.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
ResultType_< VT1 > RT1
Result type of the left-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:100
Constraint on the data type.
Header file for the VecTVecMultExpr base class.
MultTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: SVecTSVecMultExpr.h:124
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SVecTSVecMultExpr.h:126
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SVecTSVecMultExpr.h:279
#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:79
Header file for the SubmatrixExprTrait class template.
Header file for run time assertion macros.
SVecTSVecMultExpr< VT1, VT2 > This
Type of this SVecTSVecMultExpr instance.
Definition: SVecTSVecMultExpr.h:123
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse vector operand.
Definition: SVecTSVecMultExpr.h:255
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:160
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse vector operand.
Definition: SVecTSVecMultExpr.h:245
Header file for the isDefault shim.
CompositeType_< VT2 > CT2
Composite type of the right-hand side sparse vector expression.
Definition: SVecTSVecMultExpr.h:105
Constraint on the data type.
If_< IsComputation< VT1 >, const RT1, CT1 > LT
Type for the assignment of the left-hand side dense vector operand.
Definition: SVecTSVecMultExpr.h:142
Constraint on the data type.
Header file for the RemoveReference type trait.
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SVecTSVecMultExpr.h:214
MultExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: SVecTSVecMultExpr.h:118
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:110
#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
#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: RowVector.h:61
Header file for the SubvectorExprTrait class template.
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
ElementType_< ResultType > ElementType
Resulting element type.
Definition: SVecTSVecMultExpr.h:127
Header file for the Size type trait.
Size type of the Blaze library.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SVecTSVecMultExpr.h:224
#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
If_< IsComputation< VT2 >, const RT2, CT2 > RT
Type for the assignment of the right-hand side dense vector operand.
Definition: SVecTSVecMultExpr.h:145
Constraint on the transpose flag of vector types.
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SVecTSVecMultExpr.h:235