Blaze 3.9
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>
69#include <blaze/util/Assert.h>
70#include <blaze/util/EnableIf.h>
73#include <blaze/util/mpl/If.h>
74#include <blaze/util/Types.h>
75
76
77namespace blaze {
78
79//=================================================================================================
80//
81// CLASS SMATDVECMULTEXPR
82//
83//=================================================================================================
84
85//*************************************************************************************************
92template< typename MT // Type of the left-hand side sparse matrix
93 , typename VT > // Type of the right-hand side dense vector
95 : public MatVecMultExpr< DenseVector< SMatDVecMultExpr<MT,VT>, false > >
96 , private Computation
97{
98 private:
99 //**Type definitions****************************************************************************
104 //**********************************************************************************************
105
106 //**********************************************************************************************
108 static constexpr bool evaluateMatrix = RequiresEvaluation_v<MT>;
109 //**********************************************************************************************
110
111 //**********************************************************************************************
113 static constexpr bool evaluateVector = ( IsComputation_v<VT> || RequiresEvaluation_v<VT> );
114 //**********************************************************************************************
115
116 //**********************************************************************************************
118
124 static constexpr bool useAssign = ( evaluateMatrix || evaluateVector );
125 //**********************************************************************************************
126
127 //**********************************************************************************************
129
130 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****************************************************************************
150
153
157 using ReturnType = const ElementType;
158
161
163 using LeftOperand = If_t< IsExpression_v<MT>, const MT, const MT& >;
164
166 using RightOperand = If_t< IsExpression_v<VT>, const VT, const VT& >;
167
170
173 //**********************************************************************************************
174
175 //**Compilation flags***************************************************************************
177 static constexpr bool simdEnabled = false;
178
180 static constexpr bool smpAssignable =
181 ( !evaluateMatrix && MT::smpAssignable && !evaluateVector && VT::smpAssignable );
182 //**********************************************************************************************
183
184 //**Constructor*********************************************************************************
190 inline SMatDVecMultExpr( const MT& mat, const VT& vec ) noexcept
191 : mat_( mat ) // Left-hand side sparse matrix of the multiplication expression
192 , vec_( vec ) // Right-hand side dense vector of the multiplication expression
193 {
194 BLAZE_INTERNAL_ASSERT( mat_.columns() == vec_.size(), "Invalid matrix and vector sizes" );
195 }
196 //**********************************************************************************************
197
198 //**Subscript operator**************************************************************************
204 inline ReturnType operator[]( size_t index ) const {
205 BLAZE_INTERNAL_ASSERT( index < mat_.rows(), "Invalid vector access index" );
206 return row( mat_, index, unchecked ) * vec_;
207 }
208 //**********************************************************************************************
209
210 //**At function*********************************************************************************
217 inline ReturnType at( size_t index ) const {
218 if( index >= mat_.rows() ) {
219 BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
220 }
221 return (*this)[index];
222 }
223 //**********************************************************************************************
224
225 //**Size function*******************************************************************************
230 inline size_t size() const noexcept {
231 return mat_.rows();
232 }
233 //**********************************************************************************************
234
235 //**Left operand access*************************************************************************
240 inline LeftOperand leftOperand() const noexcept {
241 return mat_;
242 }
243 //**********************************************************************************************
244
245 //**Right operand access************************************************************************
250 inline RightOperand rightOperand() const noexcept {
251 return vec_;
252 }
253 //**********************************************************************************************
254
255 //**********************************************************************************************
261 template< typename T >
262 inline bool canAlias( const T* alias ) const noexcept {
263 return ( mat_.isAliased( alias ) || vec_.isAliased( alias ) );
264 }
265 //**********************************************************************************************
266
267 //**********************************************************************************************
273 template< typename T >
274 inline bool isAliased( const T* alias ) const noexcept {
275 return ( mat_.isAliased( alias ) || vec_.isAliased( alias ) );
276 }
277 //**********************************************************************************************
278
279 //**********************************************************************************************
284 inline bool isAligned() const noexcept {
285 return vec_.isAligned();
286 }
287 //**********************************************************************************************
288
289 //**********************************************************************************************
294 inline bool canSMPAssign() const noexcept {
295 return ( size() > SMP_SMATDVECMULT_THRESHOLD );
296 }
297 //**********************************************************************************************
298
299 private:
300 //**Member variables****************************************************************************
303 //**********************************************************************************************
304
305 //**Assignment to dense vectors*****************************************************************
321 template< typename VT1 > // Type of the target dense vector
322 friend inline auto assign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
324 {
326
327 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
328
329 if( rhs.mat_.columns() == 0UL ) {
330 reset( *lhs );
331 return;
332 }
333
334 LT A( serial( rhs.mat_ ) ); // Evaluation of the left-hand side sparse matrix operand
335 RT x( serial( rhs.vec_ ) ); // Evaluation of the right-hand side dense vector operand
336
337 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
338 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
339 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
340 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).size() , "Invalid vector size" );
341
342 assign( *lhs, A * x );
343 }
345 //**********************************************************************************************
346
347 //**Assignment to sparse vectors****************************************************************
363 template< typename VT1 > // Type of the target sparse vector
364 friend inline auto assign( SparseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
366 {
368
372
373 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
374
375 const ResultType tmp( serial( rhs ) );
376 assign( *lhs, tmp );
377 }
379 //**********************************************************************************************
380
381 //**Addition assignment to dense vectors********************************************************
397 template< typename VT1 > // Type of the target dense vector
398 friend inline auto addAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
399 -> EnableIf_t< UseAssign_v<VT1> >
400 {
402
403 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
404
405 if( rhs.mat_.columns() == 0UL ) {
406 return;
407 }
408
409 LT A( serial( rhs.mat_ ) ); // Evaluation of the left-hand side sparse matrix operand
410 RT x( serial( rhs.vec_ ) ); // Evaluation of the right-hand side dense vector operand
411
412 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
413 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
414 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
415 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).size() , "Invalid vector size" );
416
417 addAssign( *lhs, A * x );
418 }
420 //**********************************************************************************************
421
422 //**Addition assignment to sparse vectors*******************************************************
423 // No special implementation for the addition assignment to sparse vectors.
424 //**********************************************************************************************
425
426 //**Subtraction assignment to dense vectors*****************************************************
442 template< typename VT1 > // Type of the target dense vector
443 friend inline auto subAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
444 -> EnableIf_t< UseAssign_v<VT1> >
445 {
447
448 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
449
450 if( rhs.mat_.columns() == 0UL ) {
451 return;
452 }
453
454 LT A( serial( rhs.mat_ ) ); // Evaluation of the left-hand side sparse matrix operand
455 RT x( serial( rhs.vec_ ) ); // Evaluation of the right-hand side dense vector operand
456
457 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
458 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
459 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
460 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).size() , "Invalid vector size" );
461
462 subAssign( *lhs, A * x );
463 }
465 //**********************************************************************************************
466
467 //**Subtraction assignment to sparse vectors****************************************************
468 // No special implementation for the subtraction assignment to sparse vectors.
469 //**********************************************************************************************
470
471 //**Multiplication assignment to dense vectors**************************************************
487 template< typename VT1 > // Type of the target dense vector
488 friend inline auto multAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
489 -> EnableIf_t< UseAssign_v<VT1> >
490 {
492
496
497 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
498
499 const ResultType tmp( serial( rhs ) );
500 multAssign( *lhs, tmp );
501 }
503 //**********************************************************************************************
504
505 //**Multiplication assignment to sparse vectors*************************************************
506 // No special implementation for the multiplication assignment to sparse vectors.
507 //**********************************************************************************************
508
509 //**Division assignment to dense vectors********************************************************
525 template< typename VT1 > // Type of the target dense vector
526 friend inline auto divAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
527 -> EnableIf_t< UseAssign_v<VT1> >
528 {
530
534
535 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
536
537 const ResultType tmp( serial( rhs ) );
538 divAssign( *lhs, tmp );
539 }
541 //**********************************************************************************************
542
543 //**Division assignment to sparse vectors*******************************************************
544 // No special implementation for the division assignment to sparse vectors.
545 //**********************************************************************************************
546
547 //**SMP assignment to dense vectors*************************************************************
562 template< typename VT1 > // Type of the target dense vector
563 friend inline auto smpAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
564 -> EnableIf_t< UseSMPAssign_v<VT1> >
565 {
567
568 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
569
570 if( rhs.mat_.columns() == 0UL ) {
571 reset( *lhs );
572 return;
573 }
574
575 LT A( rhs.mat_ ); // Evaluation of the left-hand side sparse matrix operand
576 RT x( rhs.vec_ ); // Evaluation of the right-hand side dense vector operand
577
578 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
579 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
580 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
581 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).size() , "Invalid vector size" );
582
583 smpAssign( *lhs, A * x );
584 }
586 //**********************************************************************************************
587
588 //**SMP assignment to sparse vectors************************************************************
603 template< typename VT1 > // Type of the target sparse vector
604 friend inline auto smpAssign( SparseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
605 -> EnableIf_t< UseSMPAssign_v<VT1> >
606 {
608
612
613 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
614
615 const ResultType tmp( rhs );
616 smpAssign( *lhs, tmp );
617 }
619 //**********************************************************************************************
620
621 //**SMP addition assignment to dense vectors****************************************************
636 template< typename VT1 > // Type of the target dense vector
637 friend inline auto smpAddAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
638 -> EnableIf_t< UseSMPAssign_v<VT1> >
639 {
641
642 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
643
644 if( rhs.mat_.columns() == 0UL ) {
645 return;
646 }
647
648 LT A( rhs.mat_ ); // Evaluation of the left-hand side sparse matrix operand
649 RT x( rhs.vec_ ); // Evaluation of the right-hand side dense vector operand
650
651 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
652 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
653 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
654 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).size() , "Invalid vector size" );
655
656 smpAddAssign( *lhs, A * x );
657 }
659 //**********************************************************************************************
660
661 //**SMP addition assignment to sparse vectors***************************************************
662 // No special implementation for the SMP addition assignment to sparse vectors.
663 //**********************************************************************************************
664
665 //**SMP subtraction assignment to dense vectors*************************************************
680 template< typename VT1 > // Type of the target dense vector
681 friend inline auto smpSubAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
682 -> EnableIf_t< UseSMPAssign_v<VT1> >
683 {
685
686 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
687
688 if( rhs.mat_.columns() == 0UL ) {
689 return;
690 }
691
692 LT A( rhs.mat_ ); // Evaluation of the left-hand side sparse matrix operand
693 RT x( rhs.vec_ ); // Evaluation of the right-hand side dense vector operand
694
695 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
696 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
697 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
698 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).size() , "Invalid vector size" );
699
700 smpSubAssign( *lhs, A * x );
701 }
703 //**********************************************************************************************
704
705 //**SMP subtraction assignment to sparse vectors************************************************
706 // No special implementation for the SMP subtraction assignment to sparse vectors.
707 //**********************************************************************************************
708
709 //**SMP multiplication assignment to dense vectors**********************************************
724 template< typename VT1 > // Type of the target dense vector
725 friend inline auto smpMultAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
726 -> EnableIf_t< UseSMPAssign_v<VT1> >
727 {
729
733
734 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
735
736 const ResultType tmp( rhs );
737 smpMultAssign( *lhs, tmp );
738 }
740 //**********************************************************************************************
741
742 //**SMP multiplication assignment to sparse vectors*********************************************
743 // No special implementation for the SMP multiplication assignment to sparse vectors.
744 //**********************************************************************************************
745
746 //**SMP division assignment to dense vectors****************************************************
761 template< typename VT1 > // Type of the target dense vector
762 friend inline auto smpDivAssign( DenseVector<VT1,false>& lhs, const SMatDVecMultExpr& rhs )
763 -> EnableIf_t< UseSMPAssign_v<VT1> >
764 {
766
770
771 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
772
773 const ResultType tmp( rhs );
774 smpDivAssign( *lhs, tmp );
775 }
777 //**********************************************************************************************
778
779 //**SMP division assignment to sparse vectors***************************************************
780 // No special implementation for the SMP division assignment to sparse vectors.
781 //**********************************************************************************************
782
783 //**Compile time checks*************************************************************************
792 //**********************************************************************************************
793};
794//*************************************************************************************************
795
796
797
798
799//=================================================================================================
800//
801// GLOBAL BINARY ARITHMETIC OPERATORS
802//
803//=================================================================================================
804
805//*************************************************************************************************
818template< typename MT // Type of the left-hand side sparse matrix
819 , typename VT // Type of the right-hand side dense vector
820 , DisableIf_t< ( IsIdentity_v<MT> &&
821 IsSame_v< ElementType_t<MT>, ElementType_t<VT> > ) ||
822 IsZero_v<MT> >* = nullptr >
823inline const SMatDVecMultExpr<MT,VT>
824 smatdvecmult( const SparseMatrix<MT,false>& mat, const DenseVector<VT,false>& vec )
825{
827
828 BLAZE_INTERNAL_ASSERT( (*mat).columns() == (*vec).size(), "Invalid matrix and vector sizes" );
829
830 return SMatDVecMultExpr<MT,VT>( *mat, *vec );
831}
833//*************************************************************************************************
834
835
836//*************************************************************************************************
850template< typename MT // Type of the left-hand side sparse matrix
851 , typename VT // Type of the right-hand side dense vector
852 , EnableIf_t< IsIdentity_v<MT> &&
853 IsSame_v< ElementType_t<MT>, ElementType_t<VT> > >* = nullptr >
854inline const VT&
855 smatdvecmult( const SparseMatrix<MT,false>& mat, const DenseVector<VT,false>& vec )
856{
858
859 MAYBE_UNUSED( mat );
860
861 BLAZE_INTERNAL_ASSERT( (*mat).columns() == (*vec).size(), "Invalid matrix and vector sizes" );
862
863 return (*vec);
864}
866//*************************************************************************************************
867
868
869//*************************************************************************************************
882template< typename MT // Type of the left-hand side sparse matrix
883 , typename VT // Type of the right-hand side dense vector
884 , EnableIf_t< IsZero_v<MT> >* = nullptr >
885inline decltype(auto)
886 smatdvecmult( const SparseMatrix<MT,false>& mat, const DenseVector<VT,false>& vec )
887{
889
890 MAYBE_UNUSED( vec );
891
892 BLAZE_INTERNAL_ASSERT( (*mat).columns() == (*vec).size(), "Invalid matrix and vector sizes" );
893
894 using ReturnType = const MultTrait_t< ResultType_t<MT>, ResultType_t<VT> >;
895
898
899 return ReturnType( (*mat).rows() );
900}
902//*************************************************************************************************
903
904
905//*************************************************************************************************
936template< typename MT // Type of the left-hand side sparse matrix
937 , typename VT > // Type of the right-hand side dense vector
938inline decltype(auto)
939 operator*( const SparseMatrix<MT,false>& mat, const DenseVector<VT,false>& vec )
940{
942
944
945 if( (*mat).columns() != (*vec).size() ) {
946 BLAZE_THROW_INVALID_ARGUMENT( "Matrix and vector sizes do not match" );
947 }
948
949 return smatdvecmult( *mat, *vec );
950}
951//*************************************************************************************************
952
953
954
955
956//=================================================================================================
957//
958// ISALIGNED SPECIALIZATIONS
959//
960//=================================================================================================
961
962//*************************************************************************************************
964template< typename MT, typename VT >
965struct IsAligned< SMatDVecMultExpr<MT,VT> >
966 : public IsAligned<VT>
967{};
969//*************************************************************************************************
970
971} // namespace blaze
972
973#endif
Header file for auxiliary alias declarations.
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.
Definition: Aliases.h:110
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition: Aliases.h:450
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition: Aliases.h:190
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.
Definition: Aliases.h:550
Header file for run time assertion macros.
Header file for the blaze::checked and blaze::unchecked instances.
Constraint on the transpose flag of vector types.
Header file for the EnableIf class template.
Header file for the function trace functionality.
Header file for the If class template.
Header file for the IsAligned type trait.
Header file for the IsComputation type trait class.
Header file for the IsExpression type trait class.
Header file for the IsIdentity type trait.
Deactivation of problematic macros.
Header file for the MAYBE_UNUSED function template.
Header file for the multiplication trait.
Constraints on the storage order of matrix types.
Constraint on the data type.
Base class for N-dimensional dense vectors.
Definition: DenseVector.h:77
Expression object for sparse matrix-dense vector multiplications.
Definition: SMatDVecMultExpr.h:97
If_t< useAssign, const ResultType, const SMatDVecMultExpr & > CompositeType
Data type for composite expression templates.
Definition: SMatDVecMultExpr.h:160
If_t< IsExpression_v< MT >, const MT, const MT & > LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: SMatDVecMultExpr.h:163
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse matrix operand.
Definition: SMatDVecMultExpr.h:240
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SMatDVecMultExpr.h:204
ResultType_t< MT > MRT
Result type of the left-hand side sparse matrix expression.
Definition: SMatDVecMultExpr.h:100
If_t< IsExpression_v< VT >, const VT, const VT & > RightOperand
Composite type of the right-hand side dense vector expression.
Definition: SMatDVecMultExpr.h:166
static constexpr bool evaluateVector
Compilation switch for the composite type of the right-hand side dense vector expression.
Definition: SMatDVecMultExpr.h:113
SMatDVecMultExpr(const MT &mat, const VT &vec) noexcept
Constructor for the SMatDVecMultExpr class.
Definition: SMatDVecMultExpr.h:190
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatDVecMultExpr.h:274
If_t< evaluateMatrix, const MRT, MCT > LT
Type for the assignment of the left-hand side sparse matrix operand.
Definition: SMatDVecMultExpr.h:169
If_t< evaluateVector, const VRT, VCT > RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: SMatDVecMultExpr.h:172
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: SMatDVecMultExpr.h:284
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SMatDVecMultExpr.h:155
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: SMatDVecMultExpr.h:177
static constexpr bool useAssign
Compilation switch for the evaluation strategy of the multiplication expression.
Definition: SMatDVecMultExpr.h:124
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: SMatDVecMultExpr.h:217
RightOperand vec_
Right-hand side dense vector of the multiplication expression.
Definition: SMatDVecMultExpr.h:302
MultTrait_t< MRT, VRT > ResultType
Result type for expression template evaluations.
Definition: SMatDVecMultExpr.h:154
RightOperand rightOperand() const noexcept
Returns the right-hand side dense vector operand.
Definition: SMatDVecMultExpr.h:250
static constexpr bool evaluateMatrix
Compilation switch for the composite type of the left-hand side sparse matrix expression.
Definition: SMatDVecMultExpr.h:108
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatDVecMultExpr.h:294
CompositeType_t< MT > MCT
Composite type of the left-hand side sparse matrix expression.
Definition: SMatDVecMultExpr.h:102
const ElementType ReturnType
Return type for expression template evaluations.
Definition: SMatDVecMultExpr.h:157
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: SMatDVecMultExpr.h:180
LeftOperand mat_
Left-hand side sparse matrix of the multiplication expression.
Definition: SMatDVecMultExpr.h:301
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: SMatDVecMultExpr.h:156
CompositeType_t< VT > VCT
Composite type of the right-hand side dense vector expression.
Definition: SMatDVecMultExpr.h:103
ResultType_t< VT > VRT
Result type of the right-hand side dense vector expression.
Definition: SMatDVecMultExpr.h:101
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: SMatDVecMultExpr.h:230
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatDVecMultExpr.h:262
Base class for sparse matrices.
Definition: SparseMatrix.h:77
Base class for sparse vectors.
Definition: SparseVector.h:72
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the Computation base class.
Header file for the DenseVector base class.
Header file for the MatVecMultExpr base class.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:812
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: RowMajorMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition: RequiresEvaluation.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_MATMATMULTEXPR_TYPE(T)
Constraint on the data type.
Definition: MatMatMultExpr.h:83
#define BLAZE_CONSTRAINT_MUST_NOT_BE_ZERO_TYPE(T)
Constraint on the data type.
Definition: Zero.h:81
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATVECMULTEXPR(T1, T2)
Constraint on the data type.
Definition: MatVecMultExpr.h:104
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: SparseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.
Definition: DenseVector.h:61
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE(T)
Constraint on the data type.
Definition: ColumnVector.h:61
#define BLAZE_CONSTRAINT_MUST_BE_ZERO_TYPE(T)
Constraint on the data type.
Definition: Zero.h:61
typename MultTrait< T1, T2 >::Type MultTrait_t
Auxiliary alias declaration for the MultTrait class template.
Definition: MultTrait.h:165
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition: Matrix.h:806
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:137
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
auto smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:221
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
auto smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP multiplication assignment of a vector to a dense vector.
Definition: DenseVector.h:192
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition: If.h:108
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition: Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:175
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition: FunctionTrace.h:94
constexpr Unchecked unchecked
Global Unchecked instance.
Definition: Check.h:146
Header file for the exception macros of the math module.
Header file for all forward declarations for expression class templates.
Header file for the reset shim.
Header file for the serial shim.
Base class for all compute expression templates.
Definition: Computation.h:68
Base class for all matrix/vector multiplication expression templates.
Definition: MatVecMultExpr.h:69
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
Header file for the IsZero type trait.
Header file for the RequiresEvaluation type trait.
Header file for basic type definitions.