Blaze 3.9
SMatDeclUppExpr.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_EXPRESSIONS_SMATDECLUPPEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_SMATDECLUPPEXPR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <iterator>
45#include <blaze/math/Aliases.h>
61#include <blaze/util/Assert.h>
62#include <blaze/util/EnableIf.h>
66#include <blaze/util/mpl/If.h>
67#include <blaze/util/Types.h>
69
70
71namespace blaze {
72
73//=================================================================================================
74//
75// CLASS SMATDECLUPPEXPR
76//
77//=================================================================================================
78
79//*************************************************************************************************
86template< typename MT // Type of the sparse matrix
87 , bool SO > // Storage order
89 : public DeclUppExpr< SparseMatrix< SMatDeclUppExpr<MT,SO>, SO > >
90 , public Declaration<MT>
91{
92 private:
93 //**Type definitions****************************************************************************
95
97 BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT( GetConstIterator, ConstIterator, INVALID_TYPE );
98 //**********************************************************************************************
99
100 //**Serial evaluation strategy******************************************************************
102
108 static constexpr bool useAssign = RequiresEvaluation_v<MT>;
109
112 template< typename MT2 >
113 static constexpr bool UseAssign_v = useAssign;
115 //**********************************************************************************************
116
117 //**Parallel evaluation strategy****************************************************************
119
125 template< typename MT2 >
126 static constexpr bool UseSMPAssign_v = ( MT2::smpAssignable && useAssign );
128 //**********************************************************************************************
129
130 public:
131 //**Type definitions****************************************************************************
134
137
143
146
148 using ConstIterator = GetConstIterator_t<MT>;
149
151 using Operand = If_t< IsExpression_v<MT>, const MT, const MT& >;
152 //**********************************************************************************************
153
154 //**Compilation flags***************************************************************************
156 static constexpr bool smpAssignable = MT::smpAssignable;
157 //**********************************************************************************************
158
159 //**Constructor*********************************************************************************
164 explicit inline SMatDeclUppExpr( const MT& sm ) noexcept
165 : sm_( sm ) // Sparse matrix of the declupp expression
166 {
167 BLAZE_INTERNAL_ASSERT( isSquare( *sm ), "Non-square matrix detected" );
168 }
169 //**********************************************************************************************
170
171 //**Access operator*****************************************************************************
178 inline ReturnType operator()( size_t i, size_t j ) const {
179 BLAZE_INTERNAL_ASSERT( i < sm_.rows() , "Invalid row access index" );
180 BLAZE_INTERNAL_ASSERT( j < sm_.columns(), "Invalid column access index" );
181 return sm_(i,j);
182 }
183 //**********************************************************************************************
184
185 //**At function*********************************************************************************
193 inline ReturnType at( size_t i, size_t j ) const {
194 if( i >= sm_.rows() ) {
195 BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
196 }
197 if( j >= sm_.columns() ) {
198 BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
199 }
200 return (*this)(i,j);
201 }
202 //**********************************************************************************************
203
204 //**Begin function******************************************************************************
210 inline ConstIterator begin( size_t i ) const {
211 return ConstIterator( sm_.begin(i) );
212 }
213 //**********************************************************************************************
214
215 //**End function********************************************************************************
221 inline ConstIterator end( size_t i ) const {
222 return ConstIterator( sm_.end(i) );
223 }
224 //**********************************************************************************************
225
226 //**Rows function*******************************************************************************
231 inline size_t rows() const noexcept {
232 return sm_.rows();
233 }
234 //**********************************************************************************************
235
236 //**Columns function****************************************************************************
241 inline size_t columns() const noexcept {
242 return sm_.columns();
243 }
244 //**********************************************************************************************
245
246 //**NonZeros function***************************************************************************
251 inline size_t nonZeros() const {
252 return sm_.nonZeros();
253 }
254 //**********************************************************************************************
255
256 //**NonZeros function***************************************************************************
262 inline size_t nonZeros( size_t i ) const {
263 return sm_.nonZeros(i);
264 }
265 //**********************************************************************************************
266
267 //**Operand access******************************************************************************
272 inline Operand operand() const noexcept {
273 return sm_;
274 }
275 //**********************************************************************************************
276
277 //**********************************************************************************************
283 template< typename T >
284 inline bool canAlias( const T* alias ) const noexcept {
285 return sm_.canAlias( alias );
286 }
287 //**********************************************************************************************
288
289 //**********************************************************************************************
295 template< typename T >
296 inline bool isAliased( const T* alias ) const noexcept {
297 return sm_.isAliased( alias );
298 }
299 //**********************************************************************************************
300
301 //**********************************************************************************************
306 inline bool canSMPAssign() const noexcept {
307 return sm_.canSMPAssign();
308 }
309 //**********************************************************************************************
310
311 private:
312 //**Member variables****************************************************************************
314 //**********************************************************************************************
315
316 //**Assignment to dense matrices****************************************************************
328 template< typename MT2 // Type of the target dense matrix
329 , bool SO2 > // Storage order of the target dense matrix
330 friend inline auto assign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
332 {
334
335 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
336 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
337
338 assign( *lhs, rhs.sm_ );
339 }
341 //**********************************************************************************************
342
343 //**Assignment to sparse matrices***************************************************************
355 template< typename MT2 // Type of the target sparse matrix
356 , bool SO2 > // Storage order of the target sparse matrix
357 friend inline auto assign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
359 {
361
362 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
363 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
364
365 assign( *lhs, rhs.sm_ );
366 }
368 //**********************************************************************************************
369
370 //**Addition assignment to dense matrices*******************************************************
382 template< typename MT2 // Type of the target dense matrix
383 , bool SO2 > // Storage order of the target dense matrix
384 friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
385 -> EnableIf_t< UseAssign_v<MT2> >
386 {
388
389 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
390 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
391
392 addAssign( *lhs, rhs.sm_ );
393 }
395 //**********************************************************************************************
396
397 //**Addition assignment to sparse matrices******************************************************
409 template< typename MT2 // Type of the target sparse matrix
410 , bool SO2 > // Storage order of the target sparse matrix
411 friend inline auto addAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
412 -> EnableIf_t< UseAssign_v<MT2> >
413 {
415
416 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
417 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
418
419 addAssign( *lhs, rhs.sm_ );
420 }
422 //**********************************************************************************************
423
424 //**Subtraction assignment to dense matrices****************************************************
436 template< typename MT2 // Type of the target dense matrix
437 , bool SO2 > // Storage order of the target dense matrix
438 friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
439 -> EnableIf_t< UseAssign_v<MT2> >
440 {
442
443 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
444 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
445
446 subAssign( *lhs, rhs.sm_ );
447 }
449 //**********************************************************************************************
450
451 //**Subtraction assignment to sparse matrices***************************************************
463 template< typename MT2 // Type of the target sparse matrix
464 , bool SO2 > // Storage order of the target sparse matrix
465 friend inline auto subAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
466 -> EnableIf_t< UseAssign_v<MT2> >
467 {
469
470 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
471 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
472
473 subAssign( *lhs, rhs.sm_ );
474 }
476 //**********************************************************************************************
477
478 //**Schur product assignment to dense matrices**************************************************
490 template< typename MT2 // Type of the target dense matrix
491 , bool SO2 > // Storage order of the target dense matrix
492 friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
493 -> EnableIf_t< UseAssign_v<MT2> >
494 {
496
497 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
498 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
499
500 schurAssign( *lhs, rhs.sm_ );
501 }
503 //**********************************************************************************************
504
505 //**Schur product assignment to sparse matrices*************************************************
517 template< typename MT2 // Type of the target sparse matrix
518 , bool SO2 > // Storage order of the target sparse matrix
519 friend inline auto schurAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
520 -> EnableIf_t< UseAssign_v<MT2> >
521 {
523
524 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
525 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
526
527 schurAssign( *lhs, rhs.sm_ );
528 }
530 //**********************************************************************************************
531
532 //**Multiplication assignment to dense matrices*************************************************
544 template< typename MT2 // Type of the target dense matrix
545 , bool SO2 > // Storage order of the target dense matrix
546 friend inline auto multAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
547 -> EnableIf_t< UseAssign_v<MT2> >
548 {
550
551 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
552 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
553
554 multAssign( *lhs, rhs.sm_ );
555 }
557 //**********************************************************************************************
558
559 //**Multiplication assignment to sparse matrices************************************************
571 template< typename MT2 // Type of the target sparse matrix
572 , bool SO2 > // Storage order of the target sparse matrix
573 friend inline auto multAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
574 -> EnableIf_t< UseAssign_v<MT2> >
575 {
577
578 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
579 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
580
581 multAssign( *lhs, rhs.sm_ );
582 }
584 //**********************************************************************************************
585
586 //**SMP assignment to dense matrices************************************************************
598 template< typename MT2 // Type of the target dense matrix
599 , bool SO2 > // Storage order of the target dense matrix
600 friend inline auto smpAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
601 -> EnableIf_t< UseSMPAssign_v<MT2> >
602 {
604
605 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
606 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
607
608 smpAssign( *lhs, rhs.sm_ );
609 }
611 //**********************************************************************************************
612
613 //**SMP assignment to sparse matrices***********************************************************
625 template< typename MT2 // Type of the target sparse matrix
626 , bool SO2 > // Storage order of the target sparse matrix
627 friend inline auto smpAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
628 -> EnableIf_t< UseSMPAssign_v<MT2> >
629 {
631
632 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
633 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
634
635 smpAssign( *lhs, rhs.sm_ );
636 }
638 //**********************************************************************************************
639
640 //**SMP addition assignment to dense matrices***************************************************
652 template< typename MT2 // Type of the target dense matrix
653 , bool SO2 > // Storage order of the target dense matrix
654 friend inline auto smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
655 -> EnableIf_t< UseSMPAssign_v<MT2> >
656 {
658
659 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
660 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
661
662 smpAddAssign( *lhs, rhs.sm_ );
663 }
665 //**********************************************************************************************
666
667 //**SMP addition assignment to sparse matrices**************************************************
679 template< typename MT2 // Type of the target sparse matrix
680 , bool SO2 > // Storage order of the target sparse matrix
681 friend inline auto smpAddAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
682 -> EnableIf_t< UseSMPAssign_v<MT2> >
683 {
685
686 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
687 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
688
689 smpAddAssign( *lhs, rhs.sm_ );
690 }
692 //**********************************************************************************************
693
694 //**SMP subtraction assignment to dense matrices************************************************
706 template< typename MT2 // Type of the target dense matrix
707 , bool SO2 > // Storage order of the target dense matrix
708 friend inline auto smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
709 -> EnableIf_t< UseSMPAssign_v<MT2> >
710 {
712
713 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
714 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
715
716 smpSubAssign( *lhs, rhs.sm_ );
717 }
719 //**********************************************************************************************
720
721 //**SMP subtraction assignment to sparse matrices***********************************************
733 template< typename MT2 // Type of the target sparse matrix
734 , bool SO2 > // Storage order of the target sparse matrix
735 friend inline auto smpSubAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
736 -> EnableIf_t< UseSMPAssign_v<MT2> >
737 {
739
740 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
741 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
742
743 smpSubAssign( *lhs, rhs.sm_ );
744 }
746 //**********************************************************************************************
747
748 //**SMP Schur product assignment to dense matrices**********************************************
760 template< typename MT2 // Type of the target dense matrix
761 , bool SO2 > // Storage order of the target dense matrix
762 friend inline auto smpSchurAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
763 -> EnableIf_t< UseSMPAssign_v<MT2> >
764 {
766
767 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
768 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
769
770 smpSchurAssign( *lhs, rhs.sm_ );
771 }
773 //**********************************************************************************************
774
775 //**SMP Schur product assignment to sparse matrices*********************************************
787 template< typename MT2 // Type of the target sparse matrix
788 , bool SO2 > // Storage order of the target sparse matrix
789 friend inline auto smpSchurAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
790 -> EnableIf_t< UseSMPAssign_v<MT2> >
791 {
793
794 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
795 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
796
797 smpSchurAssign( *lhs, rhs.sm_ );
798 }
800 //**********************************************************************************************
801
802 //**SMP multiplication assignment to dense matrices*********************************************
815 template< typename MT2 // Type of the target dense matrix
816 , bool SO2 > // Storage order of the target dense matrix
817 friend inline auto smpMultAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
818 -> EnableIf_t< UseSMPAssign_v<MT2> >
819 {
821
822 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
823 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
824
825 smpMultAssign( *lhs, rhs.sm_ );
826 }
828 //**********************************************************************************************
829
830 //**SMP multiplication assignment to sparse matrices********************************************
843 template< typename MT2 // Type of the target sparse matrix
844 , bool SO2 > // Storage order of the target sparse matrix
845 friend inline auto smpMultAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUppExpr& rhs )
846 -> EnableIf_t< UseSMPAssign_v<MT2> >
847 {
849
850 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
851 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
852
853 smpMultAssign( *lhs, rhs.sm_ );
854 }
856 //**********************************************************************************************
857
858 //**Compile time checks*************************************************************************
865 //**********************************************************************************************
866};
867//*************************************************************************************************
868
869
870
871
872//=================================================================================================
873//
874// GLOBAL FUNCTIONS
875//
876//=================================================================================================
877
878//*************************************************************************************************
889template< typename MT // Type of the sparse matrix
890 , bool SO // Storage order
891 , DisableIf_t< IsUpper_v<MT> || IsUniLower_v<MT> >* = nullptr >
892inline const SMatDeclUppExpr<MT,SO> declupp_backend( const SparseMatrix<MT,SO>& sm )
893{
895
896 BLAZE_INTERNAL_ASSERT( isSquare( *sm ), "Non-square matrix detected" );
897
898 return SMatDeclUppExpr<MT,SO>( *sm );
899}
901//*************************************************************************************************
902
903
904//*************************************************************************************************
915template< typename MT // Type of the sparse matrix
916 , bool SO // Storage order
917 , EnableIf_t< !IsUpper_v<MT> && IsUniLower_v<MT> >* = nullptr >
918inline const IdentityMatrix<ElementType_t<MT>,SO> declupp_backend( const SparseMatrix<MT,SO>& sm )
919{
921
922 BLAZE_INTERNAL_ASSERT( isSquare( *sm ), "Non-square matrix detected" );
923
924 return IdentityMatrix<ElementType_t<MT>,SO>( (*sm).rows() );
925}
927//*************************************************************************************************
928
929
930//*************************************************************************************************
941template< typename MT // Type of the sparse matrix
942 , bool SO // Storage order
943 , EnableIf_t< IsUpper_v<MT> >* = nullptr >
944inline const MT& declupp_backend( const SparseMatrix<MT,SO>& sm )
945{
947
948 BLAZE_INTERNAL_ASSERT( isSquare( *sm ), "Non-square matrix detected" );
949
950 return *sm;
951}
953//*************************************************************************************************
954
955
956//*************************************************************************************************
974template< typename MT // Type of the sparse matrix
975 , bool SO > // Storage order
976inline decltype(auto) declupp( const SparseMatrix<MT,SO>& sm )
977{
979
980 if( !isSquare( *sm ) ) {
981 BLAZE_THROW_INVALID_ARGUMENT( "Invalid upper matrix specification" );
982 }
983
984 return declupp_backend( *sm );
985}
986//*************************************************************************************************
987
988
989
990
991//=================================================================================================
992//
993// ISUPPER SPECIALIZATIONS
994//
995//=================================================================================================
996
997//*************************************************************************************************
999template< typename MT, bool SO >
1000struct IsUpper< SMatDeclUppExpr<MT,SO> >
1001 : public TrueType
1002{};
1004//*************************************************************************************************
1005
1006} // namespace blaze
1007
1008#endif
Header file for auxiliary alias declarations.
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.
Definition: Aliases.h:470
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::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.
Definition: Aliases.h:310
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 declupp trait.
Header file for the EnableIf class template.
Header file for the function trace functionality.
Header file for the GetMemberType type trait.
Header file for the If class template.
Header file for the IntegralConstant class template.
Utility type for generic codes.
Header file for the IsExpression type trait class.
Header file for the IsUniLower type trait.
Header file for the IsUpper type trait.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of the base template of the UpperMatrix.
Base class for dense matrices.
Definition: DenseMatrix.h:82
Expression object for the explicit upper declaration of sparse matrices.
Definition: SMatDeclUppExpr.h:91
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: SMatDeclUppExpr.h:156
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatDeclUppExpr.h:178
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatDeclUppExpr.h:262
BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT(GetConstIterator, ConstIterator, INVALID_TYPE)
Definition of the GetConstIterator type trait.
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatDeclUppExpr.h:139
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SMatDeclUppExpr.h:140
ElementType_t< MT > ElementType
Resulting element type.
Definition: SMatDeclUppExpr.h:141
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatDeclUppExpr.h:210
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite data type of the sparse matrix expression.
Definition: SMatDeclUppExpr.h:151
ResultType_t< MT > RT
Result type of the sparse matrix expression.
Definition: SMatDeclUppExpr.h:94
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition: SMatDeclUppExpr.h:142
SMatDeclUppExpr(const MT &sm) noexcept
Constructor for the SMatDeclUppExpr class.
Definition: SMatDeclUppExpr.h:164
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatDeclUppExpr.h:221
If_t< RequiresEvaluation_v< MT >, const ResultType, const SMatDeclUppExpr & > CompositeType
Data type for composite expression templates.
Definition: SMatDeclUppExpr.h:145
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatDeclUppExpr.h:193
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatDeclUppExpr.h:231
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatDeclUppExpr.h:251
DeclUppTrait_t< RT > ResultType
Result type for expression template evaluations.
Definition: SMatDeclUppExpr.h:138
Operand sm_
Sparse matrix of the declupp expression.
Definition: SMatDeclUppExpr.h:313
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatDeclUppExpr.h:296
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the upper declaration expression.
Definition: SMatDeclUppExpr.h:108
GetConstIterator_t< MT > ConstIterator
Iterator over the elements of the dense matrix.
Definition: SMatDeclUppExpr.h:148
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatDeclUppExpr.h:241
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition: SMatDeclUppExpr.h:272
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatDeclUppExpr.h:284
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatDeclUppExpr.h:306
Base class for sparse matrices.
Definition: SparseMatrix.h:77
Constraint on the data type.
Header file for the DeclUppExpr base class.
Header file for the Declaration base class.
Header file for the SparseMatrix base class.
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:1004
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Upper.h:81
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: SparseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNILOWER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: UniLower.h:81
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.
Definition: StorageOrder.h:63
typename DeclUppTrait< MT >::Type DeclUppTrait_t
Auxiliary alias declaration for the DeclUppTrait type trait.
Definition: DeclUppTrait.h:144
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:1383
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
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 smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:194
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
BoolConstant< true > TrueType
Type traits base class.
Definition: IntegralConstant.h:132
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
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
Header file for the exception macros of the math module.
Constraints on the storage order of matrix types.
Header file for all forward declarations for expression class templates.
Header file for all forward declarations for sparse vectors and matrices.
Base class for all declupp expression templates.
Definition: DeclUppExpr.h:68
Base class for all declaration expression templates.
Definition: Declaration.h:76
Header file for the RequiresEvaluation type trait.
Header file for basic type definitions.