Blaze 3.9
TSVecTDMatMultExpr.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_EXPRESSIONS_TSVECTDMATMULTEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_TSVECTDMATMULTEXPR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <blaze/math/Aliases.h>
76#include <blaze/util/Assert.h>
77#include <blaze/util/EnableIf.h>
80#include <blaze/util/mpl/If.h>
81#include <blaze/util/Types.h>
82
83
84namespace blaze {
85
86//=================================================================================================
87//
88// CLASS TSVECDMATMULTEXPR
89//
90//=================================================================================================
91
92//*************************************************************************************************
99template< typename VT // Type of the left-hand side sparse vector
100 , typename MT > // Type of the right-hand side dense matrix
102 : public TVecMatMultExpr< DenseVector< TSVecTDMatMultExpr<VT,MT>, true > >
103 , private Computation
104{
105 private:
106 //**Type definitions****************************************************************************
111 //**********************************************************************************************
112
113 //**********************************************************************************************
115 static constexpr bool evaluateVector = ( IsComputation_v<VT> || RequiresEvaluation_v<VT> );
116 //**********************************************************************************************
117
118 //**********************************************************************************************
120 static constexpr bool evaluateMatrix = RequiresEvaluation_v<MT>;
121 //**********************************************************************************************
122
123 //**********************************************************************************************
125
131 static constexpr bool useAssign = ( evaluateVector || evaluateMatrix );
132 //**********************************************************************************************
133
134 //**********************************************************************************************
136
137 template< typename VT2 >
138 static constexpr bool UseAssign_v = useAssign;
140 //**********************************************************************************************
141
142 //**********************************************************************************************
144
148 template< typename T1 >
149 static constexpr bool UseSMPAssign_v = useAssign;
151 //**********************************************************************************************
152
153 public:
154 //**Type definitions****************************************************************************
157
160
164 using ReturnType = const ElementType;
165
168
170 using LeftOperand = If_t< IsExpression_v<VT>, const VT, const VT& >;
171
173 using RightOperand = If_t< IsExpression_v<MT>, const MT, const MT& >;
174
177
180 //**********************************************************************************************
181
182 //**Compilation flags***************************************************************************
184 static constexpr bool simdEnabled = false;
185
187 static constexpr bool smpAssignable =
188 ( !evaluateVector && VT::smpAssignable && !evaluateMatrix && MT::smpAssignable );
189 //**********************************************************************************************
190
191 //**Constructor*********************************************************************************
197 inline TSVecTDMatMultExpr( const VT& vec, const MT& mat ) noexcept
198 : vec_( vec ) // Left-hand side sparse vector of the multiplication expression
199 , mat_( mat ) // Right-hand side dense matrix of the multiplication expression
200 {
201 BLAZE_INTERNAL_ASSERT( vec_.size() == mat_.rows(), "Invalid vector and matrix sizes" );
202 }
203 //**********************************************************************************************
204
205 //**Subscript operator**************************************************************************
211 inline ReturnType operator[]( size_t index ) const {
212 BLAZE_INTERNAL_ASSERT( index < mat_.columns(), "Invalid vector access index" );
213
214 if( IsDiagonal_v<MT> )
215 {
216 return vec_[index] * mat_(index,index);
217 }
218 else if( IsLower_v<MT> )
219 {
220 const size_t begin( IsStrictlyLower_v<MT> ? index+1UL : index );
221 const size_t n ( mat_.rows() - begin );
222 return subvector( vec_, begin, n, unchecked ) *
223 subvector( column( mat_, index, unchecked ), begin, n, unchecked );
224 }
225 else if( IsUpper_v<MT> )
226 {
227 const size_t n( IsStrictlyUpper_v<MT> ? index : index+1UL );
228 return subvector( vec_, 0UL, n, unchecked ) *
229 subvector( column( mat_, index, unchecked ), 0UL, n, unchecked );
230 }
231 else
232 {
233 return vec_ * column( mat_, index, unchecked );
234 }
235 }
236 //**********************************************************************************************
237
238 //**At function*********************************************************************************
245 inline ReturnType at( size_t index ) const {
246 if( index >= mat_.columns() ) {
247 BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
248 }
249 return (*this)[index];
250 }
251 //**********************************************************************************************
252
253 //**Size function*******************************************************************************
258 inline size_t size() const noexcept {
259 return mat_.columns();
260 }
261 //**********************************************************************************************
262
263 //**Left operand access*************************************************************************
268 inline LeftOperand leftOperand() const noexcept {
269 return vec_;
270 }
271 //**********************************************************************************************
272
273 //**Right operand access************************************************************************
278 inline RightOperand rightOperand() const noexcept {
279 return mat_;
280 }
281 //**********************************************************************************************
282
283 //**********************************************************************************************
289 template< typename T >
290 inline bool canAlias( const T* alias ) const noexcept {
291 return vec_.isAliased( alias ) || mat_.isAliased( alias );
292 }
293 //**********************************************************************************************
294
295 //**********************************************************************************************
301 template< typename T >
302 inline bool isAliased( const T* alias ) const noexcept {
303 return vec_.isAliased( alias ) || mat_.isAliased( alias );
304 }
305 //**********************************************************************************************
306
307 //**********************************************************************************************
312 inline bool isAligned() const noexcept {
313 return mat_.isAligned();
314 }
315 //**********************************************************************************************
316
317 //**********************************************************************************************
322 inline bool canSMPAssign() const noexcept {
323 return ( size() > SMP_TSVECTDMATMULT_THRESHOLD );
324 }
325 //**********************************************************************************************
326
327 private:
328 //**Member variables****************************************************************************
331 //**********************************************************************************************
332
333 //**Assignment to dense vectors*****************************************************************
349 template< typename VT2 > // Type of the target dense vector
350 friend inline auto assign( DenseVector<VT2,true>& lhs, const TSVecTDMatMultExpr& rhs )
352 {
354
355 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
356
357 // Evaluation of the left-hand side sparse vector operand
358 LT x( serial( rhs.vec_ ) );
359 if( x.nonZeros() == 0UL ) {
360 reset( *lhs );
361 return;
362 }
363
364 // Evaluation of the right-hand side dense matrix operand
365 RT A( serial( rhs.mat_ ) );
366
367 // Checking the evaluated operands
368 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
369 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
370 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
371 BLAZE_INTERNAL_ASSERT( A.columns() == (*lhs).size() , "Invalid vector size" );
372
373 // Performing the sparse vector-dense matrix multiplication
374 assign( *lhs, x * A );
375 }
377 //**********************************************************************************************
378
379 //**Assignment to sparse vectors****************************************************************
395 template< typename VT2 > // Type of the target sparse vector
396 friend inline auto assign( SparseVector<VT2,true>& lhs, const TSVecTDMatMultExpr& rhs )
398 {
400
404
405 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
406
407 const ResultType tmp( serial( rhs ) );
408 assign( *lhs, tmp );
409 }
411 //**********************************************************************************************
412
413 //**Addition assignment to dense vectors********************************************************
428 template< typename VT2 > // Type of the target dense vector
429 friend inline auto addAssign( DenseVector<VT2,true>& lhs, const TSVecTDMatMultExpr& rhs )
431 {
433
434 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
435
436 // Evaluation of the left-hand side sparse vector operand
437 LT x( serial( rhs.vec_ ) );
438 if( x.nonZeros() == 0UL ) return;
439
440 // Evaluation of the right-hand side dense matrix operand
441 RT A( serial( rhs.mat_ ) );
442
443 // Checking the evaluated operands
444 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
445 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
446 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
447 BLAZE_INTERNAL_ASSERT( A.columns() == (*lhs).size() , "Invalid vector size" );
448
449 // Performing the sparse vector-dense matrix multiplication
450 addAssign( *lhs, x * A );
451 }
452 //**********************************************************************************************
453
454 //**Addition assignment to sparse vectors*******************************************************
455 // No special implementation for the addition assignment to sparse vectors.
456 //**********************************************************************************************
457
458 //**Subtraction assignment to dense vectors*****************************************************
473 template< typename VT2 > // Type of the target dense vector
474 friend inline auto subAssign( DenseVector<VT2,true>& lhs, const TSVecTDMatMultExpr& rhs )
476 {
478
479 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
480
481 // Evaluation of the left-hand side sparse vector operand
482 LT x( serial( rhs.vec_ ) );
483 if( x.nonZeros() == 0UL ) return;
484
485 // Evaluation of the right-hand side dense matrix operand
486 RT A( serial( rhs.mat_ ) );
487
488 // Checking the evaluated operands
489 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
490 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
491 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
492 BLAZE_INTERNAL_ASSERT( A.columns() == (*lhs).size() , "Invalid vector size" );
493
494 // Performing the sparse vector-dense matrix multiplication
495 subAssign( *lhs, x * A );
496 }
497 //**********************************************************************************************
498
499 //**Subtraction assignment to sparse vectors****************************************************
500 // No special implementation for the subtraction assignment to sparse vectors.
501 //**********************************************************************************************
502
503 //**Multiplication assignment to dense vectors**************************************************
518 template< typename VT2 > // Type of the target dense vector
519 friend inline auto multAssign( DenseVector<VT2,true>& lhs, const TSVecTDMatMultExpr& rhs )
521 {
523
527
528 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
529
530 const ResultType tmp( serial( rhs ) );
531 multAssign( *lhs, tmp );
532 }
533 //**********************************************************************************************
534
535 //**Multiplication assignment to sparse vectors*************************************************
536 // No special implementation for the multiplication assignment to sparse vectors.
537 //**********************************************************************************************
538
539 //**Division assignment to dense vectors********************************************************
554 template< typename VT2 > // Type of the target dense vector
555 friend inline auto divAssign( DenseVector<VT2,true>& lhs, const TSVecTDMatMultExpr& rhs )
557 {
559
563
564 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
565
566 const ResultType tmp( serial( rhs ) );
567 divAssign( *lhs, tmp );
568 }
569 //**********************************************************************************************
570
571 //**Division assignment to sparse vectors*******************************************************
572 // No special implementation for the division assignment to sparse vectors.
573 //**********************************************************************************************
574
575 //**SMP assignment to dense vectors*************************************************************
590 template< typename VT2 > // Type of the target dense vector
591 friend inline auto smpAssign( DenseVector<VT2,true>& lhs, const TSVecTDMatMultExpr& rhs )
593 {
595
596 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
597
598 // Evaluation of the left-hand side sparse vector operand
599 LT x( rhs.vec_ );
600 if( x.nonZeros() == 0UL ) {
601 reset( *lhs );
602 return;
603 }
604
605 // Evaluation of the right-hand side dense matrix operand
606 RT A( rhs.mat_ );
607
608 // Checking the evaluated operands
609 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
610 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
611 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
612 BLAZE_INTERNAL_ASSERT( A.columns() == (*lhs).size() , "Invalid vector size" );
613
614 // Performing the sparse vector-dense matrix multiplication
615 smpAssign( *lhs, x * A );
616 }
618 //**********************************************************************************************
619
620 //**SMP assignment to sparse vectors************************************************************
635 template< typename VT2 > // Type of the target sparse vector
636 friend inline auto smpAssign( SparseVector<VT2,true>& lhs, const TSVecTDMatMultExpr& rhs )
637 -> EnableIf_t< UseSMPAssign_v<VT2> >
638 {
640
644
645 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
646
647 const ResultType tmp( rhs );
648 smpAssign( *lhs, tmp );
649 }
651 //**********************************************************************************************
652
653 //**SMP addition assignment to dense vectors****************************************************
667 template< typename VT2 > // Type of the target dense vector
668 friend inline auto smpAddAssign( DenseVector<VT2,true>& lhs, const TSVecTDMatMultExpr& rhs )
670 {
672
673 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
674
675 // Evaluation of the left-hand side sparse vector operand
676 LT x( rhs.vec_ );
677 if( x.nonZeros() == 0UL ) return;
678
679 // Evaluation of the right-hand side dense matrix operand
680 RT A( rhs.mat_ );
681
682 // Checking the evaluated operands
683 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
684 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
685 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
686 BLAZE_INTERNAL_ASSERT( A.columns() == (*lhs).size() , "Invalid vector size" );
687
688 // Performing the sparse vector-dense matrix multiplication
689 smpAddAssign( *lhs, x * A );
690 }
691 //**********************************************************************************************
692
693 //**SMP addition assignment to sparse vectors***************************************************
694 // No special implementation for the SMP addition assignment to sparse vectors.
695 //**********************************************************************************************
696
697 //**SMP subtraction assignment to dense vectors*************************************************
711 template< typename VT2 > // Type of the target dense vector
712 friend inline auto smpSubAssign( DenseVector<VT2,true>& lhs, const TSVecTDMatMultExpr& rhs )
714 {
716
717 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
718
719 // Evaluation of the left-hand side sparse vector operand
720 LT x( rhs.vec_ );
721 if( x.nonZeros() == 0UL ) return;
722
723 // Evaluation of the right-hand side dense matrix operand
724 RT A( rhs.mat_ );
725
726 // Checking the evaluated operands
727 BLAZE_INTERNAL_ASSERT( x.size() == rhs.vec_.size() , "Invalid vector size" );
728 BLAZE_INTERNAL_ASSERT( A.rows() == rhs.mat_.rows() , "Invalid number of rows" );
729 BLAZE_INTERNAL_ASSERT( A.columns() == rhs.mat_.columns(), "Invalid number of columns" );
730 BLAZE_INTERNAL_ASSERT( A.columns() == (*lhs).size() , "Invalid vector size" );
731
732 // Performing the sparse vector-dense matrix multiplication
733 smpSubAssign( *lhs, x * A );
734 }
735 //**********************************************************************************************
736
737 //**SMP subtraction assignment to sparse vectors************************************************
738 // No special implementation for the SMP subtraction assignment to sparse vectors.
739 //**********************************************************************************************
740
741 //**SMP multiplication assignment to dense vectors**********************************************
756 template< typename VT2 > // Type of the target dense vector
757 friend inline auto smpMultAssign( DenseVector<VT2,true>& lhs, const TSVecTDMatMultExpr& rhs )
759 {
761
765
766 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
767
768 const ResultType tmp( rhs );
769 smpMultAssign( *lhs, tmp );
770 }
771 //**********************************************************************************************
772
773 //**SMP multiplication assignment to sparse vectors*********************************************
774 // No special implementation for the SMP multiplication assignment to sparse vectors.
775 //**********************************************************************************************
776
777 //**SMP division assignment to dense vectors****************************************************
791 template< typename VT2 > // Type of the target dense vector
792 friend inline auto smpDivAssign( DenseVector<VT2,true>& lhs, const TSVecTDMatMultExpr& rhs )
794 {
796
800
801 BLAZE_INTERNAL_ASSERT( (*lhs).size() == rhs.size(), "Invalid vector sizes" );
802
803 const ResultType tmp( rhs );
804 smpDivAssign( *lhs, tmp );
805 }
806 //**********************************************************************************************
807
808 //**SMP division assignment to sparse vectors***************************************************
809 // No special implementation for the SMP division assignment to sparse vectors.
810 //**********************************************************************************************
811
812 //**Compile time checks*************************************************************************
822 //**********************************************************************************************
823};
824//*************************************************************************************************
825
826
827
828
829//=================================================================================================
830//
831// GLOBAL BINARY ARITHMETIC OPERATORS
832//
833//=================================================================================================
834
835//*************************************************************************************************
848template< typename VT // Type of the left-hand side sparse vector
849 , typename MT // Type of the right-hand side dense matrix
850 , DisableIf_t< IsSymmetric_v<MT> || IsZero_v<VT> >* = nullptr >
851inline const TSVecTDMatMultExpr<VT,MT>
852 tsvectdmatmult( const SparseVector<VT,true>& vec, const DenseMatrix<MT,true>& mat )
853{
855
856 BLAZE_INTERNAL_ASSERT( (*vec).size() == (*mat).rows(), "Invalid vector and matrix sizes" );
857
858 return TSVecTDMatMultExpr<VT,MT>( *vec, *mat );
859}
861//*************************************************************************************************
862
863
864//*************************************************************************************************
878template< typename VT // Type of the left-hand side sparse vector
879 , typename MT // Type of the right-hand side dense matrix
880 , EnableIf_t< IsSymmetric_v<MT> && !IsZero_v<VT> >* = nullptr >
881inline decltype(auto)
882 tsvectdmatmult( const SparseVector<VT,true>& vec, const DenseMatrix<MT,true>& mat )
883{
885
886 BLAZE_INTERNAL_ASSERT( (*vec).size() == (*mat).rows(), "Invalid vector and matrix sizes" );
887
888 return (*vec) * trans( *mat );
889}
891//*************************************************************************************************
892
893
894//*************************************************************************************************
907template< typename VT // Type of the left-hand side sparse vector
908 , typename MT // Type of the right-hand side dense matrix
909 , EnableIf_t< IsZero_v<VT> >* = nullptr >
910inline decltype(auto)
911 tsvectdmatmult( const SparseVector<VT,true>& vec, const DenseMatrix<MT,true>& mat )
912{
914
915 MAYBE_UNUSED( vec );
916
917 BLAZE_INTERNAL_ASSERT( (*vec).size() == (*mat).rows(), "Invalid vector and matrix sizes" );
918
919 using ReturnType = const MultTrait_t< ResultType_t<VT>, ResultType_t<MT> >;
920
923
924 return ReturnType( (*mat).columns() );
925}
927//*************************************************************************************************
928
929
930//*************************************************************************************************
961template< typename VT // Type of the left-hand side sparse vector
962 , typename MT > // Type of the right-hand side dense matrix
963inline decltype(auto)
964 operator*( const SparseVector<VT,true>& vec, const DenseMatrix<MT,true>& mat )
965{
967
969
970 if( (*vec).size() != (*mat).rows() ) {
971 BLAZE_THROW_INVALID_ARGUMENT( "Vector and matrix sizes do not match" );
972 }
973
974 return tsvectdmatmult( *vec, *mat );
975}
976//*************************************************************************************************
977
978
979
980
981//=================================================================================================
982//
983// ISALIGNED SPECIALIZATIONS
984//
985//=================================================================================================
986
987//*************************************************************************************************
989template< typename VT, typename MT >
990struct IsAligned< TSVecTDMatMultExpr<VT,MT> >
991 : public IsAligned<MT>
992{};
994//*************************************************************************************************
995
996} // namespace blaze
997
998#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.
Constraints on the storage order of matrix 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.
Constraint on the transpose flag of vector types.
Constraint on the data type.
Constraint on the data type.
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
Expression object for transpose sparse vector-transpose dense matrix multiplications.
Definition: TSVecTDMatMultExpr.h:104
ResultType_t< MT > MRT
Result type of the right-hand side dense matrix expression.
Definition: TSVecTDMatMultExpr.h:108
RightOperand rightOperand() const noexcept
Returns the right-hand side transpose dense matrix operand.
Definition: TSVecTDMatMultExpr.h:278
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TSVecTDMatMultExpr.h:164
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: TSVecTDMatMultExpr.h:302
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: TSVecTDMatMultExpr.h:290
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: TSVecTDMatMultExpr.h:184
static constexpr bool evaluateMatrix
Compilation switch for the composite type of the right-hand side dense matrix expression.
Definition: TSVecTDMatMultExpr.h:120
If_t< evaluateMatrix, const MRT, MCT > RT
Type for the assignment of the left-hand side dense matrix operand.
Definition: TSVecTDMatMultExpr.h:179
If_t< IsExpression_v< MT >, const MT, const MT & > RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition: TSVecTDMatMultExpr.h:173
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: TSVecTDMatMultExpr.h:162
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: TSVecTDMatMultExpr.h:211
static constexpr bool evaluateVector
Compilation switch for the composite type of the left-hand side sparse vector expression.
Definition: TSVecTDMatMultExpr.h:115
ResultType_t< VT > VRT
Result type of the left-hand side sparse vector expression.
Definition: TSVecTDMatMultExpr.h:107
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: TSVecTDMatMultExpr.h:187
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: TSVecTDMatMultExpr.h:258
If_t< evaluateVector, const VRT, VCT > LT
Type for the assignment of the left-hand side sparse vector operand.
Definition: TSVecTDMatMultExpr.h:176
CompositeType_t< VT > VCT
Composite type of the left-hand side sparse vector expression.
Definition: TSVecTDMatMultExpr.h:109
LeftOperand vec_
Left-hand side sparse vector of the multiplication expression.
Definition: TSVecTDMatMultExpr.h:329
MultTrait_t< VRT, MRT > ResultType
Result type for expression template evaluations.
Definition: TSVecTDMatMultExpr.h:161
TSVecTDMatMultExpr(const VT &vec, const MT &mat) noexcept
Constructor for the TSVecTDMatMultExpr class.
Definition: TSVecTDMatMultExpr.h:197
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse vector operand.
Definition: TSVecTDMatMultExpr.h:268
ElementType_t< ResultType > ElementType
Resulting element type.
Definition: TSVecTDMatMultExpr.h:163
RightOperand mat_
Right-hand side dense matrix of the multiplication expression.
Definition: TSVecTDMatMultExpr.h:330
static constexpr bool useAssign
Compilation switch for the evaluation strategy of the multiplication expression.
Definition: TSVecTDMatMultExpr.h:131
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: TSVecTDMatMultExpr.h:322
CompositeType_t< MT > MCT
Composite type of the right-hand side dense matrix expression.
Definition: TSVecTDMatMultExpr.h:110
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: TSVecTDMatMultExpr.h:245
If_t< IsExpression_v< VT >, const VT, const VT & > LeftOperand
Composite type of the left-hand side sparse vector expression.
Definition: TSVecTDMatMultExpr.h:170
If_t< useAssign, const ResultType, const TSVecTDMatMultExpr & > CompositeType
Data type for composite expression templates.
Definition: TSVecTDMatMultExpr.h:167
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: TSVecTDMatMultExpr.h:312
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 TVecMatMultExpr base class.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:137
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
friend auto addAssign(DenseVector< VT2, true > &lhs, const TSVecTDMatMultExpr &rhs) -> EnableIf_t< UseAssign_v< VT2 > >
Addition assignment of a transpose sparse vector-transpose dense matrix multiplication to a dense vec...
Definition: TSVecTDMatMultExpr.h:429
friend auto multAssign(DenseVector< VT2, true > &lhs, const TSVecTDMatMultExpr &rhs) -> EnableIf_t< UseAssign_v< VT2 > >
Multiplication assignment of a transpose sparse vector-transpose dense matrix multiplication to a den...
Definition: TSVecTDMatMultExpr.h:519
friend auto subAssign(DenseVector< VT2, true > &lhs, const TSVecTDMatMultExpr &rhs) -> EnableIf_t< UseAssign_v< VT2 > >
Subtraction assignment of a transpose sparse vector-transpose dense matrix multiplication to a dense ...
Definition: TSVecTDMatMultExpr.h:474
friend auto smpDivAssign(DenseVector< VT2, true > &lhs, const TSVecTDMatMultExpr &rhs) -> EnableIf_t< UseSMPAssign_v< VT2 > >
SMP division assignment of a transpose sparse vector-transpose dense matrix multiplication to a dense...
Definition: TSVecTDMatMultExpr.h:792
friend auto smpSubAssign(DenseVector< VT2, true > &lhs, const TSVecTDMatMultExpr &rhs) -> EnableIf_t< UseSMPAssign_v< VT2 > >
SMP subtraction assignment of a transpose sparse vector-transpose dense matrix multiplication to a de...
Definition: TSVecTDMatMultExpr.h:712
friend auto smpMultAssign(DenseVector< VT2, true > &lhs, const TSVecTDMatMultExpr &rhs) -> EnableIf_t< UseSMPAssign_v< VT2 > >
SMP multiplication assignment of a transpose sparse vector-transpose dense matrix multiplication to a...
Definition: TSVecTDMatMultExpr.h:757
friend auto smpAddAssign(DenseVector< VT2, true > &lhs, const TSVecTDMatMultExpr &rhs) -> EnableIf_t< UseSMPAssign_v< VT2 > >
SMP addition assignment of a transpose sparse vector-transpose dense matrix multiplication to a dense...
Definition: TSVecTDMatMultExpr.h:668
friend auto divAssign(DenseVector< VT2, true > &lhs, const TSVecTDMatMultExpr &rhs) -> EnableIf_t< UseAssign_v< VT2 > >
Division assignment of a transpose sparse vector-transpose dense matrix multiplication to a dense vec...
Definition: TSVecTDMatMultExpr.h:555
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition: RequiresEvaluation.h:81
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_TVECMATMULTEXPR(T1, T2)
Constraint on the data type.
Definition: TVecMatMultExpr.h:104
#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_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_ROW_VECTOR_TYPE(T)
Constraint on the data type.
Definition: RowVector.h:61
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: ColumnMajorMatrix.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
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
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
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 vector/matrix multiplication expression templates.
Definition: TVecMatMultExpr.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.