Blaze 3.9
SMatDeclUniLowExpr.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_EXPRESSIONS_SMATDECLUNILOWEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_SMATDECLUNILOWEXPR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <iterator>
45#include <blaze/math/Aliases.h>
63#include <blaze/util/Assert.h>
64#include <blaze/util/EnableIf.h>
68#include <blaze/util/mpl/If.h>
69#include <blaze/util/Types.h>
71
72
73namespace blaze {
74
75//=================================================================================================
76//
77// CLASS SMATDECLUNILOWEXPR
78//
79//=================================================================================================
80
81//*************************************************************************************************
88template< typename MT // Type of the sparse matrix
89 , bool SO > // Storage order
91 : public DeclUniLowExpr< SparseMatrix< SMatDeclUniLowExpr<MT,SO>, SO > >
92 , public Declaration<MT>
93{
94 private:
95 //**Type definitions****************************************************************************
97
99 BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT( GetConstIterator, ConstIterator, INVALID_TYPE );
100 //**********************************************************************************************
101
102 //**Serial evaluation strategy******************************************************************
104
110 static constexpr bool useAssign = RequiresEvaluation_v<MT>;
111
114 template< typename MT2 >
115 static constexpr bool UseAssign_v = useAssign;
117 //**********************************************************************************************
118
119 //**Parallel evaluation strategy****************************************************************
121
127 template< typename MT2 >
128 static constexpr bool UseSMPAssign_v = ( MT2::smpAssignable && useAssign );
130 //**********************************************************************************************
131
132 public:
133 //**Type definitions****************************************************************************
136
139
145
148
150 using ConstIterator = GetConstIterator_t<MT>;
151
153 using Operand = If_t< IsExpression_v<MT>, const MT, const MT& >;
154 //**********************************************************************************************
155
156 //**Compilation flags***************************************************************************
158 static constexpr bool smpAssignable = MT::smpAssignable;
159 //**********************************************************************************************
160
161 //**Constructor*********************************************************************************
166 explicit inline SMatDeclUniLowExpr( const MT& sm ) noexcept
167 : sm_( sm ) // Sparse matrix of the declunilow expression
168 {
169 BLAZE_INTERNAL_ASSERT( isSquare( *sm ), "Non-square matrix detected" );
170 }
171 //**********************************************************************************************
172
173 //**Access operator*****************************************************************************
180 inline ReturnType operator()( size_t i, size_t j ) const {
181 BLAZE_INTERNAL_ASSERT( i < sm_.rows() , "Invalid row access index" );
182 BLAZE_INTERNAL_ASSERT( j < sm_.columns(), "Invalid column access index" );
183 return sm_(i,j);
184 }
185 //**********************************************************************************************
186
187 //**At function*********************************************************************************
195 inline ReturnType at( size_t i, size_t j ) const {
196 if( i >= sm_.rows() ) {
197 BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
198 }
199 if( j >= sm_.columns() ) {
200 BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
201 }
202 return (*this)(i,j);
203 }
204 //**********************************************************************************************
205
206 //**Begin function******************************************************************************
212 inline ConstIterator begin( size_t i ) const {
213 return ConstIterator( sm_.begin(i) );
214 }
215 //**********************************************************************************************
216
217 //**End function********************************************************************************
223 inline ConstIterator end( size_t i ) const {
224 return ConstIterator( sm_.end(i) );
225 }
226 //**********************************************************************************************
227
228 //**Rows function*******************************************************************************
233 inline size_t rows() const noexcept {
234 return sm_.rows();
235 }
236 //**********************************************************************************************
237
238 //**Columns function****************************************************************************
243 inline size_t columns() const noexcept {
244 return sm_.columns();
245 }
246 //**********************************************************************************************
247
248 //**NonZeros function***************************************************************************
253 inline size_t nonZeros() const {
254 return sm_.nonZeros();
255 }
256 //**********************************************************************************************
257
258 //**NonZeros function***************************************************************************
264 inline size_t nonZeros( size_t i ) const {
265 return sm_.nonZeros(i);
266 }
267 //**********************************************************************************************
268
269 //**Operand access******************************************************************************
274 inline Operand operand() const noexcept {
275 return sm_;
276 }
277 //**********************************************************************************************
278
279 //**********************************************************************************************
285 template< typename T >
286 inline bool canAlias( const T* alias ) const noexcept {
287 return sm_.canAlias( alias );
288 }
289 //**********************************************************************************************
290
291 //**********************************************************************************************
297 template< typename T >
298 inline bool isAliased( const T* alias ) const noexcept {
299 return sm_.isAliased( alias );
300 }
301 //**********************************************************************************************
302
303 //**********************************************************************************************
308 inline bool canSMPAssign() const noexcept {
309 return sm_.canSMPAssign();
310 }
311 //**********************************************************************************************
312
313 private:
314 //**Member variables****************************************************************************
316 //**********************************************************************************************
317
318 //**Assignment to dense matrices****************************************************************
330 template< typename MT2 // Type of the target dense matrix
331 , bool SO2 > // Storage order of the target dense matrix
332 friend inline auto assign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
334 {
336
337 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
338 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
339
340 assign( *lhs, rhs.sm_ );
341 }
343 //**********************************************************************************************
344
345 //**Assignment to sparse matrices***************************************************************
357 template< typename MT2 // Type of the target sparse matrix
358 , bool SO2 > // Storage order of the target sparse matrix
359 friend inline auto assign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
361 {
363
364 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
365 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
366
367 assign( *lhs, rhs.sm_ );
368 }
370 //**********************************************************************************************
371
372 //**Addition assignment to dense matrices*******************************************************
384 template< typename MT2 // Type of the target dense matrix
385 , bool SO2 > // Storage order of the target dense matrix
386 friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
387 -> EnableIf_t< UseAssign_v<MT2> >
388 {
390
391 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
392 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
393
394 addAssign( *lhs, rhs.sm_ );
395 }
397 //**********************************************************************************************
398
399 //**Addition assignment to sparse matrices******************************************************
411 template< typename MT2 // Type of the target sparse matrix
412 , bool SO2 > // Storage order of the target sparse matrix
413 friend inline auto addAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
414 -> EnableIf_t< UseAssign_v<MT2> >
415 {
417
418 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
419 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
420
421 addAssign( *lhs, rhs.sm_ );
422 }
424 //**********************************************************************************************
425
426 //**Subtraction assignment to dense matrices****************************************************
438 template< typename MT2 // Type of the target dense matrix
439 , bool SO2 > // Storage order of the target dense matrix
440 friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
441 -> EnableIf_t< UseAssign_v<MT2> >
442 {
444
445 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
446 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
447
448 subAssign( *lhs, rhs.sm_ );
449 }
451 //**********************************************************************************************
452
453 //**Subtraction assignment to sparse matrices***************************************************
465 template< typename MT2 // Type of the target sparse matrix
466 , bool SO2 > // Storage order of the target sparse matrix
467 friend inline auto subAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
468 -> EnableIf_t< UseAssign_v<MT2> >
469 {
471
472 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
473 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
474
475 subAssign( *lhs, rhs.sm_ );
476 }
478 //**********************************************************************************************
479
480 //**Schur product assignment to dense matrices**************************************************
492 template< typename MT2 // Type of the target dense matrix
493 , bool SO2 > // Storage order of the target dense matrix
494 friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
495 -> EnableIf_t< UseAssign_v<MT2> >
496 {
498
499 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
500 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
501
502 schurAssign( *lhs, rhs.sm_ );
503 }
505 //**********************************************************************************************
506
507 //**Schur product assignment to sparse matrices*************************************************
519 template< typename MT2 // Type of the target sparse matrix
520 , bool SO2 > // Storage order of the target sparse matrix
521 friend inline auto schurAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
522 -> EnableIf_t< UseAssign_v<MT2> >
523 {
525
526 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
527 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
528
529 schurAssign( *lhs, rhs.sm_ );
530 }
532 //**********************************************************************************************
533
534 //**Multiplication assignment to dense matrices*************************************************
546 template< typename MT2 // Type of the target dense matrix
547 , bool SO2 > // Storage order of the target dense matrix
548 friend inline auto multAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
549 -> EnableIf_t< UseAssign_v<MT2> >
550 {
552
553 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
554 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
555
556 multAssign( *lhs, rhs.sm_ );
557 }
559 //**********************************************************************************************
560
561 //**Multiplication assignment to sparse matrices************************************************
573 template< typename MT2 // Type of the target sparse matrix
574 , bool SO2 > // Storage order of the target sparse matrix
575 friend inline auto multAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
576 -> EnableIf_t< UseAssign_v<MT2> >
577 {
579
580 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
581 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
582
583 multAssign( *lhs, rhs.sm_ );
584 }
586 //**********************************************************************************************
587
588 //**SMP assignment to dense matrices************************************************************
600 template< typename MT2 // Type of the target dense matrix
601 , bool SO2 > // Storage order of the target dense matrix
602 friend inline auto smpAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
603 -> EnableIf_t< UseSMPAssign_v<MT2> >
604 {
606
607 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
608 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
609
610 smpAssign( *lhs, rhs.sm_ );
611 }
613 //**********************************************************************************************
614
615 //**SMP assignment to sparse matrices***********************************************************
627 template< typename MT2 // Type of the target sparse matrix
628 , bool SO2 > // Storage order of the target sparse matrix
629 friend inline auto smpAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
630 -> EnableIf_t< UseSMPAssign_v<MT2> >
631 {
633
634 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
635 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
636
637 smpAssign( *lhs, rhs.sm_ );
638 }
640 //**********************************************************************************************
641
642 //**SMP addition assignment to dense matrices***************************************************
654 template< typename MT2 // Type of the target dense matrix
655 , bool SO2 > // Storage order of the target dense matrix
656 friend inline auto smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
657 -> EnableIf_t< UseSMPAssign_v<MT2> >
658 {
660
661 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
662 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
663
664 smpAddAssign( *lhs, rhs.sm_ );
665 }
667 //**********************************************************************************************
668
669 //**SMP addition assignment to sparse matrices**************************************************
681 template< typename MT2 // Type of the target sparse matrix
682 , bool SO2 > // Storage order of the target sparse matrix
683 friend inline auto smpAddAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
684 -> EnableIf_t< UseSMPAssign_v<MT2> >
685 {
687
688 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
689 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
690
691 smpAddAssign( *lhs, rhs.sm_ );
692 }
694 //**********************************************************************************************
695
696 //**SMP subtraction assignment to dense matrices************************************************
708 template< typename MT2 // Type of the target dense matrix
709 , bool SO2 > // Storage order of the target dense matrix
710 friend inline auto smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
711 -> EnableIf_t< UseSMPAssign_v<MT2> >
712 {
714
715 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
716 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
717
718 smpSubAssign( *lhs, rhs.sm_ );
719 }
721 //**********************************************************************************************
722
723 //**SMP subtraction assignment to sparse matrices***********************************************
735 template< typename MT2 // Type of the target sparse matrix
736 , bool SO2 > // Storage order of the target sparse matrix
737 friend inline auto smpSubAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
738 -> EnableIf_t< UseSMPAssign_v<MT2> >
739 {
741
742 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
743 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
744
745 smpSubAssign( *lhs, rhs.sm_ );
746 }
748 //**********************************************************************************************
749
750 //**SMP Schur product assignment to dense matrices**********************************************
762 template< typename MT2 // Type of the target dense matrix
763 , bool SO2 > // Storage order of the target dense matrix
764 friend inline auto smpSchurAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
765 -> EnableIf_t< UseSMPAssign_v<MT2> >
766 {
768
769 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
770 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
771
772 smpSchurAssign( *lhs, rhs.sm_ );
773 }
775 //**********************************************************************************************
776
777 //**SMP Schur product assignment to sparse matrices*********************************************
789 template< typename MT2 // Type of the target sparse matrix
790 , bool SO2 > // Storage order of the target sparse matrix
791 friend inline auto smpSchurAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
792 -> EnableIf_t< UseSMPAssign_v<MT2> >
793 {
795
796 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
797 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
798
799 smpSchurAssign( *lhs, rhs.sm_ );
800 }
802 //**********************************************************************************************
803
804 //**SMP multiplication assignment to dense matrices*********************************************
817 template< typename MT2 // Type of the target dense matrix
818 , bool SO2 > // Storage order of the target dense matrix
819 friend inline auto smpMultAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
820 -> EnableIf_t< UseSMPAssign_v<MT2> >
821 {
823
824 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
825 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
826
827 smpMultAssign( *lhs, rhs.sm_ );
828 }
830 //**********************************************************************************************
831
832 //**SMP multiplication assignment to sparse matrices********************************************
845 template< typename MT2 // Type of the target sparse matrix
846 , bool SO2 > // Storage order of the target sparse matrix
847 friend inline auto smpMultAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclUniLowExpr& rhs )
848 -> EnableIf_t< UseSMPAssign_v<MT2> >
849 {
851
852 BLAZE_INTERNAL_ASSERT( (*lhs).rows() == rhs.rows() , "Invalid number of rows" );
853 BLAZE_INTERNAL_ASSERT( (*lhs).columns() == rhs.columns(), "Invalid number of columns" );
854
855 smpMultAssign( *lhs, rhs.sm_ );
856 }
858 //**********************************************************************************************
859
860 //**Compile time checks*************************************************************************
867 //**********************************************************************************************
868};
869//*************************************************************************************************
870
871
872
873
874//=================================================================================================
875//
876// GLOBAL FUNCTIONS
877//
878//=================================================================================================
879
880//*************************************************************************************************
891template< typename MT // Type of the sparse matrix
892 , bool SO // Storage order
893 , DisableIf_t< IsUniLower_v<MT> || IsUpper_v<MT> >* = nullptr >
894inline const SMatDeclUniLowExpr<MT,SO> declunilow_backend( const SparseMatrix<MT,SO>& sm )
895{
897
898 BLAZE_INTERNAL_ASSERT( isSquare( *sm ), "Non-square matrix detected" );
899
900 return SMatDeclUniLowExpr<MT,SO>( *sm );
901}
903//*************************************************************************************************
904
905
906//*************************************************************************************************
917template< typename MT // Type of the sparse matrix
918 , bool SO // Storage order
919 , EnableIf_t< !IsUniLower_v<MT> && IsUpper_v<MT> >* = nullptr >
920inline const IdentityMatrix<ElementType_t<MT>,SO> declunilow_backend( const SparseMatrix<MT,SO>& sm )
921{
923
924 BLAZE_INTERNAL_ASSERT( isSquare( *sm ), "Non-square matrix detected" );
925
926 return IdentityMatrix<ElementType_t<MT>,SO>( (*sm).rows() );
927}
929//*************************************************************************************************
930
931
932//*************************************************************************************************
943template< typename MT // Type of the sparse matrix
944 , bool SO // Storage order
945 , EnableIf_t< IsUniLower_v<MT> >* = nullptr >
946inline const MT& declunilow_backend( const SparseMatrix<MT,SO>& sm )
947{
949
950 BLAZE_INTERNAL_ASSERT( isSquare( *sm ), "Non-square matrix detected" );
951
952 return *sm;
953}
955//*************************************************************************************************
956
957
958//*************************************************************************************************
976template< typename MT // Type of the sparse matrix
977 , bool SO > // Storage order
978inline decltype(auto) declunilow( const SparseMatrix<MT,SO>& sm )
979{
981
984
985 if( !isSquare( *sm ) ) {
986 BLAZE_THROW_INVALID_ARGUMENT( "Invalid unilower matrix specification" );
987 }
988
989 return declunilow_backend( *sm );
990}
991//*************************************************************************************************
992
993
994
995
996//=================================================================================================
997//
998// ISUNILOWER SPECIALIZATIONS
999//
1000//=================================================================================================
1001
1002//*************************************************************************************************
1004template< typename MT, bool SO >
1005struct IsUniLower< SMatDeclUniLowExpr<MT,SO> >
1006 : public TrueType
1007{};
1009//*************************************************************************************************
1010
1011} // namespace blaze
1012
1013#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 declunilow 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.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of the base template of the UniLowerMatrix.
Base class for dense matrices.
Definition: DenseMatrix.h:82
Expression object for the explicit unilower declaration of sparse matrices.
Definition: SMatDeclUniLowExpr.h:93
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite data type of the sparse matrix expression.
Definition: SMatDeclUniLowExpr.h:153
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatDeclUniLowExpr.h:298
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatDeclUniLowExpr.h:308
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatDeclUniLowExpr.h:223
DeclUniLowTrait_t< RT > ResultType
Result type for expression template evaluations.
Definition: SMatDeclUniLowExpr.h:140
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatDeclUniLowExpr.h:243
ResultType_t< MT > RT
Result type of the sparse matrix expression.
Definition: SMatDeclUniLowExpr.h:96
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatDeclUniLowExpr.h:233
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatDeclUniLowExpr.h:141
ElementType_t< MT > ElementType
Resulting element type.
Definition: SMatDeclUniLowExpr.h:143
SMatDeclUniLowExpr(const MT &sm) noexcept
Constructor for the SMatDeclUniLowExpr class.
Definition: SMatDeclUniLowExpr.h:166
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatDeclUniLowExpr.h:253
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition: SMatDeclUniLowExpr.h:274
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatDeclUniLowExpr.h:264
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatDeclUniLowExpr.h:212
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: SMatDeclUniLowExpr.h:158
GetConstIterator_t< MT > ConstIterator
Iterator over the elements of the dense matrix.
Definition: SMatDeclUniLowExpr.h:150
Operand sm_
Sparse matrix of the declunilow expression.
Definition: SMatDeclUniLowExpr.h:315
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatDeclUniLowExpr.h:195
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatDeclUniLowExpr.h:180
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatDeclUniLowExpr.h:286
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SMatDeclUniLowExpr.h:142
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition: SMatDeclUniLowExpr.h:144
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the unilower declaration expression.
Definition: SMatDeclUniLowExpr.h:110
BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT(GetConstIterator, ConstIterator, INVALID_TYPE)
Definition of the GetConstIterator type trait.
If_t< RequiresEvaluation_v< MT >, const ResultType, const SMatDeclUniLowExpr & > CompositeType
Data type for composite expression templates.
Definition: SMatDeclUniLowExpr.h:147
Base class for sparse matrices.
Definition: SparseMatrix.h:77
Constraint on the data type.
Header file for the DeclUniLowExpr base class.
Header file for the Declaration base class.
Header file for the SparseMatrix base class.
decltype(auto) declunilow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as unilower.
Definition: DMatDeclUniLowExpr.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_NOT_BE_STRICTLY_TRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: StrictlyTriangular.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNIFORM_TYPE(T)
Constraint on the data type.
Definition: Uniform.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 DeclUniLowTrait< MT >::Type DeclUniLowTrait_t
Auxiliary alias declaration for the DeclUniLowTrait type trait.
Definition: DeclUniLowTrait.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 declunilow expression templates.
Definition: DeclUniLowExpr.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.