Blaze 3.9
SMatDeclStrUppExpr.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_EXPRESSIONS_SMATDECLSTRUPPEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_SMATDECLSTRUPPEXPR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <iterator>
45#include <blaze/math/Aliases.h>
62#include <blaze/util/Assert.h>
63#include <blaze/util/EnableIf.h>
67#include <blaze/util/mpl/If.h>
68#include <blaze/util/Types.h>
70
71
72namespace blaze {
73
74//=================================================================================================
75//
76// CLASS SMATDECLSTRUPPEXPR
77//
78//=================================================================================================
79
80//*************************************************************************************************
87template< typename MT // Type of the sparse matrix
88 , bool SO > // Storage order
90 : public DeclStrUppExpr< SparseMatrix< SMatDeclStrUppExpr<MT,SO>, SO > >
91 , public Declaration<MT>
92{
93 private:
94 //**Type definitions****************************************************************************
96
98 BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT( GetConstIterator, ConstIterator, INVALID_TYPE );
99 //**********************************************************************************************
100
101 //**Serial evaluation strategy******************************************************************
103
109 static constexpr bool useAssign = RequiresEvaluation_v<MT>;
110
113 template< typename MT2 >
114 static constexpr bool UseAssign_v = useAssign;
116 //**********************************************************************************************
117
118 //**Parallel evaluation strategy****************************************************************
120
126 template< typename MT2 >
127 static constexpr bool UseSMPAssign_v = ( MT2::smpAssignable && useAssign );
129 //**********************************************************************************************
130
131 public:
132 //**Type definitions****************************************************************************
135
138
144
147
149 using ConstIterator = GetConstIterator_t<MT>;
150
152 using Operand = If_t< IsExpression_v<MT>, const MT, const MT& >;
153 //**********************************************************************************************
154
155 //**Compilation flags***************************************************************************
157 static constexpr bool smpAssignable = MT::smpAssignable;
158 //**********************************************************************************************
159
160 //**Constructor*********************************************************************************
165 explicit inline SMatDeclStrUppExpr( const MT& sm ) noexcept
166 : sm_( sm ) // Sparse matrix of the declstrupp expression
167 {
168 BLAZE_INTERNAL_ASSERT( isSquare( *sm ), "Non-square matrix detected" );
169 }
170 //**********************************************************************************************
171
172 //**Access operator*****************************************************************************
179 inline ReturnType operator()( size_t i, size_t j ) const {
180 BLAZE_INTERNAL_ASSERT( i < sm_.rows() , "Invalid row access index" );
181 BLAZE_INTERNAL_ASSERT( j < sm_.columns(), "Invalid column access index" );
182 return sm_(i,j);
183 }
184 //**********************************************************************************************
185
186 //**At function*********************************************************************************
194 inline ReturnType at( size_t i, size_t j ) const {
195 if( i >= sm_.rows() ) {
196 BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
197 }
198 if( j >= sm_.columns() ) {
199 BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
200 }
201 return (*this)(i,j);
202 }
203 //**********************************************************************************************
204
205 //**Begin function******************************************************************************
211 inline ConstIterator begin( size_t i ) const {
212 return ConstIterator( sm_.begin(i) );
213 }
214 //**********************************************************************************************
215
216 //**End function********************************************************************************
222 inline ConstIterator end( size_t i ) const {
223 return ConstIterator( sm_.end(i) );
224 }
225 //**********************************************************************************************
226
227 //**Rows function*******************************************************************************
232 inline size_t rows() const noexcept {
233 return sm_.rows();
234 }
235 //**********************************************************************************************
236
237 //**Columns function****************************************************************************
242 inline size_t columns() const noexcept {
243 return sm_.columns();
244 }
245 //**********************************************************************************************
246
247 //**NonZeros function***************************************************************************
252 inline size_t nonZeros() const {
253 return sm_.nonZeros();
254 }
255 //**********************************************************************************************
256
257 //**NonZeros function***************************************************************************
263 inline size_t nonZeros( size_t i ) const {
264 return sm_.nonZeros(i);
265 }
266 //**********************************************************************************************
267
268 //**Operand access******************************************************************************
273 inline Operand operand() const noexcept {
274 return sm_;
275 }
276 //**********************************************************************************************
277
278 //**********************************************************************************************
284 template< typename T >
285 inline bool canAlias( const T* alias ) const noexcept {
286 return sm_.canAlias( alias );
287 }
288 //**********************************************************************************************
289
290 //**********************************************************************************************
296 template< typename T >
297 inline bool isAliased( const T* alias ) const noexcept {
298 return sm_.isAliased( alias );
299 }
300 //**********************************************************************************************
301
302 //**********************************************************************************************
307 inline bool canSMPAssign() const noexcept {
308 return sm_.canSMPAssign();
309 }
310 //**********************************************************************************************
311
312 private:
313 //**Member variables****************************************************************************
315 //**********************************************************************************************
316
317 //**Assignment to dense matrices****************************************************************
329 template< typename MT2 // Type of the target dense matrix
330 , bool SO2 > // Storage order of the target dense matrix
331 friend inline auto assign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
333 {
335
336 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
337 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
338
339 assign( *lhs, rhs.sm_ );
340 }
342 //**********************************************************************************************
343
344 //**Assignment to sparse matrices***************************************************************
356 template< typename MT2 // Type of the target sparse matrix
357 , bool SO2 > // Storage order of the target sparse matrix
358 friend inline auto assign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
360 {
362
363 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
364 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
365
366 assign( *lhs, rhs.sm_ );
367 }
369 //**********************************************************************************************
370
371 //**Addition assignment to dense matrices*******************************************************
383 template< typename MT2 // Type of the target dense matrix
384 , bool SO2 > // Storage order of the target dense matrix
385 friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
386 -> EnableIf_t< UseAssign_v<MT2> >
387 {
389
390 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
391 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
392
393 addAssign( *lhs, rhs.sm_ );
394 }
396 //**********************************************************************************************
397
398 //**Addition assignment to sparse matrices******************************************************
410 template< typename MT2 // Type of the target sparse matrix
411 , bool SO2 > // Storage order of the target sparse matrix
412 friend inline auto addAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
413 -> EnableIf_t< UseAssign_v<MT2> >
414 {
416
417 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
418 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
419
420 addAssign( *lhs, rhs.sm_ );
421 }
423 //**********************************************************************************************
424
425 //**Subtraction assignment to dense matrices****************************************************
437 template< typename MT2 // Type of the target dense matrix
438 , bool SO2 > // Storage order of the target dense matrix
439 friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
440 -> EnableIf_t< UseAssign_v<MT2> >
441 {
443
444 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
445 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
446
447 subAssign( *lhs, rhs.sm_ );
448 }
450 //**********************************************************************************************
451
452 //**Subtraction assignment to sparse matrices***************************************************
464 template< typename MT2 // Type of the target sparse matrix
465 , bool SO2 > // Storage order of the target sparse matrix
466 friend inline auto subAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
467 -> EnableIf_t< UseAssign_v<MT2> >
468 {
470
471 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
472 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
473
474 subAssign( *lhs, rhs.sm_ );
475 }
477 //**********************************************************************************************
478
479 //**Schur product assignment to dense matrices**************************************************
491 template< typename MT2 // Type of the target dense matrix
492 , bool SO2 > // Storage order of the target dense matrix
493 friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
494 -> EnableIf_t< UseAssign_v<MT2> >
495 {
497
498 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
499 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
500
501 schurAssign( *lhs, rhs.sm_ );
502 }
504 //**********************************************************************************************
505
506 //**Schur product assignment to sparse matrices*************************************************
518 template< typename MT2 // Type of the target sparse matrix
519 , bool SO2 > // Storage order of the target sparse matrix
520 friend inline auto schurAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
521 -> EnableIf_t< UseAssign_v<MT2> >
522 {
524
525 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
526 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
527
528 schurAssign( *lhs, rhs.sm_ );
529 }
531 //**********************************************************************************************
532
533 //**Multiplication assignment to dense matrices*************************************************
545 template< typename MT2 // Type of the target dense matrix
546 , bool SO2 > // Storage order of the target dense matrix
547 friend inline auto multAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
548 -> EnableIf_t< UseAssign_v<MT2> >
549 {
551
552 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
553 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
554
555 multAssign( *lhs, rhs.sm_ );
556 }
558 //**********************************************************************************************
559
560 //**Multiplication assignment to sparse matrices************************************************
572 template< typename MT2 // Type of the target sparse matrix
573 , bool SO2 > // Storage order of the target sparse matrix
574 friend inline auto multAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
575 -> EnableIf_t< UseAssign_v<MT2> >
576 {
578
579 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
580 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
581
582 multAssign( *lhs, rhs.sm_ );
583 }
585 //**********************************************************************************************
586
587 //**SMP assignment to dense matrices************************************************************
599 template< typename MT2 // Type of the target dense matrix
600 , bool SO2 > // Storage order of the target dense matrix
601 friend inline auto smpAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
602 -> EnableIf_t< UseSMPAssign_v<MT2> >
603 {
605
606 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
607 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
608
609 smpAssign( *lhs, rhs.sm_ );
610 }
612 //**********************************************************************************************
613
614 //**SMP assignment to sparse matrices***********************************************************
626 template< typename MT2 // Type of the target sparse matrix
627 , bool SO2 > // Storage order of the target sparse matrix
628 friend inline auto smpAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
629 -> EnableIf_t< UseSMPAssign_v<MT2> >
630 {
632
633 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
634 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
635
636 smpAssign( *lhs, rhs.sm_ );
637 }
639 //**********************************************************************************************
640
641 //**SMP addition assignment to dense matrices***************************************************
653 template< typename MT2 // Type of the target dense matrix
654 , bool SO2 > // Storage order of the target dense matrix
655 friend inline auto smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
656 -> EnableIf_t< UseSMPAssign_v<MT2> >
657 {
659
660 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
661 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
662
663 smpAddAssign( *lhs, rhs.sm_ );
664 }
666 //**********************************************************************************************
667
668 //**SMP addition assignment to sparse matrices**************************************************
680 template< typename MT2 // Type of the target sparse matrix
681 , bool SO2 > // Storage order of the target sparse matrix
682 friend inline auto smpAddAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
683 -> EnableIf_t< UseSMPAssign_v<MT2> >
684 {
686
687 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
688 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
689
690 smpAddAssign( *lhs, rhs.sm_ );
691 }
693 //**********************************************************************************************
694
695 //**SMP subtraction assignment to dense matrices************************************************
707 template< typename MT2 // Type of the target dense matrix
708 , bool SO2 > // Storage order of the target dense matrix
709 friend inline auto smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
710 -> EnableIf_t< UseSMPAssign_v<MT2> >
711 {
713
714 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
715 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
716
717 smpSubAssign( *lhs, rhs.sm_ );
718 }
720 //**********************************************************************************************
721
722 //**SMP subtraction assignment to sparse matrices***********************************************
734 template< typename MT2 // Type of the target sparse matrix
735 , bool SO2 > // Storage order of the target sparse matrix
736 friend inline auto smpSubAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
737 -> EnableIf_t< UseSMPAssign_v<MT2> >
738 {
740
741 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
742 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
743
744 smpSubAssign( *lhs, rhs.sm_ );
745 }
747 //**********************************************************************************************
748
749 //**SMP Schur product assignment to dense matrices**********************************************
761 template< typename MT2 // Type of the target dense matrix
762 , bool SO2 > // Storage order of the target dense matrix
763 friend inline auto smpSchurAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
764 -> EnableIf_t< UseSMPAssign_v<MT2> >
765 {
767
768 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
769 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
770
771 smpSchurAssign( *lhs, rhs.sm_ );
772 }
774 //**********************************************************************************************
775
776 //**SMP Schur product assignment to sparse matrices*********************************************
788 template< typename MT2 // Type of the target sparse matrix
789 , bool SO2 > // Storage order of the target sparse matrix
790 friend inline auto smpSchurAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
791 -> EnableIf_t< UseSMPAssign_v<MT2> >
792 {
794
795 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
796 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
797
798 smpSchurAssign( *lhs, rhs.sm_ );
799 }
801 //**********************************************************************************************
802
803 //**SMP multiplication assignment to dense matrices*********************************************
816 template< typename MT2 // Type of the target dense matrix
817 , bool SO2 > // Storage order of the target dense matrix
818 friend inline auto smpMultAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
819 -> EnableIf_t< UseSMPAssign_v<MT2> >
820 {
822
823 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
824 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
825
826 smpMultAssign( *lhs, rhs.sm_ );
827 }
829 //**********************************************************************************************
830
831 //**SMP multiplication assignment to sparse matrices********************************************
844 template< typename MT2 // Type of the target sparse matrix
845 , bool SO2 > // Storage order of the target sparse matrix
846 friend inline auto smpMultAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclStrUppExpr& rhs )
847 -> EnableIf_t< UseSMPAssign_v<MT2> >
848 {
850
851 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
852 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
853
854 smpMultAssign( *lhs, rhs.sm_ );
855 }
857 //**********************************************************************************************
858
859 //**Compile time checks*************************************************************************
866 //**********************************************************************************************
867};
868//*************************************************************************************************
869
870
871
872
873//=================================================================================================
874//
875// GLOBAL FUNCTIONS
876//
877//=================================================================================================
878
879//*************************************************************************************************
890template< typename MT // Type of the sparse matrix
891 , bool SO // Storage order
892 , DisableIf_t< IsStrictlyUpper_v<MT> || IsLower_v<MT> >* = nullptr >
893inline const SMatDeclStrUppExpr<MT,SO> declstrupp_backend( const SparseMatrix<MT,SO>& sm )
894{
896
897 BLAZE_INTERNAL_ASSERT( isSquare( *sm ), "Non-square matrix detected" );
898
899 return SMatDeclStrUppExpr<MT,SO>( *sm );
900}
902//*************************************************************************************************
903
904
905//*************************************************************************************************
916template< typename MT // Type of the sparse matrix
917 , bool SO // Storage order
918 , EnableIf_t< !IsStrictlyUpper_v<MT> && IsLower_v<MT> >* = nullptr >
919inline const ZeroMatrix<ElementType_t<MT>,SO> declstrupp_backend( const SparseMatrix<MT,SO>& sm )
920{
922
923 BLAZE_INTERNAL_ASSERT( isSquare( *sm ), "Non-square matrix detected" );
924
925 return ZeroMatrix<ElementType_t<MT>,SO>( (*sm).rows(), (*sm).columns() );
926}
928//*************************************************************************************************
929
930
931//*************************************************************************************************
942template< typename MT // Type of the sparse matrix
943 , bool SO // Storage order
944 , EnableIf_t< IsStrictlyUpper_v<MT> >* = nullptr >
945inline const MT& declstrupp_backend( const SparseMatrix<MT,SO>& sm )
946{
948
949 BLAZE_INTERNAL_ASSERT( isSquare( *sm ), "Non-square matrix detected" );
950
951 return *sm;
952}
954//*************************************************************************************************
955
956
957//*************************************************************************************************
975template< typename MT // Type of the sparse matrix
976 , bool SO > // Storage order
977inline decltype(auto) declstrupp( const SparseMatrix<MT,SO>& sm )
978{
980
982
983 if( !isSquare( *sm ) ) {
984 BLAZE_THROW_INVALID_ARGUMENT( "Invalid strictly upper matrix specification" );
985 }
986
987 return declstrupp_backend( *sm );
988}
989//*************************************************************************************************
990
991
992
993
994//=================================================================================================
995//
996// ISSTRICTLYUPPER SPECIALIZATIONS
997//
998//=================================================================================================
999
1000//*************************************************************************************************
1002template< typename MT, bool SO >
1003struct IsStrictlyUpper< SMatDeclStrUppExpr<MT,SO> >
1004 : public TrueType
1005{};
1007//*************************************************************************************************
1008
1009} // namespace blaze
1010
1011#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 declstrupp 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 IsLower type trait.
Header file for the IsStrictlyUpper type trait.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of the base template of the StrictlyUpperMatrix.
Base class for dense matrices.
Definition: DenseMatrix.h:82
Expression object for the explicit strictly upper declaration of sparse matrices.
Definition: SMatDeclStrUppExpr.h:92
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatDeclStrUppExpr.h:194
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatDeclStrUppExpr.h:232
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SMatDeclStrUppExpr.h:141
ResultType_t< MT > RT
Result type of the sparse matrix expression.
Definition: SMatDeclStrUppExpr.h:95
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatDeclStrUppExpr.h:263
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatDeclStrUppExpr.h:242
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatDeclStrUppExpr.h:179
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition: SMatDeclStrUppExpr.h:143
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite data type of the sparse matrix expression.
Definition: SMatDeclStrUppExpr.h:152
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatDeclStrUppExpr.h:285
DeclStrUppTrait_t< RT > ResultType
Result type for expression template evaluations.
Definition: SMatDeclStrUppExpr.h:139
ElementType_t< MT > ElementType
Resulting element type.
Definition: SMatDeclStrUppExpr.h:142
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the strictly upper declaration expression.
Definition: SMatDeclStrUppExpr.h:109
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatDeclStrUppExpr.h:140
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: SMatDeclStrUppExpr.h:157
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatDeclStrUppExpr.h:307
GetConstIterator_t< MT > ConstIterator
Iterator over the elements of the dense matrix.
Definition: SMatDeclStrUppExpr.h:149
SMatDeclStrUppExpr(const MT &sm) noexcept
Constructor for the SMatDeclStrUppExpr class.
Definition: SMatDeclStrUppExpr.h:165
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatDeclStrUppExpr.h:297
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatDeclStrUppExpr.h:222
Operand sm_
Sparse matrix of the declstrupp expression.
Definition: SMatDeclStrUppExpr.h:314
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition: SMatDeclStrUppExpr.h:273
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatDeclStrUppExpr.h:252
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatDeclStrUppExpr.h:211
If_t< RequiresEvaluation_v< MT >, const ResultType, const SMatDeclStrUppExpr & > CompositeType
Data type for composite expression templates.
Definition: SMatDeclStrUppExpr.h:146
BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT(GetConstIterator, ConstIterator, INVALID_TYPE)
Definition of the GetConstIterator type trait.
Base class for sparse matrices.
Definition: SparseMatrix.h:77
Constraint on the data type.
Header file for the DeclStrUppExpr base class.
Header file for the Declaration base class.
Header file for the SparseMatrix base class.
decltype(auto) declstrupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as strictly upper.
Definition: DMatDeclStrUppExpr.h:1003
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: SparseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_STRICTLY_UPPER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: StrictlyUpper.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: UniTriangular.h:81
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.
Definition: StorageOrder.h:63
typename DeclStrUppTrait< MT >::Type DeclStrUppTrait_t
Auxiliary alias declaration for the DeclStrUppTrait type trait.
Definition: DeclStrUppTrait.h:146
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 declstrupp expression templates.
Definition: DeclStrUppExpr.h:69
Base class for all declaration expression templates.
Definition: Declaration.h:76
Header file for the RequiresEvaluation type trait.
Header file for basic type definitions.