Blaze 3.9
DMatSVecMultExpr.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_EXPRESSIONS_DMATSVECMULTEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_DMATSVECMULTEXPR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <blaze/math/Aliases.h>
78#include <blaze/util/Assert.h>
79#include <blaze/util/EnableIf.h>
82#include <blaze/util/mpl/If.h>
83#include <blaze/util/Types.h>
84
85
86namespace blaze {
87
88//=================================================================================================
89//
90// CLASS DMATSVECMULTEXPR
91//
92//=================================================================================================
93
94//*************************************************************************************************
101template< typename MT // Type of the left-hand side dense matrix
102 , typename VT > // Type of the right-hand side sparse vector
104 : public MatVecMultExpr< DenseVector< DMatSVecMultExpr<MT,VT>, false > >
105 , private Computation
106{
107 private:
108 //**Type definitions****************************************************************************
113 //**********************************************************************************************
114
115 //**********************************************************************************************
117 static constexpr bool evaluateMatrix = RequiresEvaluation_v<MT>;
118 //**********************************************************************************************
119
120 //**********************************************************************************************
122 static constexpr bool evaluateVector = ( IsComputation_v<VT> || RequiresEvaluation_v<VT> );
123 //**********************************************************************************************
124
125 //**********************************************************************************************
127
133 static constexpr bool useAssign = ( evaluateMatrix || evaluateVector );
134 //**********************************************************************************************
135
136 //**********************************************************************************************
138
139 template< typename VT2 >
140 static constexpr bool UseAssign_v = useAssign;
142 //**********************************************************************************************
143
144 //**********************************************************************************************
146
150 template< typename T1 >
151 static constexpr bool UseSMPAssign_v = useAssign;
153 //**********************************************************************************************
154
155 public:
156 //**Type definitions****************************************************************************
159
162
166 using ReturnType = const ElementType;
167
170
172 using LeftOperand = If_t< IsExpression_v<MT>, const MT, const MT& >;
173
175 using RightOperand = If_t< IsExpression_v<VT>, const VT, const VT& >;
176
179
182 //**********************************************************************************************
183
184 //**Compilation flags***************************************************************************
186 static constexpr bool simdEnabled = false;
187
189 static constexpr bool smpAssignable =
190 ( !evaluateMatrix && MT::smpAssignable && !evaluateVector && VT::smpAssignable );
191 //**********************************************************************************************
192
193 //**Constructor*********************************************************************************
199 inline DMatSVecMultExpr( const MT& mat, const VT& vec ) noexcept
200 : mat_( mat ) // Left-hand side dense matrix of the multiplication expression
201 , vec_( vec ) // Right-hand side sparse vector of the multiplication expression
202 {
203 BLAZE_INTERNAL_ASSERT( mat_.columns() == vec_.size(), "Invalid matrix and vector sizes" );
204 }
205 //**********************************************************************************************
206
207 //**Subscript operator**************************************************************************
213 inline ReturnType operator[]( size_t index ) const {
214 BLAZE_INTERNAL_ASSERT( index < mat_.rows(), "Invalid vector access index" );
215
216 if( IsDiagonal_v<MT> )
217 {
218 return mat_(index,index) * vec_[index];
219 }
220 else if( IsLower_v<MT> )
221 {
222 const size_t n( IsStrictlyLower_v<MT> ? index : index+1UL );
223 return subvector( row( mat_, index, unchecked ), 0UL, n, unchecked ) *
224 subvector( vec_, 0UL, n, unchecked );
225 }
226 else if( IsUpper_v<MT> )
227 {
228 const size_t begin( IsStrictlyUpper_v<MT> ? index+1UL : index );
229 const size_t n ( mat_.columns() - begin );
230 return subvector( row( mat_, index, unchecked ), begin, n, unchecked ) *
232 }
233 else
234 {
235 return row( mat_, index, unchecked ) * vec_;
236 }
237 }
238 //**********************************************************************************************
239
240 //**At function*********************************************************************************
247 inline ReturnType at( size_t index ) const {
248 if( index >= mat_.rows() ) {
249 BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
250 }
251 return (*this)[index];
252 }
253 //**********************************************************************************************
254
255 //**Size function*******************************************************************************
260 inline size_t size() const noexcept {
261 return mat_.rows();
262 }
263 //**********************************************************************************************
264
265 //**Left operand access*************************************************************************
270 inline LeftOperand leftOperand() const noexcept {
271 return mat_;
272 }
273 //**********************************************************************************************
274
275 //**Right operand access************************************************************************
280 inline RightOperand rightOperand() const noexcept {
281 return vec_;
282 }
283 //**********************************************************************************************
284
285 //**********************************************************************************************
291 template< typename T >
292 inline bool canAlias( const T* alias ) const noexcept {
293 return mat_.isAliased( alias ) || vec_.isAliased( alias );
294 }
295 //**********************************************************************************************
296
297 //**********************************************************************************************
303 template< typename T >
304 inline bool isAliased( const T* alias ) const noexcept {
305 return mat_.isAliased( alias ) || vec_.isAliased( alias );
306 }
307 //**********************************************************************************************
308
309 //**********************************************************************************************
314 inline bool isAligned() const noexcept {
315 return mat_.isAligned();
316 }
317 //**********************************************************************************************
318
319 //**********************************************************************************************
324 inline bool canSMPAssign() const noexcept {
325 return ( size() > SMP_DMATSVECMULT_THRESHOLD );
326 }
327 //**********************************************************************************************
328
329 private:
330 //**Member variables****************************************************************************
333 //**********************************************************************************************
334
335 //**Assignment to dense vectors*****************************************************************
351 template< typename VT1 > // Type of the target dense vector
352 friend inline auto assign( DenseVector<VT1,false>& lhs, const DMatSVecMultExpr& rhs )
354 {
356
357 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
358
359 // Evaluation of the right-hand side sparse vector operand
360 RT x( serial( rhs.vec_ ) );
361 if( x.nonZeros() == 0UL ) {
362 reset( *lhs );
363 return;
364 }
365
366 // Evaluation of the left-hand side dense matrix operand
367 LT A( serial( rhs.mat_ ) );
368
369 // Checking the evaluated operands
370 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
371 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
372 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
373 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).size() , "Invalid vector size" );
374
375 // Performing the dense matrix-sparse vector multiplication
376 assign( *lhs, A * x );
377 }
379 //**********************************************************************************************
380
381 //**Assignment to sparse vectors****************************************************************
397 template< typename VT1 > // Type of the target sparse vector
398 friend inline auto assign( SparseVector<VT1,false>& lhs, const DMatSVecMultExpr& rhs )
400 {
402
406
407 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
408
409 const ResultType tmp( serial( rhs ) );
410 assign( *lhs, tmp );
411 }
413 //**********************************************************************************************
414
415 //**Addition assignment to dense vectors********************************************************
431 template< typename VT1 > // Type of the target dense vector
432 friend inline auto addAssign( DenseVector<VT1,false>& lhs, const DMatSVecMultExpr& rhs )
433 -> EnableIf_t< UseAssign_v<VT1> >
434 {
436
437 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
438
439 // Evaluation of the right-hand side sparse vector operand
440 RT x( serial( rhs.vec_ ) );
441 if( x.nonZeros() == 0UL ) return;
442
443 // Evaluation of the left-hand side dense matrix operand
444 LT A( serial( rhs.mat_ ) );
445
446 // Checking the evaluated operands
447 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
448 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
449 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
450 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).size() , "Invalid vector size" );
451
452 // Performing the dense matrix-sparse vector multiplication
453 addAssign( *lhs, A * x );
454 }
456 //**********************************************************************************************
457
458 //**Addition assignment to sparse vectors*******************************************************
459 // No special implementation for the addition assignment to sparse vectors.
460 //**********************************************************************************************
461
462 //**Subtraction assignment to dense vectors*****************************************************
478 template< typename VT1 > // Type of the target dense vector
479 friend inline auto subAssign( DenseVector<VT1,false>& lhs, const DMatSVecMultExpr& rhs )
480 -> EnableIf_t< UseAssign_v<VT1> >
481 {
483
484 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
485
486 // Evaluation of the right-hand side sparse vector operand
487 RT x( serial( rhs.vec_ ) );
488 if( x.nonZeros() == 0UL ) return;
489
490 // Evaluation of the left-hand side dense matrix operand
491 LT A( serial( rhs.mat_ ) );
492
493 // Checking the evaluated operands
494 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
495 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
496 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
497 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).size() , "Invalid vector size" );
498
499 // Performing the dense matrix-sparse vector multiplication
500 subAssign( *lhs, A * x );
501 }
503 //**********************************************************************************************
504
505 //**Subtraction assignment to sparse vectors****************************************************
506 // No special implementation for the subtraction assignment to sparse vectors.
507 //**********************************************************************************************
508
509 //**Multiplication assignment to dense vectors**************************************************
525 template< typename VT1 > // Type of the target dense vector
526 friend inline auto multAssign( DenseVector<VT1,false>& lhs, const DMatSVecMultExpr& 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 multAssign( *lhs, tmp );
539 }
541 //**********************************************************************************************
542
543 //**Multiplication assignment to sparse vectors*************************************************
544 // No special implementation for the multiplication assignment to sparse vectors.
545 //**********************************************************************************************
546
547 //**Division assignment to dense vectors********************************************************
563 template< typename VT1 > // Type of the target dense vector
564 friend inline auto divAssign( DenseVector<VT1,false>& lhs, const DMatSVecMultExpr& rhs )
565 -> EnableIf_t< UseAssign_v<VT1> >
566 {
568
572
573 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
574
575 const ResultType tmp( serial( rhs ) );
576 divAssign( *lhs, tmp );
577 }
579 //**********************************************************************************************
580
581 //**Division assignment to sparse vectors*******************************************************
582 // No special implementation for the division assignment to sparse vectors.
583 //**********************************************************************************************
584
585 //**SMP assignment to dense vectors*************************************************************
600 template< typename VT1 > // Type of the target dense vector
601 friend inline auto smpAssign( DenseVector<VT1,false>& lhs, const DMatSVecMultExpr& rhs )
602 -> EnableIf_t< UseSMPAssign_v<VT1> >
603 {
605
606 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
607
608 // Evaluation of the right-hand side sparse vector operand
609 RT x( rhs.vec_ );
610 if( x.nonZeros() == 0UL ) {
611 reset( *lhs );
612 return;
613 }
614
615 // Evaluation of the left-hand side dense matrix operand
616 LT A( rhs.mat_ );
617
618 // Checking the evaluated operands
619 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
620 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
621 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
622 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).size() , "Invalid vector size" );
623
624 // Performing the dense matrix-sparse vector multiplication
625 smpAssign( *lhs, A * x );
626 }
628 //**********************************************************************************************
629
630 //**SMP assignment to sparse vectors************************************************************
645 template< typename VT1 > // Type of the target sparse vector
646 friend inline auto smpAssign( SparseVector<VT1,false>& lhs, const DMatSVecMultExpr& rhs )
647 -> EnableIf_t< UseSMPAssign_v<VT1> >
648 {
650
654
655 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
656
657 const ResultType tmp( rhs );
658 smpAssign( *lhs, tmp );
659 }
661 //**********************************************************************************************
662
663 //**SMP addition assignment to dense vectors****************************************************
678 template< typename VT1 > // Type of the target dense vector
679 friend inline auto smpAddAssign( DenseVector<VT1,false>& lhs, const DMatSVecMultExpr& rhs )
680 -> EnableIf_t< UseSMPAssign_v<VT1> >
681 {
683
684 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
685
686 // Evaluation of the right-hand side sparse vector operand
687 RT x( rhs.vec_ );
688 if( x.nonZeros() == 0UL ) return;
689
690 // Evaluation of the left-hand side dense matrix operand
691 LT A( rhs.mat_ );
692
693 // Checking the evaluated operands
694 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
695 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
696 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
697 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).size() , "Invalid vector size" );
698
699 // Performing the dense matrix-sparse vector multiplication
700 smpAddAssign( *lhs, A * x );
701 }
703 //**********************************************************************************************
704
705 //**SMP addition assignment to sparse vectors***************************************************
706 // No special implementation for the SMP addition assignment to sparse vectors.
707 //**********************************************************************************************
708
709 //**SMP subtraction assignment to dense vectors*************************************************
724 template< typename VT1 > // Type of the target dense vector
725 friend inline auto smpSubAssign( DenseVector<VT1,false>& lhs, const DMatSVecMultExpr& rhs )
726 -> EnableIf_t< UseSMPAssign_v<VT1> >
727 {
729
730 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
731
732 // Evaluation of the right-hand side sparse vector operand
733 RT x( rhs.vec_ );
734 if( x.nonZeros() == 0UL ) return;
735
736 // Evaluation of the left-hand side dense matrix operand
737 LT A( rhs.mat_ );
738
739 // Checking the evaluated operands
740 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
741 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
742 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
743 BLAZE_INTERNAL_ASSERT( A.rows() == (*lhs).size() , "Invalid vector size" );
744
745 // Performing the dense matrix-sparse vector multiplication
746 smpSubAssign( *lhs, A * x );
747 }
749 //**********************************************************************************************
750
751 //**SMP subtraction assignment to sparse vectors************************************************
752 // No special implementation for the SMP subtraction assignment to sparse vectors.
753 //**********************************************************************************************
754
755 //**SMP multiplication assignment to dense vectors**********************************************
770 template< typename VT1 > // Type of the target dense vector
771 friend inline auto smpMultAssign( DenseVector<VT1,false>& lhs, const DMatSVecMultExpr& rhs )
772 -> EnableIf_t< UseSMPAssign_v<VT1> >
773 {
775
779
780 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
781
782 const ResultType tmp( rhs );
783 smpMultAssign( *lhs, tmp );
784 }
786 //**********************************************************************************************
787
788 //**SMP multiplication assignment to sparse vectors*********************************************
789 // No special implementation for the SMP multiplication assignment to sparse vectors.
790 //**********************************************************************************************
791
792 //**SMP division assignment to dense vectors****************************************************
807 template< typename VT1 > // Type of the target dense vector
808 friend inline auto smpDivAssign( DenseVector<VT1,false>& lhs, const DMatSVecMultExpr& rhs )
809 -> EnableIf_t< UseSMPAssign_v<VT1> >
810 {
812
816
817 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
818
819 const ResultType tmp( rhs );
820 smpDivAssign( *lhs, tmp );
821 }
823 //**********************************************************************************************
824
825 //**SMP division assignment to sparse vectors***************************************************
826 // No special implementation for the SMP division assignment to sparse vectors.
827 //**********************************************************************************************
828
829 //**Compile time checks*************************************************************************
839 //**********************************************************************************************
840};
841//*************************************************************************************************
842
843
844
845
846//=================================================================================================
847//
848// GLOBAL BINARY ARITHMETIC OPERATORS
849//
850//=================================================================================================
851
852//*************************************************************************************************
865template< typename MT // Type of the left-hand side dense matrix
866 , typename VT // Type of the right-hand side sparse vector
867 , DisableIf_t< IsSymmetric_v<MT> || IsZero_v<VT> >* = nullptr >
868inline const DMatSVecMultExpr<MT,VT>
869 dmatsvecmult( const DenseMatrix<MT,false>& mat, const SparseVector<VT,false>& vec )
870{
872
873 BLAZE_INTERNAL_ASSERT( (*mat).columns() == (*vec).size(), "Invalid matrix and vector sizes" );
874
875 return DMatSVecMultExpr<MT,VT>( *mat, *vec );
876}
878//*************************************************************************************************
879
880
881//*************************************************************************************************
895template< typename MT // Type of the left-hand side dense matrix
896 , typename VT // Type of the right-hand side sparse vector
897 , EnableIf_t< IsSymmetric_v<MT> && !IsZero_v<VT> >* = nullptr >
898inline decltype(auto)
899 dmatsvecmult( const DenseMatrix<MT,false>& mat, const SparseVector<VT,false>& vec )
900{
902
903 BLAZE_INTERNAL_ASSERT( (*mat).columns() == (*vec).size(), "Invalid matrix and vector sizes" );
904
905 return trans( *mat ) * (*vec);
906}
908//*************************************************************************************************
909
910
911//*************************************************************************************************
924template< typename MT // Type of the left-hand side dense matrix
925 , typename VT // Type of the right-hand side sparse vector
926 , EnableIf_t< IsZero_v<VT> >* = nullptr >
927inline decltype(auto)
928 dmatsvecmult( const DenseMatrix<MT,false>& mat, const SparseVector<VT,false>& vec )
929{
931
932 MAYBE_UNUSED( vec );
933
934 BLAZE_INTERNAL_ASSERT( (*mat).columns() == (*vec).size(), "Invalid matrix and vector sizes" );
935
936 using ReturnType = const MultTrait_t< ResultType_t<MT>, ResultType_t<VT> >;
937
940
941 return ReturnType( (*mat).rows() );
942}
944//*************************************************************************************************
945
946
947//*************************************************************************************************
979template< typename MT // Type of the left-hand side dense matrix
980 , typename VT > // Type of the right-hand side sparse vector
981inline decltype(auto)
982 operator*( const DenseMatrix<MT,false>& mat, const SparseVector<VT,false>& vec )
983{
985
987
988 if( (*mat).columns() != (*vec).size() ) {
989 BLAZE_THROW_INVALID_ARGUMENT( "Matrix and vector sizes do not match" );
990 }
991
992 return dmatsvecmult( *mat, *vec );
993}
994//*************************************************************************************************
995
996
997
998
999//=================================================================================================
1000//
1001// ISALIGNED SPECIALIZATIONS
1002//
1003//=================================================================================================
1004
1005//*************************************************************************************************
1007template< typename MT, typename VT >
1008struct IsAligned< DMatSVecMultExpr<MT,VT> >
1009 : public IsAligned<MT>
1010{};
1012//*************************************************************************************************
1013
1014} // namespace blaze
1015
1016#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 IsDiagonal type trait.
Header file for the IsExpression type trait class.
Header file for the IsLower type trait.
Header file for the IsStrictlyLower type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Header file for the IsUpper 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.
Constraint on the data type.
Expression object for dense matrix-sparse vector multiplications.
Definition: DMatSVecMultExpr.h:106
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DMatSVecMultExpr.h:189
If_t< useAssign, const ResultType, const DMatSVecMultExpr & > CompositeType
Data type for composite expression templates.
Definition: DMatSVecMultExpr.h:169
LeftOperand mat_
Left-hand side dense matrix of the multiplication expression.
Definition: DMatSVecMultExpr.h:331
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatSVecMultExpr.h:164
If_t< evaluateVector, const VRT, VCT > RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: DMatSVecMultExpr.h:181
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense matrix operand.
Definition: DMatSVecMultExpr.h:270
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatSVecMultExpr.h:292
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatSVecMultExpr.h:304
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: DMatSVecMultExpr.h:165
static constexpr bool evaluateVector
Compilation switch for the composite type of the right-hand side sparse vector expression.
Definition: DMatSVecMultExpr.h:122
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatSVecMultExpr.h:314
If_t< evaluateMatrix, const MRT, MCT > LT
Type for the assignment of the left-hand side dense matrix operand.
Definition: DMatSVecMultExpr.h:178
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DMatSVecMultExpr.h:186
MultTrait_t< MRT, VRT > ResultType
Result type for expression template evaluations.
Definition: DMatSVecMultExpr.h:163
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DMatSVecMultExpr.h:247
ResultType_t< VT > VRT
Result type of the right-hand side sparse vector expression.
Definition: DMatSVecMultExpr.h:110
If_t< IsExpression_v< MT >, const MT, const MT & > LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatSVecMultExpr.h:172
CompositeType_t< MT > MCT
Composite type of the left-hand side dense matrix expression.
Definition: DMatSVecMultExpr.h:111
RightOperand vec_
Right-hand side sparse vector of the multiplication expression.
Definition: DMatSVecMultExpr.h:332
ResultType_t< MT > MRT
Result type of the left-hand side dense matrix expression.
Definition: DMatSVecMultExpr.h:109
DMatSVecMultExpr(const MT &mat, const VT &vec) noexcept
Constructor for the DMatSVecMultExpr class.
Definition: DMatSVecMultExpr.h:199
const ElementType ReturnType
Return type for expression template evaluations.
Definition: DMatSVecMultExpr.h:166
RightOperand rightOperand() const noexcept
Returns the right-hand side sparse vector operand.
Definition: DMatSVecMultExpr.h:280
static constexpr bool evaluateMatrix
Compilation switch for the composite type of the left-hand side dense matrix expression.
Definition: DMatSVecMultExpr.h:117
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DMatSVecMultExpr.h:213
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatSVecMultExpr.h:324
static constexpr bool useAssign
Compilation switch for the evaluation strategy of the multiplication expression.
Definition: DMatSVecMultExpr.h:133
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DMatSVecMultExpr.h:260
If_t< IsExpression_v< VT >, const VT, const VT & > RightOperand
Composite type of the right-hand side dense vector expression.
Definition: DMatSVecMultExpr.h:175
CompositeType_t< VT > VCT
Composite type of the right-hand side sparse vector expression.
Definition: DMatSVecMultExpr.h:112
Base class for dense matrices.
Definition: DenseMatrix.h:82
Base class for N-dimensional dense vectors.
Definition: DenseVector.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.
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 MatMatMultExpr base class.
Header file for the MatVecMultExpr base class.
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766
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_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:79
#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_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: DenseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATVECMULTEXPR(T1, T2)
Constraint on the data type.
Definition: MatVecMultExpr.h:104
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.
Definition: SparseVector.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
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:518
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
decltype(auto) subvector(Vector< VT, TF > &, RSAs...)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:158
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
#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.