SMatDVecMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATDVECMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATDVECMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
50 #include <blaze/math/Exception.h>
55 #include <blaze/math/shims/Reset.h>
70 #include <blaze/util/Assert.h>
72 #include <blaze/util/DisableIf.h>
73 #include <blaze/util/EnableIf.h>
76 #include <blaze/util/mpl/If.h>
77 #include <blaze/util/Types.h>
79 
80 
81 namespace blaze {
82 
83 //=================================================================================================
84 //
85 // CLASS SMATDVECMULTEXPR
86 //
87 //=================================================================================================
88 
89 //*************************************************************************************************
96 template< typename MT // Type of the left-hand side sparse matrix
97  , typename VT > // Type of the right-hand side dense vector
98 class SMatDVecMultExpr : public DenseVector< SMatDVecMultExpr<MT,VT>, false >
99  , private MatVecMultExpr
100  , private Computation
101 {
102  private:
103  //**Type definitions****************************************************************************
108  //**********************************************************************************************
109 
110  //**********************************************************************************************
112  enum : bool { evaluateMatrix = RequiresEvaluation<MT>::value };
113  //**********************************************************************************************
114 
115  //**********************************************************************************************
117  enum : bool { evaluateVector = IsComputation<VT>::value || RequiresEvaluation<VT>::value };
118  //**********************************************************************************************
119 
120  //**********************************************************************************************
122 
128  enum : bool { useAssign = evaluateMatrix || evaluateVector };
129  //**********************************************************************************************
130 
131  //**********************************************************************************************
133  template< typename VT2 >
135  struct UseAssign {
136  enum : bool { value = useAssign };
137  };
139  //**********************************************************************************************
140 
141  //**********************************************************************************************
143 
147  template< typename T1 >
148  struct UseSMPAssign {
149  enum : bool { value = useAssign };
150  };
152  //**********************************************************************************************
153 
154  public:
155  //**Type definitions****************************************************************************
160  typedef const ElementType ReturnType;
161 
164 
166  typedef If_< IsExpression<MT>, const MT, const MT& > LeftOperand;
167 
169  typedef If_< IsExpression<VT>, const VT, const VT& > RightOperand;
170 
173 
176  //**********************************************************************************************
177 
178  //**Compilation flags***************************************************************************
180  enum : bool { simdEnabled = false };
181 
183  enum : bool { smpAssignable = !evaluateMatrix && MT::smpAssignable &&
184  !evaluateVector && VT::smpAssignable };
185  //**********************************************************************************************
186 
187  //**Constructor*********************************************************************************
193  explicit inline SMatDVecMultExpr( const MT& mat, const VT& vec ) noexcept
194  : mat_( mat ) // Left-hand side sparse matrix of the multiplication expression
195  , vec_( vec ) // Right-hand side dense vector of the multiplication expression
196  {
197  BLAZE_INTERNAL_ASSERT( mat_.columns() == vec_.size(), "Invalid matrix and vector sizes" );
198  }
199  //**********************************************************************************************
200 
201  //**Subscript operator**************************************************************************
207  inline ReturnType operator[]( size_t index ) const {
208  BLAZE_INTERNAL_ASSERT( index < mat_.rows(), "Invalid vector access index" );
209  return row( mat_, index ) * vec_;
210  }
211  //**********************************************************************************************
212 
213  //**At function*********************************************************************************
220  inline ReturnType at( size_t index ) const {
221  if( index >= mat_.rows() ) {
222  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
223  }
224  return (*this)[index];
225  }
226  //**********************************************************************************************
227 
228  //**Size function*******************************************************************************
233  inline size_t size() const noexcept {
234  return mat_.rows();
235  }
236  //**********************************************************************************************
237 
238  //**Left operand access*************************************************************************
243  inline LeftOperand leftOperand() const noexcept {
244  return mat_;
245  }
246  //**********************************************************************************************
247 
248  //**Right operand access************************************************************************
253  inline RightOperand rightOperand() const noexcept {
254  return vec_;
255  }
256  //**********************************************************************************************
257 
258  //**********************************************************************************************
264  template< typename T >
265  inline bool canAlias( const T* alias ) const noexcept {
266  return ( mat_.isAliased( alias ) || vec_.isAliased( alias ) );
267  }
268  //**********************************************************************************************
269 
270  //**********************************************************************************************
276  template< typename T >
277  inline bool isAliased( const T* alias ) const noexcept {
278  return ( mat_.isAliased( alias ) || vec_.isAliased( alias ) );
279  }
280  //**********************************************************************************************
281 
282  //**********************************************************************************************
287  inline bool isAligned() const noexcept {
288  return vec_.isAligned();
289  }
290  //**********************************************************************************************
291 
292  //**********************************************************************************************
297  inline bool canSMPAssign() const noexcept {
298  return ( size() > SMP_SMATDVECMULT_THRESHOLD );
299  }
300  //**********************************************************************************************
301 
302  private:
303  //**Member variables****************************************************************************
304  LeftOperand mat_;
305  RightOperand vec_;
306  //**********************************************************************************************
307 
308  //**Assignment to dense vectors*****************************************************************
324  template< typename VT1 > // Type of the target dense vector
325  friend inline EnableIf_< UseAssign<VT1> >
326  assign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
327  {
329 
330  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
331 
332  if( rhs.mat_.columns() == 0UL ) {
333  reset( ~lhs );
334  return;
335  }
336 
337  LT A( serial( rhs.mat_ ) ); // Evaluation of the left-hand side sparse matrix operand
338  RT x( serial( rhs.vec_ ) ); // Evaluation of the right-hand side dense vector operand
339 
340  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
341  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
342  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
343  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).size() , "Invalid vector size" );
344 
345  assign( ~lhs, A * x );
346  }
348  //**********************************************************************************************
349 
350  //**Assignment to sparse vectors****************************************************************
366  template< typename VT1 > // Type of the target sparse vector
367  friend inline EnableIf_< UseAssign<VT1> >
368  assign( SparseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
369  {
371 
375 
376  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
377 
378  const ResultType tmp( serial( rhs ) );
379  assign( ~lhs, tmp );
380  }
382  //**********************************************************************************************
383 
384  //**Addition assignment to dense vectors********************************************************
400  template< typename VT1 > // Type of the target dense vector
401  friend inline EnableIf_< UseAssign<VT1> >
402  addAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
403  {
405 
406  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
407 
408  if( rhs.mat_.columns() == 0UL ) {
409  return;
410  }
411 
412  LT A( serial( rhs.mat_ ) ); // Evaluation of the left-hand side sparse matrix operand
413  RT x( serial( rhs.vec_ ) ); // Evaluation of the right-hand side dense vector operand
414 
415  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
416  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
417  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
418  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).size() , "Invalid vector size" );
419 
420  addAssign( ~lhs, A * x );
421  }
423  //**********************************************************************************************
424 
425  //**Addition assignment to sparse vectors*******************************************************
426  // No special implementation for the addition assignment to sparse vectors.
427  //**********************************************************************************************
428 
429  //**Subtraction assignment to dense vectors*****************************************************
445  template< typename VT1 > // Type of the target dense vector
446  friend inline EnableIf_< UseAssign<VT1> >
447  subAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
448  {
450 
451  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
452 
453  if( rhs.mat_.columns() == 0UL ) {
454  return;
455  }
456 
457  LT A( serial( rhs.mat_ ) ); // Evaluation of the left-hand side sparse matrix operand
458  RT x( serial( rhs.vec_ ) ); // Evaluation of the right-hand side dense vector operand
459 
460  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
461  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
462  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
463  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).size() , "Invalid vector size" );
464 
465  subAssign( ~lhs, A * x );
466  }
468  //**********************************************************************************************
469 
470  //**Subtraction assignment to sparse vectors****************************************************
471  // No special implementation for the subtraction assignment to sparse vectors.
472  //**********************************************************************************************
473 
474  //**Multiplication assignment to dense vectors**************************************************
490  template< typename VT1 > // Type of the target dense vector
491  friend inline EnableIf_< UseAssign<VT1> >
492  multAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
493  {
495 
498  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
499 
500  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
501 
502  const ResultType tmp( serial( rhs ) );
503  multAssign( ~lhs, tmp );
504  }
506  //**********************************************************************************************
507 
508  //**Multiplication assignment to sparse vectors*************************************************
509  // No special implementation for the multiplication assignment to sparse vectors.
510  //**********************************************************************************************
511 
512  //**Division assignment to dense vectors********************************************************
528  template< typename VT1 > // Type of the target dense vector
529  friend inline EnableIf_< UseAssign<VT1> >
530  divAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
531  {
533 
536  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
537 
538  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
539 
540  const ResultType tmp( serial( rhs ) );
541  divAssign( ~lhs, tmp );
542  }
544  //**********************************************************************************************
545 
546  //**Division assignment to sparse vectors*******************************************************
547  // No special implementation for the division assignment to sparse vectors.
548  //**********************************************************************************************
549 
550  //**SMP assignment to dense vectors*************************************************************
565  template< typename VT1 > // Type of the target dense vector
566  friend inline EnableIf_< UseSMPAssign<VT1> >
567  smpAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
568  {
570 
571  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
572 
573  if( rhs.mat_.columns() == 0UL ) {
574  reset( ~lhs );
575  return;
576  }
577 
578  LT A( rhs.mat_ ); // Evaluation of the left-hand side sparse matrix operand
579  RT x( rhs.vec_ ); // Evaluation of the right-hand side dense vector operand
580 
581  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
582  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
583  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
584  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).size() , "Invalid vector size" );
585 
586  smpAssign( ~lhs, A * x );
587  }
589  //**********************************************************************************************
590 
591  //**SMP assignment to sparse vectors************************************************************
606  template< typename VT1 > // Type of the target sparse vector
607  friend inline EnableIf_< UseSMPAssign<VT1> >
608  smpAssign( SparseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
609  {
611 
614  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
615 
616  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
617 
618  const ResultType tmp( rhs );
619  smpAssign( ~lhs, tmp );
620  }
622  //**********************************************************************************************
623 
624  //**SMP addition assignment to dense vectors****************************************************
639  template< typename VT1 > // Type of the target dense vector
640  friend inline EnableIf_< UseSMPAssign<VT1> >
641  smpAddAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
642  {
644 
645  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
646 
647  if( rhs.mat_.columns() == 0UL ) {
648  return;
649  }
650 
651  LT A( rhs.mat_ ); // Evaluation of the left-hand side sparse matrix operand
652  RT x( rhs.vec_ ); // Evaluation of the right-hand side dense vector operand
653 
654  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
655  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
656  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
657  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).size() , "Invalid vector size" );
658 
659  smpAddAssign( ~lhs, A * x );
660  }
662  //**********************************************************************************************
663 
664  //**SMP addition assignment to sparse vectors***************************************************
665  // No special implementation for the SMP addition assignment to sparse vectors.
666  //**********************************************************************************************
667 
668  //**SMP subtraction assignment to dense vectors*************************************************
683  template< typename VT1 > // Type of the target dense vector
684  friend inline EnableIf_< UseSMPAssign<VT1> >
685  smpSubAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
686  {
688 
689  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
690 
691  if( rhs.mat_.columns() == 0UL ) {
692  return;
693  }
694 
695  LT A( rhs.mat_ ); // Evaluation of the left-hand side sparse matrix operand
696  RT x( rhs.vec_ ); // Evaluation of the right-hand side dense vector operand
697 
698  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
699  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
700  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
701  BLAZE_INTERNAL_ASSERT( A.rows() == (~lhs).size() , "Invalid vector size" );
702 
703  smpSubAssign( ~lhs, A * x );
704  }
706  //**********************************************************************************************
707 
708  //**SMP subtraction assignment to sparse vectors************************************************
709  // No special implementation for the SMP subtraction assignment to sparse vectors.
710  //**********************************************************************************************
711 
712  //**SMP multiplication assignment to dense vectors**********************************************
727  template< typename VT1 > // Type of the target dense vector
728  friend inline EnableIf_< UseSMPAssign<VT1> >
729  smpMultAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
730  {
732 
735  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
736 
737  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
738 
739  const ResultType tmp( rhs );
740  smpMultAssign( ~lhs, tmp );
741  }
743  //**********************************************************************************************
744 
745  //**SMP multiplication assignment to sparse vectors*********************************************
746  // No special implementation for the SMP multiplication assignment to sparse vectors.
747  //**********************************************************************************************
748 
749  //**SMP division assignment to dense vectors****************************************************
764  template< typename VT1 > // Type of the target dense vector
765  friend inline EnableIf_< UseSMPAssign<VT1> >
766  smpDivAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
767  {
769 
772  BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE( CompositeType_<ResultType> );
773 
774  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
775 
776  const ResultType tmp( rhs );
777  smpDivAssign( ~lhs, tmp );
778  }
780  //**********************************************************************************************
781 
782  //**SMP division assignment to sparse vectors***************************************************
783  // No special implementation for the SMP division assignment to sparse vectors.
784  //**********************************************************************************************
785 
786  //**Compile time checks*************************************************************************
794  //**********************************************************************************************
795 };
796 //*************************************************************************************************
797 
798 
799 
800 
801 //=================================================================================================
802 //
803 // GLOBAL BINARY ARITHMETIC OPERATORS
804 //
805 //=================================================================================================
806 
807 //*************************************************************************************************
838 template< typename T1 // Type of the left-hand side sparse matrix
839  , typename T2 > // Type of the right-hand side dense vector
840 inline const DisableIf_< IsMatMatMultExpr<T1>, SMatDVecMultExpr<T1,T2> >
842 {
844 
845  if( (~mat).columns() != (~vec).size() ) {
846  BLAZE_THROW_INVALID_ARGUMENT( "Matrix and vector sizes do not match" );
847  }
848 
849  return SMatDVecMultExpr<T1,T2>( ~mat, ~vec );
850 }
851 //*************************************************************************************************
852 
853 
854 
855 
856 //=================================================================================================
857 //
858 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
859 //
860 //=================================================================================================
861 
862 //*************************************************************************************************
875 template< typename T1 // Type of the left-hand side sparse matrix
876  , bool SO // Storage order of the left-hand side sparse matrix
877  , typename T2 > // Type of the right-hand side dense vector
878 inline const EnableIf_< IsMatMatMultExpr<T1>, MultExprTrait_<T1,T2> >
880 {
882 
884 
885  return (~mat).leftOperand() * ( (~mat).rightOperand() * vec );
886 }
887 //*************************************************************************************************
888 
889 
890 
891 
892 //=================================================================================================
893 //
894 // SIZE SPECIALIZATIONS
895 //
896 //=================================================================================================
897 
898 //*************************************************************************************************
900 template< typename MT, typename VT >
901 struct Size< SMatDVecMultExpr<MT,VT> > : public Rows<MT>
902 {};
904 //*************************************************************************************************
905 
906 
907 
908 
909 //=================================================================================================
910 //
911 // ISALIGNED SPECIALIZATIONS
912 //
913 //=================================================================================================
914 
915 //*************************************************************************************************
917 template< typename MT, typename VT >
918 struct IsAligned< SMatDVecMultExpr<MT,VT> >
919  : public BoolConstant< IsAligned<VT>::value >
920 {};
922 //*************************************************************************************************
923 
924 
925 
926 
927 //=================================================================================================
928 //
929 // EXPRESSION TRAIT SPECIALIZATIONS
930 //
931 //=================================================================================================
932 
933 //*************************************************************************************************
935 template< typename MT, typename VT, bool AF >
936 struct SubvectorExprTrait< SMatDVecMultExpr<MT,VT>, AF >
937 {
938  public:
939  //**********************************************************************************************
940  using Type = MultExprTrait_< SubmatrixExprTrait_<const MT,AF>
941  , SubvectorExprTrait_<const VT,AF> >;
942  //**********************************************************************************************
943 };
945 //*************************************************************************************************
946 
947 } // namespace blaze
948 
949 #endif
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatDVecMultExpr.h:265
Header file for auxiliary alias declarations.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:72
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
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatDVecMultExpr.h:297
Header file for basic type definitions.
CompositeType_< VT > VCT
Composite type of the right-hand side dense vector expression.
Definition: SMatDVecMultExpr.h:107
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: SMatDVecMultExpr.h:287
#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
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the serial shim.
Header file for the IsDiagonal type trait.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
ResultType_< MT > MRT
Result type of the left-hand side sparse matrix expression.
Definition: SMatDVecMultExpr.h:104
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: SMatDVecMultExpr.h:233
Expression object for sparse matrix-dense vector multiplications.The SMatDVecMultExpr class represent...
Definition: Forward.h:92
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
EnableIf_< IsDenseVector< VT1 > > smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:193
Header file for the DenseVector base class.
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.
SMatDVecMultExpr(const MT &mat, const VT &vec) noexcept
Constructor for the SMatDVecMultExpr class.
Definition: SMatDVecMultExpr.h:193
Constraints on the storage order of matrix types.
MultTrait_< MRT, VRT > ResultType
Result type for expression template evaluations.
Definition: SMatDVecMultExpr.h:157
Header file for the RequiresEvaluation type trait.
CompositeType_< MT > MCT
Composite type of the left-hand side sparse matrix expression.
Definition: SMatDVecMultExpr.h:106
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:109
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
Constraint on the transpose flag of vector types.
Constraint on the data type.
Header file for the MultExprTrait class template.
IfTrue_< evaluateVector, const VRT, VCT > RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: SMatDVecMultExpr.h:175
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatDVecMultExpr.h:277
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: SMatDVecMultExpr.h:220
Header file for the DisableIf class template.
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse matrix operand.
Definition: SMatDVecMultExpr.h:243
ResultType_< VT > VRT
Result type of the right-hand side dense vector expression.
Definition: SMatDVecMultExpr.h:105
Header file for the multiplication trait.
IfTrue_< evaluateMatrix, const MRT, MCT > LT
Type for the assignment of the left-hand side sparse matrix operand.
Definition: SMatDVecMultExpr.h:172
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
IfTrue_< useAssign, const ResultType, const SMatDVecMultExpr & > CompositeType
Data type for composite expression templates.
Definition: SMatDVecMultExpr.h:163
If_< IsExpression< VT >, const VT, const VT & > RightOperand
Composite type of the right-hand side dense vector expression.
Definition: SMatDVecMultExpr.h:169
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
RightOperand vec_
Right-hand side dense vector of the multiplication expression.
Definition: SMatDVecMultExpr.h:305
Header file for the IsMatMatMultExpr type trait class.
#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
LeftOperand mat_
Left-hand side sparse matrix of the multiplication expression.
Definition: SMatDVecMultExpr.h:304
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
ElementType_< ResultType > ElementType
Resulting element type.
Definition: SMatDVecMultExpr.h:159
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Header file for the IsAligned type trait.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:330
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:60
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATVECMULTEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid matrix/vector ...
Definition: MatVecMultExpr.h:110
RightOperand rightOperand() const noexcept
Returns the right-hand side dense vector operand.
Definition: SMatDVecMultExpr.h:253
Constraint on the data type.
Header file for the exception macros of the math module.
Header file for all forward declarations for expression class templates.
Header file for the EnableIf class template.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, RowExprTrait_< MT > > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:126
#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.
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a row-major dense or sparse matrix t...
Definition: RowMajorMatrix.h:61
const ElementType ReturnType
Return type for expression template evaluations.
Definition: SMatDVecMultExpr.h:160
Header file for run time assertion macros.
If_< IsExpression< MT >, const MT, const MT & > LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: SMatDVecMultExpr.h:166
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
EnableIf_< IsDenseVector< VT1 > > smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:222
Header file for the reset shim.
Constraint on the data type.
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SMatDVecMultExpr.h:158
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
Header file for the RemoveReference type trait.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SMatDVecMultExpr.h:207
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:61
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
SMatDVecMultExpr< MT, VT > This
Type of this SMatDVecMultExpr instance.
Definition: SMatDVecMultExpr.h:156
#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
Header file for the IntegralConstant class template.
Header file for the SubvectorExprTrait class template.
Constraint on the data type.
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
Header file for the MatVecMultExpr base class.
Header file for the Size type trait.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#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
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:61
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.