Blaze  3.6
SMatDeclLowExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATDECLLOWEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATDECLLOWEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
45 #include <blaze/math/Aliases.h>
50 #include <blaze/math/Exception.h>
61 #include <blaze/util/Assert.h>
62 #include <blaze/util/DisableIf.h>
63 #include <blaze/util/EnableIf.h>
66 #include <blaze/util/InvalidType.h>
67 #include <blaze/util/mpl/If.h>
68 #include <blaze/util/Types.h>
70 
71 
72 namespace blaze {
73 
74 //=================================================================================================
75 //
76 // CLASS SMATDECLLOWEXPR
77 //
78 //=================================================================================================
79 
80 //*************************************************************************************************
87 template< typename MT // Type of the sparse matrix
88  , bool SO > // Storage order
89 class SMatDeclLowExpr
90  : public DeclLowExpr< SparseMatrix< SMatDeclLowExpr<MT,SO>, SO > >
91  , public Declaration<MT>
92 {
93  private:
94  //**Type definitions****************************************************************************
95  using RT = ResultType_t<MT>;
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 
112  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****************************************************************************
140 
143 
145  using ConstIterator = GetConstIterator_t<MT>;
146 
148  using Operand = If_t< IsExpression_v<MT>, const MT, const MT& >;
149  //**********************************************************************************************
150 
151  //**Compilation flags***************************************************************************
153  static constexpr bool smpAssignable = MT::smpAssignable;
154  //**********************************************************************************************
155 
156  //**Constructor*********************************************************************************
161  explicit inline SMatDeclLowExpr( const MT& sm ) noexcept
162  : sm_( sm ) // Sparse matrix of the decllow expression
163  {
164  BLAZE_INTERNAL_ASSERT( isSquare( ~sm ), "Non-square matrix detected" );
165  }
166  //**********************************************************************************************
167 
168  //**Access operator*****************************************************************************
175  inline ReturnType operator()( size_t i, size_t j ) const {
176  BLAZE_INTERNAL_ASSERT( i < sm_.rows() , "Invalid row access index" );
177  BLAZE_INTERNAL_ASSERT( j < sm_.columns(), "Invalid column access index" );
178  return sm_(i,j);
179  }
180  //**********************************************************************************************
181 
182  //**At function*********************************************************************************
190  inline ReturnType at( size_t i, size_t j ) const {
191  if( i >= sm_.rows() ) {
192  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
193  }
194  if( j >= sm_.columns() ) {
195  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
196  }
197  return (*this)(i,j);
198  }
199  //**********************************************************************************************
200 
201  //**Begin function******************************************************************************
207  inline ConstIterator begin( size_t i ) const {
208  return ConstIterator( sm_.begin(i) );
209  }
210  //**********************************************************************************************
211 
212  //**End function********************************************************************************
218  inline ConstIterator end( size_t i ) const {
219  return ConstIterator( sm_.end(i) );
220  }
221  //**********************************************************************************************
222 
223  //**Rows function*******************************************************************************
228  inline size_t rows() const noexcept {
229  return sm_.rows();
230  }
231  //**********************************************************************************************
232 
233  //**Columns function****************************************************************************
238  inline size_t columns() const noexcept {
239  return sm_.columns();
240  }
241  //**********************************************************************************************
242 
243  //**NonZeros function***************************************************************************
248  inline size_t nonZeros() const {
249  return sm_.nonZeros();
250  }
251  //**********************************************************************************************
252 
253  //**NonZeros function***************************************************************************
259  inline size_t nonZeros( size_t i ) const {
260  return sm_.nonZeros(i);
261  }
262  //**********************************************************************************************
263 
264  //**Operand access******************************************************************************
269  inline Operand operand() const noexcept {
270  return sm_;
271  }
272  //**********************************************************************************************
273 
274  //**********************************************************************************************
280  template< typename T >
281  inline bool canAlias( const T* alias ) const noexcept {
282  return sm_.canAlias( alias );
283  }
284  //**********************************************************************************************
285 
286  //**********************************************************************************************
292  template< typename T >
293  inline bool isAliased( const T* alias ) const noexcept {
294  return sm_.isAliased( alias );
295  }
296  //**********************************************************************************************
297 
298  //**********************************************************************************************
303  inline bool canSMPAssign() const noexcept {
304  return sm_.canSMPAssign();
305  }
306  //**********************************************************************************************
307 
308  private:
309  //**Member variables****************************************************************************
311  //**********************************************************************************************
312 
313  //**Assignment to dense matrices****************************************************************
325  template< typename MT2 // Type of the target dense matrix
326  , bool SO2 > // Storage order of the target dense matrix
327  friend inline auto assign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
329  {
331 
332  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
333  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
334 
335  assign( ~lhs, rhs.sm_ );
336  }
338  //**********************************************************************************************
339 
340  //**Assignment to sparse matrices***************************************************************
352  template< typename MT2 // Type of the target sparse matrix
353  , bool SO2 > // Storage order of the target sparse matrix
354  friend inline auto assign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
356  {
358 
359  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
360  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
361 
362  assign( ~lhs, rhs.sm_ );
363  }
365  //**********************************************************************************************
366 
367  //**Addition assignment to dense matrices*******************************************************
379  template< typename MT2 // Type of the target dense matrix
380  , bool SO2 > // Storage order of the target dense matrix
381  friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
382  -> EnableIf_t< UseAssign_v<MT2> >
383  {
385 
386  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
387  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
388 
389  addAssign( ~lhs, rhs.sm_ );
390  }
392  //**********************************************************************************************
393 
394  //**Addition assignment to sparse matrices******************************************************
406  template< typename MT2 // Type of the target sparse matrix
407  , bool SO2 > // Storage order of the target sparse matrix
408  friend inline auto addAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
409  -> EnableIf_t< UseAssign_v<MT2> >
410  {
412 
413  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
414  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
415 
416  addAssign( ~lhs, rhs.sm_ );
417  }
419  //**********************************************************************************************
420 
421  //**Subtraction assignment to dense matrices****************************************************
433  template< typename MT2 // Type of the target dense matrix
434  , bool SO2 > // Storage order of the target dense matrix
435  friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
436  -> EnableIf_t< UseAssign_v<MT2> >
437  {
439 
440  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
441  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
442 
443  subAssign( ~lhs, rhs.sm_ );
444  }
446  //**********************************************************************************************
447 
448  //**Subtraction assignment to sparse matrices***************************************************
460  template< typename MT2 // Type of the target sparse matrix
461  , bool SO2 > // Storage order of the target sparse matrix
462  friend inline auto subAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
463  -> EnableIf_t< UseAssign_v<MT2> >
464  {
466 
467  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
468  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
469 
470  subAssign( ~lhs, rhs.sm_ );
471  }
473  //**********************************************************************************************
474 
475  //**Schur product assignment to dense matrices**************************************************
487  template< typename MT2 // Type of the target dense matrix
488  , bool SO2 > // Storage order of the target dense matrix
489  friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
490  -> EnableIf_t< UseAssign_v<MT2> >
491  {
493 
494  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
495  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
496 
497  schurAssign( ~lhs, rhs.sm_ );
498  }
500  //**********************************************************************************************
501 
502  //**Schur product assignment to sparse matrices*************************************************
514  template< typename MT2 // Type of the target sparse matrix
515  , bool SO2 > // Storage order of the target sparse matrix
516  friend inline auto schurAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
517  -> EnableIf_t< UseAssign_v<MT2> >
518  {
520 
521  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
522  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
523 
524  schurAssign( ~lhs, rhs.sm_ );
525  }
527  //**********************************************************************************************
528 
529  //**Multiplication assignment to dense matrices*************************************************
541  template< typename MT2 // Type of the target dense matrix
542  , bool SO2 > // Storage order of the target dense matrix
543  friend inline auto multAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
544  -> EnableIf_t< UseAssign_v<MT2> >
545  {
547 
548  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
549  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
550 
551  multAssign( ~lhs, rhs.sm_ );
552  }
554  //**********************************************************************************************
555 
556  //**Multiplication assignment to sparse matrices************************************************
568  template< typename MT2 // Type of the target sparse matrix
569  , bool SO2 > // Storage order of the target sparse matrix
570  friend inline auto multAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
571  -> EnableIf_t< UseAssign_v<MT2> >
572  {
574 
575  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
576  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
577 
578  multAssign( ~lhs, rhs.sm_ );
579  }
581  //**********************************************************************************************
582 
583  //**SMP assignment to dense matrices************************************************************
595  template< typename MT2 // Type of the target dense matrix
596  , bool SO2 > // Storage order of the target dense matrix
597  friend inline auto smpAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
598  -> EnableIf_t< UseSMPAssign_v<MT2> >
599  {
601 
602  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
603  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
604 
605  smpAssign( ~lhs, rhs.sm_ );
606  }
608  //**********************************************************************************************
609 
610  //**SMP assignment to sparse matrices***********************************************************
622  template< typename MT2 // Type of the target sparse matrix
623  , bool SO2 > // Storage order of the target sparse matrix
624  friend inline auto smpAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
625  -> EnableIf_t< UseSMPAssign_v<MT2> >
626  {
628 
629  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
630  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
631 
632  smpAssign( ~lhs, rhs.sm_ );
633  }
635  //**********************************************************************************************
636 
637  //**SMP addition assignment to dense matrices***************************************************
649  template< typename MT2 // Type of the target dense matrix
650  , bool SO2 > // Storage order of the target dense matrix
651  friend inline auto smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
652  -> EnableIf_t< UseSMPAssign_v<MT2> >
653  {
655 
656  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
657  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
658 
659  smpAddAssign( ~lhs, rhs.sm_ );
660  }
662  //**********************************************************************************************
663 
664  //**SMP addition assignment to sparse matrices**************************************************
676  template< typename MT2 // Type of the target sparse matrix
677  , bool SO2 > // Storage order of the target sparse matrix
678  friend inline auto smpAddAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
679  -> EnableIf_t< UseSMPAssign_v<MT2> >
680  {
682 
683  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
684  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
685 
686  smpAddAssign( ~lhs, rhs.sm_ );
687  }
689  //**********************************************************************************************
690 
691  //**SMP subtraction assignment to dense matrices************************************************
703  template< typename MT2 // Type of the target dense matrix
704  , bool SO2 > // Storage order of the target dense matrix
705  friend inline auto smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
706  -> EnableIf_t< UseSMPAssign_v<MT2> >
707  {
709 
710  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
711  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
712 
713  smpSubAssign( ~lhs, rhs.sm_ );
714  }
716  //**********************************************************************************************
717 
718  //**SMP subtraction assignment to sparse matrices***********************************************
730  template< typename MT2 // Type of the target sparse matrix
731  , bool SO2 > // Storage order of the target sparse matrix
732  friend inline auto smpSubAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
733  -> EnableIf_t< UseSMPAssign_v<MT2> >
734  {
736 
737  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
738  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
739 
740  smpSubAssign( ~lhs, rhs.sm_ );
741  }
743  //**********************************************************************************************
744 
745  //**SMP Schur product assignment to dense matrices**********************************************
757  template< typename MT2 // Type of the target dense matrix
758  , bool SO2 > // Storage order of the target dense matrix
759  friend inline auto smpSchurAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
760  -> EnableIf_t< UseSMPAssign_v<MT2> >
761  {
763 
764  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
765  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
766 
767  smpSchurAssign( ~lhs, rhs.sm_ );
768  }
770  //**********************************************************************************************
771 
772  //**SMP Schur product assignment to sparse matrices*********************************************
784  template< typename MT2 // Type of the target sparse matrix
785  , bool SO2 > // Storage order of the target sparse matrix
786  friend inline auto smpSchurAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
787  -> EnableIf_t< UseSMPAssign_v<MT2> >
788  {
790 
791  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
792  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
793 
794  smpSchurAssign( ~lhs, rhs.sm_ );
795  }
797  //**********************************************************************************************
798 
799  //**SMP multiplication assignment to dense matrices*********************************************
812  template< typename MT2 // Type of the target dense matrix
813  , bool SO2 > // Storage order of the target dense matrix
814  friend inline auto smpMultAssign( DenseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
815  -> EnableIf_t< UseSMPAssign_v<MT2> >
816  {
818 
819  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
820  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
821 
822  smpMultAssign( ~lhs, rhs.sm_ );
823  }
825  //**********************************************************************************************
826 
827  //**SMP multiplication assignment to sparse matrices********************************************
840  template< typename MT2 // Type of the target sparse matrix
841  , bool SO2 > // Storage order of the target sparse matrix
842  friend inline auto smpMultAssign( SparseMatrix<MT2,SO2>& lhs, const SMatDeclLowExpr& rhs )
843  -> EnableIf_t< UseSMPAssign_v<MT2> >
844  {
846 
847  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
848  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
849 
850  smpMultAssign( ~lhs, rhs.sm_ );
851  }
853  //**********************************************************************************************
854 
855  //**Compile time checks*************************************************************************
862  //**********************************************************************************************
863 };
864 //*************************************************************************************************
865 
866 
867 
868 
869 //=================================================================================================
870 //
871 // GLOBAL FUNCTIONS
872 //
873 //=================================================================================================
874 
875 //*************************************************************************************************
886 template< typename MT // Type of the sparse matrix
887  , bool SO // Storage order
888  , DisableIf_t< IsLower_v<MT> || IsUniUpper_v<MT> >* = nullptr >
889 inline const SMatDeclLowExpr<MT,SO> decllow_backend( const SparseMatrix<MT,SO>& sm )
890 {
892 
893  BLAZE_INTERNAL_ASSERT( isSquare( ~sm ), "Non-square matrix detected" );
894 
895  return SMatDeclLowExpr<MT,SO>( ~sm );
896 }
898 //*************************************************************************************************
899 
900 
901 //*************************************************************************************************
912 template< typename MT // Type of the sparse matrix
913  , bool SO // Storage order
914  , EnableIf_t< !IsLower_v<MT> && IsUniUpper_v<MT> >* = nullptr >
915 inline const IdentityMatrix<ElementType_t<MT>,SO> decllow_backend( const SparseMatrix<MT,SO>& sm )
916 {
918 
919  BLAZE_INTERNAL_ASSERT( isSquare( ~sm ), "Non-square matrix detected" );
920 
921  return IdentityMatrix<ElementType_t<MT>,SO>( (~sm).rows() );
922 }
924 //*************************************************************************************************
925 
926 
927 //*************************************************************************************************
938 template< typename MT // Type of the sparse matrix
939  , bool SO // Storage order
940  , EnableIf_t< IsLower_v<MT> >* = nullptr >
941 inline const MT& decllow_backend( const SparseMatrix<MT,SO>& sm )
942 {
944 
945  BLAZE_INTERNAL_ASSERT( isSquare( ~sm ), "Non-square matrix detected" );
946 
947  return ~sm;
948 }
950 //*************************************************************************************************
951 
952 
953 //*************************************************************************************************
971 template< typename MT // Type of the sparse matrix
972  , bool SO > // Storage order
973 inline decltype(auto) decllow( const SparseMatrix<MT,SO>& sm )
974 {
976 
977  if( !isSquare( ~sm ) ) {
978  BLAZE_THROW_INVALID_ARGUMENT( "Invalid lower matrix specification" );
979  }
980 
981  return decllow_backend( ~sm );
982 }
983 //*************************************************************************************************
984 
985 
986 
987 
988 //=================================================================================================
989 //
990 // GLOBAL RESTRUCTURING FUNCTIONS
991 //
992 //=================================================================================================
993 
994 //*************************************************************************************************
1008 template< typename MT // Type of the left-hand side sparse matrix
1009  , typename ST // Type of the right-hand side scalar value
1010  , bool SO // Storage order
1011  , DisableIf_t< IsLower_v<MT> >* = nullptr >
1012 inline decltype(auto) decllow( const SMatScalarMultExpr<MT,ST,SO>& sm )
1013 {
1015 
1016  if( !isSquare( ~sm ) ) {
1017  BLAZE_THROW_INVALID_ARGUMENT( "Invalid lower matrix specification" );
1018  }
1019 
1020  return decllow( sm.leftOperand() ) * sm.rightOperand();
1021 }
1023 //*************************************************************************************************
1024 
1025 
1026 
1027 
1028 //=================================================================================================
1029 //
1030 // ISLOWER SPECIALIZATIONS
1031 //
1032 //=================================================================================================
1033 
1034 //*************************************************************************************************
1036 template< typename MT, bool SO >
1037 struct IsLower< SMatDeclLowExpr<MT,SO> >
1038  : public TrueType
1039 {};
1041 //*************************************************************************************************
1042 
1043 } // namespace blaze
1044 
1045 #endif
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
Header file for the IsUniUpper type trait.
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatDeclLowExpr.h:136
Header file for basic type definitions.
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: SMatDeclLowExpr.h:153
Header file for all forward declarations for sparse vectors and matrices.
DeclLowTrait_t< RT > ResultType
Result type for expression template evaluations.
Definition: SMatDeclLowExpr.h:135
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias template for the If class template.The If_t alias template provides a convenient shor...
Definition: If.h:109
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatDeclLowExpr.h:281
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:63
typename DeclLowTrait< MT >::Type DeclLowTrait_t
Auxiliary alias declaration for the DeclLowTrait type trait.The DeclLowTrait_t alias declaration prov...
Definition: DeclLowTrait.h:160
BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT(GetConstIterator, ConstIterator, INVALID_TYPE)
Definition of the GetConstIterator type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNIUPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper unitriangular matrix type,...
Definition: UniUpper.h:81
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatDeclLowExpr.h:303
Expression object for the explicit lower declaration of sparse matrices.The SMatDeclLowExpr class rep...
Definition: Forward.h:117
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatDeclLowExpr.h:190
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: IntegralConstant.h:132
Header file for the RequiresEvaluation type trait.
Constraint on the data type.
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.The ReturnType_t alias declaration provides ...
Definition: Aliases.h:410
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatDeclLowExpr.h:175
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes....
Definition: DenseMatrix.h:81
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes....
Definition: Forward.h:145
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition: SMatDeclLowExpr.h:139
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatDeclLowExpr.h:218
Header file for the SparseMatrix base class.
Constraint on the data type.
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatDeclLowExpr.h:207
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
GetConstIterator_t< MT > ConstIterator
Iterator over the elements of the dense matrix.
Definition: SMatDeclLowExpr.h:145
Header file for the DisableIf class template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition: SMatDeclLowExpr.h:269
Header file for the If class template.
Header file for the decllow trait.
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatDeclLowExpr.h:228
Header file for the GetMemberType type trait.
decltype(auto) decllow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as lower.
Definition: DMatDeclLowExpr.h:1001
Header file for the IsLower type trait.
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite data type of the sparse matrix expression.
Definition: SMatDeclLowExpr.h:148
Constraints on the storage order of matrix types.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatDeclLowExpr.h:248
Header file for the exception macros of the math module.
Header file for the DeclLowExpr base class.
Constraint on the data type.
Header file for the EnableIf class template.
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.The OppositeType_t alias declaration provi...
Definition: Aliases.h:270
Header file for the Declaration base class.
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.The TransposeType_t alias declaration pro...
Definition: Aliases.h:470
Header file for run time assertion macros.
Utility type for generic codes.
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
If_t< RequiresEvaluation_v< MT >, const ResultType, const SMatDeclLowExpr & > CompositeType
Data type for composite expression templates.
Definition: SMatDeclLowExpr.h:142
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type,...
Definition: Lower.h:81
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
Header file for all forward declarations for expression class templates.
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 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
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
ElementType_t< MT > ElementType
Resulting element type.
Definition: SMatDeclLowExpr.h:138
Header file for the implementation of the base template of the LowerMatrix.
SMatDeclLowExpr(const MT &sm) noexcept
Constructor for the SMatDeclLowExpr class.
Definition: SMatDeclLowExpr.h:161
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
Operand sm_
Sparse matrix of the decllow expression.
Definition: SMatDeclLowExpr.h:310
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: SMatDeclLowExpr.h:137
Header file for the IntegralConstant class template.
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the lower declaration expression.
Definition: SMatDeclLowExpr.h:109
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatDeclLowExpr.h:259
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:951
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatDeclLowExpr.h:238
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
Definition: Assert.h:101
ResultType_t< MT > RT
Result type of the sparse matrix expression.
Definition: SMatDeclLowExpr.h:95
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:191
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type,...
Definition: SparseMatrix.h:61
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatDeclLowExpr.h:293
Header file for the IsExpression type trait class.
Header file for the function trace functionality.