SVecSVecOuterExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECSVECOUTEREXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SVECSVECOUTEREXPR_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>
71 #include <blaze/util/mpl/If.h>
72 #include <blaze/util/Types.h>
74 
75 
76 namespace blaze {
77 
78 //=================================================================================================
79 //
80 // CLASS SVECSVECOUTEREXPR
81 //
82 //=================================================================================================
83 
84 //*************************************************************************************************
91 template< typename VT1 // Type of the left-hand side sparse vector
92  , typename VT2 > // Type of the right-hand side sparse vector
93 class SVecSVecOuterExpr : public SparseMatrix< SVecSVecOuterExpr<VT1,VT2>, false >
94  , private VecTVecMultExpr
95  , private Computation
96 {
97  private:
98  //**Type definitions****************************************************************************
105  //**********************************************************************************************
106 
107  //**Return type evaluation**********************************************************************
109 
114  enum : bool { returnExpr = !IsTemporary<RN1>::value && !IsTemporary<RN2>::value };
115 
118  //**********************************************************************************************
119 
120  public:
121  //**Type definitions****************************************************************************
127 
130 
132  typedef const ResultType CompositeType;
133 
135  typedef If_< IsExpression<VT1>, const VT1, const VT1& > LeftOperand;
136 
138  typedef If_< IsExpression<VT2>, const VT2, const VT2& > RightOperand;
139 
141  typedef If_< IsComputation<VT1>, const RT1, CT1 > LT;
142 
144  typedef If_< IsComputation<VT2>, const RT2, CT2 > RT;
145  //**********************************************************************************************
146 
147  //**Compilation flags***************************************************************************
149  enum : bool { smpAssignable = false };
150  //**********************************************************************************************
151 
152  //**Constructor*********************************************************************************
158  explicit inline SVecSVecOuterExpr( const VT1& lhs, const VT2& rhs ) noexcept
159  : lhs_( lhs ) // Left-hand side sparse vector of the multiplication expression
160  , rhs_( rhs ) // Right-hand side sparse vector of the multiplication expression
161  {}
162  //**********************************************************************************************
163 
164  //**Access operator*****************************************************************************
171  inline ReturnType operator()( size_t i, size_t j ) const {
172  BLAZE_INTERNAL_ASSERT( i < lhs_.size(), "Invalid row access index" );
173  BLAZE_INTERNAL_ASSERT( j < rhs_.size(), "Invalid column access index" );
174 
175  return lhs_[i] * rhs_[j];
176  }
177  //**********************************************************************************************
178 
179  //**At function*********************************************************************************
187  inline ReturnType at( size_t i, size_t j ) const {
188  if( i >= lhs_.size() ) {
189  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
190  }
191  if( j >= rhs_.size() ) {
192  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
193  }
194  return (*this)(i,j);
195  }
196  //**********************************************************************************************
197 
198  //**Rows function*******************************************************************************
203  inline size_t rows() const noexcept {
204  return lhs_.size();
205  }
206  //**********************************************************************************************
207 
208  //**Columns function****************************************************************************
213  inline size_t columns() const noexcept {
214  return rhs_.size();
215  }
216  //**********************************************************************************************
217 
218  //**NonZeros function***************************************************************************
223  inline size_t nonZeros() const {
224  return lhs_.nonZeros() * rhs_.nonZeros();
225  }
226  //**********************************************************************************************
227 
228  //**NonZeros function***************************************************************************
234  inline size_t nonZeros( size_t i ) const {
235  return ( isDefault( lhs_[i] ) )?( size_t(0) ):( rhs_.nonZeros(i) );
236  }
237  //**********************************************************************************************
238 
239  //**Left operand access*************************************************************************
244  inline LeftOperand leftOperand() const noexcept {
245  return lhs_;
246  }
247  //**********************************************************************************************
248 
249  //**Right operand access************************************************************************
254  inline RightOperand rightOperand() const noexcept {
255  return rhs_;
256  }
257  //**********************************************************************************************
258 
259  //**********************************************************************************************
265  template< typename T >
266  inline bool canAlias( const T* alias ) const noexcept {
267  return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
268  }
269  //**********************************************************************************************
270 
271  //**********************************************************************************************
277  template< typename T >
278  inline bool isAliased( const T* alias ) const noexcept {
279  return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
280  }
281  //**********************************************************************************************
282 
283  private:
284  //**Member variables****************************************************************************
285  LeftOperand lhs_;
286  RightOperand rhs_;
287  //**********************************************************************************************
288 
289  //**Assignment to row-major dense matrices******************************************************
301  template< typename MT > // Type of the target dense matrix
302  friend inline void assign( DenseMatrix<MT,false>& lhs, const SVecSVecOuterExpr& rhs )
303  {
305 
306  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
307  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
308 
309  typedef ConstIterator_< RemoveReference_<LT> > LeftIterator;
310  typedef ConstIterator_< RemoveReference_<RT> > RightIterator;
311 
312  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
313  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
314 
315  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
316  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
317  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
318  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
319 
320  const LeftIterator lend( x.end() );
321  const RightIterator rend( y.end() );
322 
323  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
324  if( !isDefault( lelem->value() ) ) {
325  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
326  (~lhs)(lelem->index(),relem->index()) = lelem->value() * relem->value();
327  }
328  }
329  }
330  }
332  //**********************************************************************************************
333 
334  //**Assignment to column-major dense matrices***************************************************
347  template< typename MT > // Type of the target dense matrix
348  friend inline void assign( DenseMatrix<MT,true>& lhs, const SVecSVecOuterExpr& rhs )
349  {
351 
353 
354  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
355  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
356 
357  typedef ConstIterator_< RemoveReference_<LT> > LeftIterator;
358  typedef ConstIterator_< RemoveReference_<RT> > RightIterator;
359 
360  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
361  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
362 
363  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
364  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
365  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
366  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
367 
368  const LeftIterator lend( x.end() );
369  const RightIterator rend( y.end() );
370 
371  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
372  if( !isDefault( relem->value() ) ) {
373  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
374  (~lhs)(lelem->index(),relem->index()) = lelem->value() * relem->value();
375  }
376  }
377  }
378  }
380  //**********************************************************************************************
381 
382  //**Assignment to row-major sparse matrices*****************************************************
394  template< typename MT > // Type of the target sparse matrix
395  friend inline void assign( SparseMatrix<MT,false>& lhs, const SVecSVecOuterExpr& rhs )
396  {
398 
399  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
400  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns() , "Invalid number of columns" );
401  BLAZE_INTERNAL_ASSERT( (~lhs).capacity() >= rhs.nonZeros(), "Insufficient capacity" );
402 
403  typedef ConstIterator_< RemoveReference_<LT> > LeftIterator;
404  typedef ConstIterator_< RemoveReference_<RT> > RightIterator;
405 
406  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
407  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
408 
409  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
410  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
411  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
412  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
413 
414  const LeftIterator lend( x.end() );
415  const RightIterator rend( y.end() );
416  size_t index( 0UL );
417 
418  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
419  if( !isDefault( lelem->value() ) ) {
420  for( ; index < lelem->index(); ++index ) {
421  (~lhs).finalize( index );
422  }
423  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
424  (~lhs).append( lelem->index(), relem->index(), lelem->value() * relem->value() );
425  }
426  (~lhs).finalize( index++ );
427  }
428  }
429 
430  for( ; index < x.size(); ++index ) {
431  (~lhs).finalize( index );
432  }
433  }
435  //**********************************************************************************************
436 
437  //**Assignment to column-major sparse matrices**************************************************
450  template< typename MT > // Type of the target sparse matrix
451  friend inline void assign( SparseMatrix<MT,true>& lhs, const SVecSVecOuterExpr& rhs )
452  {
454 
456 
457  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
458  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns() , "Invalid number of columns" );
459  BLAZE_INTERNAL_ASSERT( (~lhs).capacity() >= rhs.nonZeros(), "Insufficient capacity" );
460 
461  typedef ConstIterator_< RemoveReference_<LT> > LeftIterator;
462  typedef ConstIterator_< RemoveReference_<RT> > RightIterator;
463 
464  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
465  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
466 
467  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
468  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
469  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
470  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
471 
472  const LeftIterator lend( x.end() );
473  const RightIterator rend( y.end() );
474  size_t index( 0UL );
475 
476  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
477  if( !isDefault( relem->value() ) ) {
478  for( ; index < relem->index(); ++index ) {
479  (~lhs).finalize( index );
480  }
481  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
482  (~lhs).append( lelem->index(), relem->index(), lelem->value() * relem->value() );
483  }
484  (~lhs).finalize( index++ );
485  }
486  }
487 
488  for( ; index < y.size(); ++index ) {
489  (~lhs).finalize( index );
490  }
491  }
493  //**********************************************************************************************
494 
495  //**Addition assignment to row-major dense matrices*********************************************
508  template< typename MT > // Type of the target dense matrix
509  friend inline void addAssign( DenseMatrix<MT,false>& lhs, const SVecSVecOuterExpr& rhs )
510  {
512 
513  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
514  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
515 
516  typedef ConstIterator_< RemoveReference_<LT> > LeftIterator;
517  typedef ConstIterator_< RemoveReference_<RT> > RightIterator;
518 
519  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
520  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
521 
522  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
523  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
524  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
525  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
526 
527  const LeftIterator lend( x.end() );
528  const RightIterator rend( y.end() );
529 
530  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
531  if( !isDefault( lelem->value() ) ) {
532  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
533  (~lhs)(lelem->index(),relem->index()) += lelem->value() * relem->value();
534  }
535  }
536  }
537  }
539  //**********************************************************************************************
540 
541  //**Addition assignment to column-major dense matrices******************************************
554  template< typename MT > // Type of the target dense matrix
555  friend inline void addAssign( DenseMatrix<MT,true>& lhs, const SVecSVecOuterExpr& rhs )
556  {
558 
560 
561  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
562  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
563 
564  typedef ConstIterator_< RemoveReference_<LT> > LeftIterator;
565  typedef ConstIterator_< RemoveReference_<RT> > RightIterator;
566 
567  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
568  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
569 
570  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
571  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
572  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
573  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
574 
575  const LeftIterator lend( x.end() );
576  const RightIterator rend( y.end() );
577 
578  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
579  if( !isDefault( relem->value() ) ) {
580  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
581  (~lhs)(lelem->index(),relem->index()) += lelem->value() * relem->value();
582  }
583  }
584  }
585  }
587  //**********************************************************************************************
588 
589  //**Addition assignment to sparse matrices******************************************************
590  // No special implementation for the addition assignment to sparse matrices.
591  //**********************************************************************************************
592 
593  //**Subtraction assignment to row-major dense matrices******************************************
606  template< typename MT > // Type of the target dense matrix
607  friend inline void subAssign( DenseMatrix<MT,false>& lhs, const SVecSVecOuterExpr& rhs )
608  {
610 
611  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
612  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
613 
614  typedef ConstIterator_< RemoveReference_<LT> > LeftIterator;
615  typedef ConstIterator_< RemoveReference_<RT> > RightIterator;
616 
617  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
618  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
619 
620  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
621  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
622  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
623  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
624 
625  const LeftIterator lend( x.end() );
626  const RightIterator rend( y.end() );
627 
628  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
629  if( !isDefault( lelem->value() ) ) {
630  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
631  (~lhs)(lelem->index(),relem->index()) -= lelem->value() * relem->value();
632  }
633  }
634  }
635  }
637  //**********************************************************************************************
638 
639  //**Subtraction assignment to column-major dense matrices***************************************
652  template< typename MT > // Type of the target dense matrix
653  friend inline void subAssign( DenseMatrix<MT,true>& lhs, const SVecSVecOuterExpr& rhs )
654  {
656 
658 
659  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
660  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
661 
662  typedef ConstIterator_< RemoveReference_<LT> > LeftIterator;
663  typedef ConstIterator_< RemoveReference_<RT> > RightIterator;
664 
665  LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side sparse vector operand
666  RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side sparse vector operand
667 
668  BLAZE_INTERNAL_ASSERT( x.size() == rhs.lhs_.size() , "Invalid vector size" );
669  BLAZE_INTERNAL_ASSERT( y.size() == rhs.rhs_.size() , "Invalid vector size" );
670  BLAZE_INTERNAL_ASSERT( x.size() == (~lhs).rows() , "Invalid vector size" );
671  BLAZE_INTERNAL_ASSERT( y.size() == (~lhs).columns(), "Invalid vector size" );
672 
673  const LeftIterator lend( x.end() );
674  const RightIterator rend( y.end() );
675 
676  for( RightIterator relem=y.begin(); relem!=rend; ++relem ) {
677  if( !isDefault( relem->value() ) ) {
678  for( LeftIterator lelem=x.begin(); lelem!=lend; ++lelem ) {
679  (~lhs)(lelem->index(),relem->index()) -= lelem->value() * relem->value();
680  }
681  }
682  }
683  }
685  //**********************************************************************************************
686 
687  //**Subtraction assignment to sparse matrices***************************************************
688  // No special implementation for the subtraction assignment to sparse matrices.
689  //**********************************************************************************************
690 
691  //**Multiplication assignment to dense matrices*************************************************
692  // No special implementation for the multiplication assignment to dense matrices.
693  //**********************************************************************************************
694 
695  //**Multiplication assignment to sparse matrices************************************************
696  // No special implementation for the multiplication assignment to sparse matrices.
697  //**********************************************************************************************
698 
699  //**Compile time checks*************************************************************************
707  //**********************************************************************************************
708 };
709 //*************************************************************************************************
710 
711 
712 
713 
714 //=================================================================================================
715 //
716 // GLOBAL BINARY ARITHMETIC OPERATORS
717 //
718 //=================================================================================================
719 
720 //*************************************************************************************************
747 template< typename T1 // Type of the left-hand side sparse vector
748  , typename T2 > // Type of the right-hand side sparse vector
749 inline const SVecSVecOuterExpr<T1,T2>
751 {
753 
754  return SVecSVecOuterExpr<T1,T2>( ~lhs, ~rhs );
755 }
756 //*************************************************************************************************
757 
758 
759 
760 
761 //=================================================================================================
762 //
763 // ROWS SPECIALIZATIONS
764 //
765 //=================================================================================================
766 
767 //*************************************************************************************************
769 template< typename VT1, typename VT2 >
770 struct Rows< SVecSVecOuterExpr<VT1,VT2> > : public Size<VT1>
771 {};
773 //*************************************************************************************************
774 
775 
776 
777 
778 //=================================================================================================
779 //
780 // COLUMNS SPECIALIZATIONS
781 //
782 //=================================================================================================
783 
784 //*************************************************************************************************
786 template< typename VT1, typename VT2 >
787 struct Columns< SVecSVecOuterExpr<VT1,VT2> > : public Size<VT2>
788 {};
790 //*************************************************************************************************
791 
792 
793 
794 
795 //=================================================================================================
796 //
797 // EXPRESSION TRAIT SPECIALIZATIONS
798 //
799 //=================================================================================================
800 
801 //*************************************************************************************************
803 template< typename VT1, typename VT2, bool AF >
804 struct SubmatrixExprTrait< SVecSVecOuterExpr<VT1,VT2>, AF >
805 {
806  public:
807  //**********************************************************************************************
810  //**********************************************************************************************
811 };
813 //*************************************************************************************************
814 
815 
816 //*************************************************************************************************
818 template< typename VT1, typename VT2 >
819 struct RowExprTrait< SVecSVecOuterExpr<VT1,VT2> >
820 {
821  public:
822  //**********************************************************************************************
823  using Type = MultExprTrait_< ReturnType_<VT1>, VT2 >;
824  //**********************************************************************************************
825 };
827 //*************************************************************************************************
828 
829 
830 //*************************************************************************************************
832 template< typename VT1, typename VT2 >
833 struct ColumnExprTrait< SVecSVecOuterExpr<VT1,VT2> >
834 {
835  public:
836  //**********************************************************************************************
838  //**********************************************************************************************
839 };
841 //*************************************************************************************************
842 
843 } // namespace blaze
844 
845 #endif
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse vector operand.
Definition: SVecSVecOuterExpr.h:244
Header file for auxiliary alias declarations.
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.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SVecSVecOuterExpr.h:171
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:352
Header file for basic type definitions.
Expression object for sparse vector-sparse vector outer products.The SVecSVecOuterExpr class represen...
Definition: Forward.h:134
ReturnType_< VT2 > RN2
Return type of the right-hand side sparse vector expression.
Definition: SVecSVecOuterExpr.h:102
#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.
Header file for the ColumnExprTrait class template.
If_< IsExpression< VT1 >, const VT1, const VT1 &> LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: SVecSVecOuterExpr.h:135
CompositeType_< VT1 > CT1
Composite type of the left-hand side sparse vector expression.
Definition: SVecSVecOuterExpr.h:103
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:245
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SVecSVecOuterExpr.h:203
Header file for the Computation base class.
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse vector operand.
Definition: SVecSVecOuterExpr.h:254
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SVecSVecOuterExpr.h:125
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
ResultType_< VT2 > RT2
Result type of the right-hand side sparse vector expression.
Definition: SVecSVecOuterExpr.h:100
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:71
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:119
const ResultType CompositeType
Data type for composite expression templates.
Definition: SVecSVecOuterExpr.h:132
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: SVecSVecOuterExpr.h:129
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
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SVecSVecOuterExpr.h:234
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SVecSVecOuterExpr.h:223
Header file for the SparseMatrix base class.
Constraint on the transpose flag of vector types.
RightOperand rhs_
Right-hand side sparse vector of the multiplication expression.
Definition: SVecSVecOuterExpr.h:286
Constraint on the data type.
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
If_< IsComputation< VT2 >, const RT2, CT2 > RT
Type for the assignment of the right-hand side dense vector operand.
Definition: SVecSVecOuterExpr.h:144
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
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.
typename SubvectorExprTrait< VT, AF >::Type SubvectorExprTrait_
Auxiliary alias declaration for the SubvectorExprTrait type trait.The SubvectorExprTrait_ alias decla...
Definition: SubvectorExprTrait.h:133
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Evaluation of the expression type type of a submatrix operation.Via this type trait it is possible to...
Definition: SubmatrixExprTrait.h:80
#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
SVecSVecOuterExpr(const VT1 &lhs, const VT2 &rhs) noexcept
Constructor for the SVecSVecOuterExpr class.
Definition: SVecSVecOuterExpr.h:158
MultExprTrait_< RN1, RN2 > ExprReturnType
Expression return type for the subscript operator.
Definition: SVecSVecOuterExpr.h:117
SVecSVecOuterExpr< VT1, VT2 > This
Type of this SVecSVecOuterExpr instance.
Definition: SVecSVecOuterExpr.h:122
ReturnType_< VT1 > RN1
Return type of the left-hand side sparse vector expression.
Definition: SVecSVecOuterExpr.h:101
Header file for the exception macros of the math module.
Evaluation of the expression type type of a row operation.Via this type trait it is possible to evalu...
Definition: RowExprTrait.h:79
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.
If_< IsComputation< VT1 >, const RT1, CT1 > LT
Type for the assignment of the left-hand side dense vector operand.
Definition: SVecSVecOuterExpr.h:141
MultTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: SVecSVecOuterExpr.h:123
#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.
CompositeType_< VT2 > CT2
Composite type of the right-hand side sparse vector expression.
Definition: SVecSVecOuterExpr.h:104
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SVecSVecOuterExpr.h:124
ElementType_< ResultType > ElementType
Resulting element type.
Definition: SVecSVecOuterExpr.h:126
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
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:93
Header file for the isDefault shim.
Constraint on the data type.
ResultType_< VT1 > RT1
Result type of the left-hand side sparse vector expression.
Definition: SVecSVecOuterExpr.h:99
Constraint on the data type.
Header file for the RemoveReference type trait.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SVecSVecOuterExpr.h:213
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SVecSVecOuterExpr.h:187
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
Header file for the IsComputation type trait class.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SVecSVecOuterExpr.h:266
Compile time evaluation of the size of a vector.The Size type trait evaluates the size of the given v...
Definition: Size.h:75
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:120
Compile time evaluation of the number of columns of a matrix.The Columns type trait evaluates the num...
Definition: Columns.h:76
#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
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:76
Header file for the SubvectorExprTrait class template.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SVecSVecOuterExpr.h:278
const DMatDMatMultExpr< T1, T2, false, false, false, false > 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:7505
Header file for the Size type trait.
Size type of the Blaze library.
Evaluation of the expression type type of a column operation.Via this type trait it is possible to ev...
Definition: ColumnExprTrait.h:78
#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
Constraint on the transpose flag of vector types.
If_< IsExpression< VT2 >, const VT2, const VT2 &> RightOperand
Composite type of the right-hand side sparse vector expression.
Definition: SVecSVecOuterExpr.h:138
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
LeftOperand lhs_
Left-hand side sparse vector of the multiplication expression.
Definition: SVecSVecOuterExpr.h:285