TDVecTSMatMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_TDVECTSMATMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TDVECTSMATMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
52 #include <blaze/math/Exception.h>
57 #include <blaze/math/shims/Reset.h>
66 #include <blaze/math/views/Check.h>
68 #include <blaze/util/Assert.h>
69 #include <blaze/util/DisableIf.h>
70 #include <blaze/util/EnableIf.h>
72 #include <blaze/util/mpl/If.h>
73 #include <blaze/util/Types.h>
74 #include <blaze/util/Unused.h>
75 
76 
77 namespace blaze {
78 
79 //=================================================================================================
80 //
81 // CLASS TDVECSMATMULTEXPR
82 //
83 //=================================================================================================
84 
85 //*************************************************************************************************
92 template< typename VT // Type of the left-hand side dense vector
93  , typename MT > // Type of the right-hand side sparse matrix
94 class TDVecTSMatMultExpr
95  : public TVecMatMultExpr< DenseVector< TDVecTSMatMultExpr<VT,MT>, true > >
96  , private Computation
97 {
98  private:
99  //**Type definitions****************************************************************************
104  //**********************************************************************************************
105 
106  //**********************************************************************************************
108  static constexpr bool evaluateVector = ( IsComputation_v<VT> || RequiresEvaluation_v<VT> );
109  //**********************************************************************************************
110 
111  //**********************************************************************************************
113  static constexpr bool evaluateMatrix = RequiresEvaluation_v<MT>;
114  //**********************************************************************************************
115 
116  //**********************************************************************************************
118 
124  static constexpr bool useAssign = ( evaluateVector || evaluateMatrix );
125  //**********************************************************************************************
126 
127  //**********************************************************************************************
129  template< typename VT2 >
131  static constexpr bool UseAssign_v = useAssign;
133  //**********************************************************************************************
134 
135  //**********************************************************************************************
137 
141  template< typename T1 >
142  static constexpr bool UseSMPAssign_v = useAssign;
144  //**********************************************************************************************
145 
146  public:
147  //**Type definitions****************************************************************************
153  using ReturnType = const ElementType;
154 
157 
159  using LeftOperand = If_t< IsExpression_v<VT>, const VT, const VT& >;
160 
162  using RightOperand = If_t< IsExpression_v<MT>, const MT, const MT& >;
163 
166 
169  //**********************************************************************************************
170 
171  //**Compilation flags***************************************************************************
173  static constexpr bool simdEnabled = false;
174 
176  static constexpr bool smpAssignable =
178  //**********************************************************************************************
179 
180  //**Constructor*********************************************************************************
183  explicit inline TDVecTSMatMultExpr( const VT& vec, const MT& mat ) noexcept
184  : vec_( vec ) // Left-hand side dense vector of the multiplication expression
185  , mat_( mat ) // Right-hand side sparse matrix of the multiplication expression
186  {
187  BLAZE_INTERNAL_ASSERT( vec_.size() == mat.rows(), "Invalid vector and matrix sizes" );
188  }
189  //**********************************************************************************************
190 
191  //**Subscript operator**************************************************************************
197  inline ReturnType operator[]( size_t index ) const {
198  BLAZE_INTERNAL_ASSERT( index < mat_.columns(), "Invalid vector access index" );
199  return vec_ * column( mat_, index, unchecked );
200  }
201  //**********************************************************************************************
202 
203  //**At function*********************************************************************************
210  inline ReturnType at( size_t index ) const {
211  if( index >= mat_.columns() ) {
212  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
213  }
214  return (*this)[index];
215  }
216  //**********************************************************************************************
217 
218  //**Size function*******************************************************************************
223  inline size_t size() const noexcept {
224  return mat_.columns();
225  }
226  //**********************************************************************************************
227 
228  //**Left operand access*************************************************************************
233  inline LeftOperand leftOperand() const noexcept {
234  return vec_;
235  }
236  //**********************************************************************************************
237 
238  //**Right operand access************************************************************************
243  inline RightOperand rightOperand() const noexcept {
244  return mat_;
245  }
246  //**********************************************************************************************
247 
248  //**********************************************************************************************
254  template< typename T >
255  inline bool canAlias( const T* alias ) const noexcept {
256  return ( vec_.isAliased( alias ) || mat_.isAliased( alias ) );
257  }
258  //**********************************************************************************************
259 
260  //**********************************************************************************************
266  template< typename T >
267  inline bool isAliased( const T* alias ) const noexcept {
268  return ( vec_.isAliased( alias ) || mat_.isAliased( alias ) );
269  }
270  //**********************************************************************************************
271 
272  //**********************************************************************************************
277  inline bool isAligned() const noexcept {
278  return vec_.isAligned();
279  }
280  //**********************************************************************************************
281 
282  //**********************************************************************************************
287  inline bool canSMPAssign() const noexcept {
288  return ( size() > SMP_TDVECTSMATMULT_THRESHOLD );
289  }
290  //**********************************************************************************************
291 
292  private:
293  //**Member variables****************************************************************************
296  //**********************************************************************************************
297 
298  //**Assignment to dense vectors*****************************************************************
313  template< typename VT2 > // Type of the target dense vector
314  friend inline auto assign( DenseVector<VT2,true>& lhs, const TDVecTSMatMultExpr& rhs )
316  {
318 
319  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
320 
321  if( rhs.mat_.rows() == 0UL ) {
322  reset( ~lhs );
323  return;
324  }
325 
326  LT x( serial( rhs.vec_ ) ); // Evaluation of the left-hand side dense vector operator
327  RT A( serial( rhs.mat_ ) ); // Evaluation of the right-hand side sparse matrix operator
328 
329  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
330  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
331  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
332  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).size() , "Invalid vector size" );
333 
334  assign( ~lhs, x * A );
335  }
336  //**********************************************************************************************
337 
338  //**Assignment to sparse vectors****************************************************************
353  template< typename VT2 > // Type of the target sparse vector
354  friend inline auto assign( SparseVector<VT2,true>& lhs, const TDVecTSMatMultExpr& rhs )
356  {
358 
362 
363  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
364 
365  const ResultType tmp( serial( rhs ) );
366  assign( ~lhs, tmp );
367  }
368  //**********************************************************************************************
369 
370  //**Addition assignment to dense vectors********************************************************
385  template< typename VT2 > // Type of the target dense vector
386  friend inline auto addAssign( DenseVector<VT2,true>& lhs, const TDVecTSMatMultExpr& rhs )
388  {
390 
391  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
392 
393  if( rhs.mat_.rows() == 0UL ) {
394  return;
395  }
396 
397  LT x( serial( rhs.vec_ ) ); // Evaluation of the left-hand side dense vector operator
398  RT A( serial( rhs.mat_ ) ); // Evaluation of the right-hand side sparse matrix operator
399 
400  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
401  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
402  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
403  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).size() , "Invalid vector size" );
404 
405  addAssign( ~lhs, x * A );
406  }
407  //**********************************************************************************************
408 
409  //**Addition assignment to sparse vectors*******************************************************
410  // No special implementation for the addition assignment to sparse vectors.
411  //**********************************************************************************************
412 
413  //**Subtraction assignment to dense vectors*****************************************************
428  template< typename VT2 > // Type of the target dense vector
429  friend inline auto subAssign( DenseVector<VT2,true>& lhs, const TDVecTSMatMultExpr& rhs )
431  {
433 
434  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
435 
436  if( rhs.mat_.rows() == 0UL ) {
437  return;
438  }
439 
440  LT x( serial( rhs.vec_ ) ); // Evaluation of the left-hand side dense vector operator
441  RT A( serial( rhs.mat_ ) ); // Evaluation of the right-hand side sparse matrix operator
442 
443  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
444  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
445  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
446  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).size() , "Invalid vector size" );
447 
448  subAssign( ~lhs, x * A );
449  }
450  //**********************************************************************************************
451 
452  //**Subtraction assignment to sparse vectors****************************************************
453  // No special implementation for the subtraction assignment to sparse vectors.
454  //**********************************************************************************************
455 
456  //**Multiplication assignment to dense vectors**************************************************
471  template< typename VT2 > // Type of the target dense vector
472  friend inline auto multAssign( DenseVector<VT2,true>& lhs, const TDVecTSMatMultExpr& rhs )
474  {
476 
480 
481  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
482 
483  const ResultType tmp( serial( rhs ) );
484  multAssign( ~lhs, tmp );
485  }
486  //**********************************************************************************************
487 
488  //**Multiplication assignment to sparse vectors*************************************************
489  // No special implementation for the multiplication assignment to sparse vectors.
490  //**********************************************************************************************
491 
492  //**Division assignment to dense vectors********************************************************
507  template< typename VT2 > // Type of the target dense vector
508  friend inline auto divAssign( DenseVector<VT2,true>& lhs, const TDVecTSMatMultExpr& rhs )
510  {
512 
516 
517  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
518 
519  const ResultType tmp( serial( rhs ) );
520  divAssign( ~lhs, tmp );
521  }
522  //**********************************************************************************************
523 
524  //**Division assignment to sparse vectors*******************************************************
525  // No special implementation for the division assignment to sparse vectors.
526  //**********************************************************************************************
527 
528  //**SMP assignment to dense vectors*************************************************************
542  template< typename VT2 > // Type of the target dense vector
543  friend inline auto smpAssign( DenseVector<VT2,true>& lhs, const TDVecTSMatMultExpr& rhs )
545  {
547 
548  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
549 
550  if( rhs.mat_.rows() == 0UL ) {
551  reset( ~lhs );
552  return;
553  }
554 
555  LT x( rhs.vec_ ); // Evaluation of the left-hand side dense vector operator
556  RT A( rhs.mat_ ); // Evaluation of the right-hand side sparse matrix operator
557 
558  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
559  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
560  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
561  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).size() , "Invalid vector size" );
562 
563  smpAssign( ~lhs, x * A );
564  }
565  //**********************************************************************************************
566 
567  //**SMP assignment to sparse vectors************************************************************
581  template< typename VT2 > // Type of the target sparse vector
582  friend inline auto smpAssign( SparseVector<VT2,true>& lhs, const TDVecTSMatMultExpr& rhs )
584  {
586 
590 
591  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
592 
593  const ResultType tmp( rhs );
594  smpAssign( ~lhs, tmp );
595  }
596  //**********************************************************************************************
597 
598  //**SMP addition assignment to dense vectors****************************************************
612  template< typename VT2 > // Type of the target dense vector
613  friend inline auto smpAddAssign( DenseVector<VT2,true>& lhs, const TDVecTSMatMultExpr& rhs )
615  {
617 
618  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
619 
620  if( rhs.mat_.rows() == 0UL ) {
621  return;
622  }
623 
624  LT x( rhs.vec_ ); // Evaluation of the left-hand side dense vector operator
625  RT A( rhs.mat_ ); // Evaluation of the right-hand side sparse matrix operator
626 
627  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
628  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
629  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
630  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).size() , "Invalid vector size" );
631 
632  smpAddAssign( ~lhs, x * A );
633  }
634  //**********************************************************************************************
635 
636  //**SMP addition assignment to sparse vectors***************************************************
637  // No special implementation for the SMP addition assignment to sparse vectors.
638  //**********************************************************************************************
639 
640  //**SMP subtraction assignment to dense vectors*************************************************
654  template< typename VT2 > // Type of the target dense vector
655  friend inline auto smpSubAssign( DenseVector<VT2,true>& lhs, const TDVecTSMatMultExpr& rhs )
657  {
659 
660  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
661 
662  if( rhs.mat_.rows() == 0UL ) {
663  return;
664  }
665 
666  LT x( rhs.vec_ ); // Evaluation of the left-hand side dense vector operator
667  RT A( rhs.mat_ ); // Evaluation of the right-hand side sparse matrix operator
668 
669  BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
670  BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
671  BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
672  BLAZE_INTERNAL_ASSERT( A.columns() == (~lhs).size() , "Invalid vector size" );
673 
674  smpSubAssign( ~lhs, x * A );
675  }
676  //**********************************************************************************************
677 
678  //**SMP subtraction assignment to sparse vectors************************************************
679  // No special implementation for the SMP subtraction assignment to sparse vectors.
680  //**********************************************************************************************
681 
682  //**SMP multiplication assignment to dense vectors**********************************************
696  template< typename VT2 > // Type of the target dense vector
697  friend inline auto smpMultAssign( DenseVector<VT2,true>& lhs, const TDVecTSMatMultExpr& rhs )
699  {
701 
705 
706  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
707 
708  const ResultType tmp( rhs );
709  smpMultAssign( ~lhs, tmp );
710  }
711  //**********************************************************************************************
712 
713  //**SMP multiplication assignment to sparse vectors*********************************************
714  // No special implementation for the SMP multiplication assignment to sparse vectors.
715  //**********************************************************************************************
716 
717  //**SMP division assignment to dense vectors****************************************************
731  template< typename VT2 > // Type of the target dense vector
732  friend inline auto smpDivAssign( DenseVector<VT2,true>& lhs, const TDVecTSMatMultExpr& rhs )
734  {
736 
740 
741  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
742 
743  const ResultType tmp( rhs );
744  smpDivAssign( ~lhs, tmp );
745  }
746  //**********************************************************************************************
747 
748  //**SMP division assignment to sparse vectors***************************************************
749  // No special implementation for the SMP division assignment to sparse vectors.
750  //**********************************************************************************************
751 
752  //**Compile time checks*************************************************************************
761  //**********************************************************************************************
762 };
763 //*************************************************************************************************
764 
765 
766 
767 
768 //=================================================================================================
769 //
770 // GLOBAL BINARY ARITHMETIC OPERATORS
771 //
772 //=================================================================================================
773 
774 //*************************************************************************************************
787 template< typename VT // Type of the left-hand side dense vector
788  , typename MT // Type of the right-hand side sparse matrix
789  , DisableIf_t< ( IsIdentity_v<MT> &&
790  IsSame_v< ElementType_t<VT>, ElementType_t<MT> > ) ||
791  IsZero_v<MT> >* = nullptr >
792 inline const TDVecTSMatMultExpr<VT,MT>
793  tdvectsmatmult( const DenseVector<VT,true>& vec, const SparseMatrix<MT,true>& mat )
794 {
796 
797  BLAZE_INTERNAL_ASSERT( (~vec).size() == (~mat).rows(), "Invalid vector and matrix sizes" );
798 
799  return TDVecTSMatMultExpr<VT,MT>( ~vec, ~mat );
800 }
802 //*************************************************************************************************
803 
804 
805 //*************************************************************************************************
819 template< typename VT // Type of the left-hand side dense vector
820  , typename MT // Type of the right-hand side sparse matrix
821  , EnableIf_t< IsIdentity_v<MT> &&
822  IsSame_v< ElementType_t<VT>, ElementType_t<MT> > >* = nullptr >
823 inline const VT&
824  tdvectsmatmult( const DenseVector<VT,true>& vec, const SparseMatrix<MT,true>& mat )
825 {
827 
828  UNUSED_PARAMETER( mat );
829 
830  BLAZE_INTERNAL_ASSERT( (~vec).size() == (~mat).rows(), "Invalid vector and matrix sizes" );
831 
832  return (~vec);
833 }
835 //*************************************************************************************************
836 
837 
838 //*************************************************************************************************
851 template< typename VT // Type of the left-hand side dense vector
852  , typename MT // Type of the right-hand side sparse matrix
853  , EnableIf_t< IsZero_v<MT> >* = nullptr >
854 inline decltype(auto)
855  tdvectsmatmult( const DenseVector<VT,true>& vec, const SparseMatrix<MT,true>& mat )
856 {
858 
859  UNUSED_PARAMETER( vec );
860 
861  BLAZE_INTERNAL_ASSERT( (~vec).size() == (~mat).rows(), "Invalid vector and matrix sizes" );
862 
863  using ReturnType = const MultTrait_t< ResultType_t<VT>, ResultType_t<MT> >;
864 
867 
868  return ReturnType( (~mat).columns() );
869 }
871 //*************************************************************************************************
872 
873 
874 //*************************************************************************************************
905 template< typename VT // Type of the left-hand side dense vector
906  , typename MT > // Type of the right-hand side sparse matrix
907 inline decltype(auto)
908  operator*( const DenseVector<VT,true>& vec, const SparseMatrix<MT,true>& mat )
909 {
911 
913 
914  if( (~vec).size() != (~mat).rows() ) {
915  BLAZE_THROW_INVALID_ARGUMENT( "Vector and matrix sizes do not match" );
916  }
917 
918  return tdvectsmatmult( ~vec, ~mat );
919 }
920 //*************************************************************************************************
921 
922 
923 
924 
925 //=================================================================================================
926 //
927 // ISALIGNED SPECIALIZATIONS
928 //
929 //=================================================================================================
930 
931 //*************************************************************************************************
933 template< typename VT, typename MT >
934 struct IsAligned< TDVecTSMatMultExpr<VT,MT> >
935  : public IsAligned<VT>
936 {};
938 //*************************************************************************************************
939 
940 } // namespace blaze
941 
942 #endif
friend auto smpMultAssign(DenseVector< VT2, true > &lhs, const TDVecTSMatMultExpr &rhs) -> EnableIf_t< UseSMPAssign_v< VT2 > >
SMP multiplication assignment of a transpose dense vector-transpose sparse matrix multiplication to a...
Definition: TDVecTSMatMultExpr.h:697
MultTrait_t< VRT, MRT > ResultType
Result type for expression template evaluations.
Definition: TDVecTSMatMultExpr.h:150
#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
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: TDVecTSMatMultExpr.h:173
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: TDVecTSMatMultExpr.h:151
RightOperand rightOperand() const noexcept
Returns the right-hand side transpose sparse matrix operand.
Definition: TDVecTSMatMultExpr.h:243
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
Header file for the blaze::checked and blaze::unchecked instances.
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: TDVecTSMatMultExpr.h:176
Header file for the UNUSED_PARAMETER function template.
Header file for basic type definitions.
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: TDVecTSMatMultExpr.h:233
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: TDVecTSMatMultExpr.h:223
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias declaration for the If class template.The If_t alias declaration provides a convenien...
Definition: If.h:109
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
Header file for the serial shim.
friend auto smpAssign(DenseVector< VT2, true > &lhs, const TDVecTSMatMultExpr &rhs) -> EnableIf_t< UseSMPAssign_v< VT2 > >
SMP assignment of a transpose dense vector-transpose sparse matrix multiplication to a dense vector (...
Definition: TDVecTSMatMultExpr.h:543
Expression object for transpose dense vector-transpose sparse matrix multiplications.The TDVecTSMatMultExpr class represents the compile time expression for multiplications between transpose dense vectors and column-major sparse matrices.
Definition: Forward.h:168
friend auto smpDivAssign(DenseVector< VT2, true > &lhs, const TDVecTSMatMultExpr &rhs) -> EnableIf_t< UseSMPAssign_v< VT2 > >
SMP division assignment of a transpose dense vector-transpose sparse matrix multiplication to a dense...
Definition: TDVecTSMatMultExpr.h:732
ResultType_t< VT > VRT
Result type of the left-hand side dense vector expression.
Definition: TDVecTSMatMultExpr.h:100
TDVecTSMatMultExpr(const VT &vec, const MT &mat) noexcept
Constructor for the TDVecTSMatMultExpr class.
Definition: TDVecTSMatMultExpr.h:183
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
RightOperand mat_
Right-hand side sparse matrix of the multiplication expression.
Definition: TDVecTSMatMultExpr.h:295
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
friend auto smpSubAssign(DenseVector< VT2, true > &lhs, const TDVecTSMatMultExpr &rhs) -> EnableIf_t< UseSMPAssign_v< VT2 > >
SMP subtraction assignment of a transpose dense vector-transpose sparse matrix multiplication to a de...
Definition: TDVecTSMatMultExpr.h:655
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
Constraint on the data type.
Header file for the DenseVector base class.
Header file for the IsIdentity type trait.
Header file for the Computation base class.
Header file for the reset shim.
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: TDVecTSMatMultExpr.h:210
Header file for the RequiresEvaluation type trait.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: TDVecTSMatMultExpr.h:267
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
If_t< IsExpression_v< MT >, const MT, const MT &> RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TDVecTSMatMultExpr.h:162
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
CompositeType_t< VT > VCT
Composite type of the left-hand side dense vector expression.
Definition: TDVecTSMatMultExpr.h:102
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:137
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
If_t< evaluateMatrix, const MRT, MCT > RT
Composite type of the right-hand side sparse matrix expression.
Definition: TDVecTSMatMultExpr.h:168
Constraint on the data type.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TDVecTSMatMultExpr.h:153
Header file for the DisableIf class template.
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: ColumnMajorMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_BE_ZERO_TYPE(T)
Constraint on the data type.In case the given data type T is not a zero vector or matrix type...
Definition: Zero.h:61
friend auto multAssign(DenseVector< VT2, true > &lhs, const TDVecTSMatMultExpr &rhs) -> EnableIf_t< UseAssign_v< VT2 > >
Multiplication assignment of a transpose dense vector-transpose sparse matrix multiplication to a den...
Definition: TDVecTSMatMultExpr.h:472
#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
static constexpr bool useAssign
Compilation switch for the evaluation strategy of the multiplication expression.
Definition: TDVecTSMatMultExpr.h:124
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: TDVecTSMatMultExpr.h:152
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
Header file for the IsAligned type trait.
ResultType_t< MT > MRT
Result type of the right-hand side sparse matrix expression.
Definition: TDVecTSMatMultExpr.h:101
LeftOperand vec_
Left-hand side dense vector of the multiplication expression.
Definition: TDVecTSMatMultExpr.h:294
#define BLAZE_CONSTRAINT_MUST_NOT_BE_MATMATMULTEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a matrix/matrix multiplication expressio...
Definition: MatMatMultExpr.h:83
Constraint on the data type.
friend auto assign(DenseVector< VT2, true > &lhs, const TDVecTSMatMultExpr &rhs) -> EnableIf_t< UseAssign_v< VT2 > >
Assignment of a transpose dense vector-transpose sparse matrix multiplication to a dense vector ( )...
Definition: TDVecTSMatMultExpr.h:314
Header file for the exception macros of the math module.
friend auto smpAddAssign(DenseVector< VT2, true > &lhs, const TDVecTSMatMultExpr &rhs) -> EnableIf_t< UseSMPAssign_v< VT2 > >
SMP addition assignment of a transpose dense vector-transpose sparse matrix multiplication to a dense...
Definition: TDVecTSMatMultExpr.h:613
Constraint on the data type.
Header file for all forward declarations for expression class templates.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: TDVecTSMatMultExpr.h:287
Header file for the EnableIf class template.
friend auto subAssign(DenseVector< VT2, true > &lhs, const TDVecTSMatMultExpr &rhs) -> EnableIf_t< UseAssign_v< VT2 > >
Subtraction assignment of a transpose dense vector-transpose sparse matrix multiplication to a dense ...
Definition: TDVecTSMatMultExpr.h:429
typename MultTrait< T1, T2 >::Type MultTrait_t
Auxiliary alias declaration for the MultTrait class template.The MultTrait_t alias declaration provid...
Definition: MultTrait.h:240
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.The TransposeType_t alias declaration pro...
Definition: Aliases.h:470
Header file for run time assertion macros.
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.The CompositeType_t alias declaration pro...
Definition: Aliases.h:90
If_t< IsExpression_v< VT >, const VT, const VT &> LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: TDVecTSMatMultExpr.h:159
Header file for the IsZero type trait.
Constraint on the data type.
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
Header file for the TVecMatMultExpr base class.
friend auto divAssign(DenseVector< VT2, true > &lhs, const TDVecTSMatMultExpr &rhs) -> EnableIf_t< UseAssign_v< VT2 > >
Division assignment of a transpose dense vector-transpose sparse matrix multiplication to a dense vec...
Definition: TDVecTSMatMultExpr.h:508
Constraints on the storage order of matrix types.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
friend auto addAssign(DenseVector< VT2, true > &lhs, const TDVecTSMatMultExpr &rhs) -> EnableIf_t< UseAssign_v< VT2 > >
Addition assignment of a transpose dense vector-transpose sparse matrix multiplication to a dense vec...
Definition: TDVecTSMatMultExpr.h:386
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
#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
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_TVECMATMULTEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid vector/matrix ...
Definition: TVecMatMultExpr.h:104
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: TDVecTSMatMultExpr.h:277
CompositeType_t< MT > MCT
Composite type of the right-hand side sparse matrix expression.
Definition: TDVecTSMatMultExpr.h:103
friend auto smpAssign(SparseVector< VT2, true > &lhs, const TDVecTSMatMultExpr &rhs) -> EnableIf_t< UseSMPAssign_v< VT2 > >
SMP assignment of a transpose dense vector-transpose sparse matrix multiplication to a sparse vector ...
Definition: TDVecTSMatMultExpr.h:582
Header file for the IsComputation type trait class.
If_t< useAssign, const ResultType, const TDVecTSMatMultExpr &> CompositeType
Data type for composite expression templates.
Definition: TDVecTSMatMultExpr.h:156
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:138
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: TDVecTSMatMultExpr.h:197
#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
If_t< evaluateVector, const VRT, VCT > LT
Composite type of the left-hand side dense vector expression.
Definition: TDVecTSMatMultExpr.h:165
static constexpr bool evaluateMatrix
Compilation switch for the composite type of the right-hand side sparse matrix expression.
Definition: TDVecTSMatMultExpr.h:113
Constraint on the data type.
static constexpr bool evaluateVector
Compilation switch for the composite type of the left-hand side dense vector expression.
Definition: TDVecTSMatMultExpr.h:108
#define BLAZE_CONSTRAINT_MUST_NOT_BE_ZERO_TYPE(T)
Constraint on the data type.In case the given data type T is a zero vector or matrix type...
Definition: Zero.h:81
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
friend auto assign(SparseVector< VT2, true > &lhs, const TDVecTSMatMultExpr &rhs) -> EnableIf_t< UseAssign_v< VT2 > >
Assignment of a transpose dense vector-transpose sparse matrix multiplication to a sparse vector ( )...
Definition: TDVecTSMatMultExpr.h:354
#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
Constraint on the transpose flag of vector types.
Header file for the IsExpression type trait class.
Header file for the function trace functionality.
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: TDVecTSMatMultExpr.h:255