SMatSerialExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATSERIALEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATSERIALEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
46 #include <blaze/math/Exception.h>
61 #include <blaze/util/Assert.h>
63 #include <blaze/util/mpl/If.h>
64 #include <blaze/util/Types.h>
65 
66 
67 namespace blaze {
68 
69 //=================================================================================================
70 //
71 // CLASS SMATSERIALEXPR
72 //
73 //=================================================================================================
74 
75 //*************************************************************************************************
82 template< typename MT // Type of the sparse matrix
83  , bool SO > // Storage order
84 class SMatSerialExpr
85  : public MatSerialExpr< SparseMatrix< SMatSerialExpr<MT,SO>, SO > >
86  , private Computation
87 {
88  public:
89  //**Type definitions****************************************************************************
96 
98  using CompositeType = const ResultType;
99 
101  using Operand = If_< IsExpression<MT>, const MT, const MT& >;
102  //**********************************************************************************************
103 
104  //**Compilation flags***************************************************************************
106  enum : bool { smpAssignable = MT::smpAssignable };
107  //**********************************************************************************************
108 
109  //**Constructor*********************************************************************************
114  explicit inline SMatSerialExpr( const MT& sm ) noexcept
115  : sm_( sm ) // Sparse matrix of the serial evaluation expression
116  {}
117  //**********************************************************************************************
118 
119  //**Access operator*****************************************************************************
126  inline ReturnType operator()( size_t i, size_t j ) const {
127  BLAZE_INTERNAL_ASSERT( i < sm_.rows() , "Invalid row access index" );
128  BLAZE_INTERNAL_ASSERT( j < sm_.columns(), "Invalid column access index" );
129  return sm_(i,j);
130  }
131  //**********************************************************************************************
132 
133  //**At function*********************************************************************************
141  inline ReturnType at( size_t i, size_t j ) const {
142  if( i >= sm_.rows() ) {
143  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
144  }
145  if( j >= sm_.columns() ) {
146  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
147  }
148  return (*this)(i,j);
149  }
150  //**********************************************************************************************
151 
152  //**Rows function*******************************************************************************
157  inline size_t rows() const noexcept {
158  return sm_.rows();
159  }
160  //**********************************************************************************************
161 
162  //**Columns function****************************************************************************
167  inline size_t columns() const noexcept {
168  return sm_.columns();
169  }
170  //**********************************************************************************************
171 
172  //**NonZeros function***************************************************************************
177  inline size_t nonZeros() const {
178  return sm_.nonZeros();
179  }
180  //**********************************************************************************************
181 
182  //**NonZeros function***************************************************************************
188  inline size_t nonZeros( size_t i ) const {
189  return sm_.nonZeros(i);
190  }
191  //**********************************************************************************************
192 
193  //**Operand access******************************************************************************
198  inline Operand operand() const noexcept {
199  return sm_;
200  }
201  //**********************************************************************************************
202 
203  //**Conversion operator*************************************************************************
208  inline operator Operand() const noexcept {
209  return sm_;
210  }
211  //**********************************************************************************************
212 
213  //**********************************************************************************************
219  template< typename T >
220  inline bool canAlias( const T* alias ) const noexcept {
221  return sm_.canAlias( alias );
222  }
223  //**********************************************************************************************
224 
225  //**********************************************************************************************
231  template< typename T >
232  inline bool isAliased( const T* alias ) const noexcept {
233  return sm_.isAliased( alias );
234  }
235  //**********************************************************************************************
236 
237  //**********************************************************************************************
242  inline bool canSMPAssign() const noexcept {
243  return sm_.canSMPAssign();
244  }
245  //**********************************************************************************************
246 
247  private:
248  //**Member variables****************************************************************************
250  //**********************************************************************************************
251 
252  //**Assignment to dense matrices****************************************************************
264  template< typename MT2 // Type of the target dense matrix
265  , bool SO2 > // Storage order of the target dense matrix
266  friend inline void assign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
267  {
269 
270  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
271  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
272 
273  assign( ~lhs, rhs.sm_ );
274  }
276  //**********************************************************************************************
277 
278  //**Assignment to sparse matrices***************************************************************
290  template< typename MT2 // Type of the target sparse matrix
291  , bool SO2 > // Storage order of the target sparse matrix
292  friend inline void assign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
293  {
295 
296  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
297  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
298 
299  assign( ~lhs, rhs.sm_ );
300  }
302  //**********************************************************************************************
303 
304  //**Addition assignment to dense matrices*******************************************************
316  template< typename MT2 // Type of the target dense matrix
317  , bool SO2 > // Storage order of the target dense matrix
318  friend inline void addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
319  {
321 
322  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
323  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
324 
325  addAssign( ~lhs, rhs.sm_ );
326  }
328  //**********************************************************************************************
329 
330  //**Addition assignment to sparse matrices******************************************************
342  template< typename MT2 // Type of the target sparse matrix
343  , bool SO2 > // Storage order of the target sparse matrix
344  friend inline void addAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
345  {
347 
348  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
349  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
350 
351  addAssign( ~lhs, rhs.sm_ );
352  }
354  //**********************************************************************************************
355 
356  //**Subtraction assignment to dense matrices****************************************************
369  template< typename MT2 // Type of the target dense matrix
370  , bool SO2 > // Storage order of the target dense matrix
371  friend inline void subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
372  {
374 
375  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
376  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
377 
378  subAssign( ~lhs, rhs.sm_ );
379  }
381  //**********************************************************************************************
382 
383  //**Subtraction assignment to sparse matrices***************************************************
396  template< typename MT2 // Type of the target sparse matrix
397  , bool SO2 > // Storage order of the target sparse matrix
398  friend inline void subAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
399  {
401 
402  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
403  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
404 
405  subAssign( ~lhs, rhs.sm_ );
406  }
408  //**********************************************************************************************
409 
410  //**Schur product assignment to dense matrices**************************************************
423  template< typename MT2 // Type of the target dense matrix
424  , bool SO2 > // Storage order of the target dense matrix
425  friend inline void schurAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
426  {
428 
429  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
430  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
431 
432  schurAssign( ~lhs, rhs.sm_ );
433  }
435  //**********************************************************************************************
436 
437  //**Schur product assignment to sparse matrices*************************************************
450  template< typename MT2 // Type of the target sparse matrix
451  , bool SO2 > // Storage order of the target sparse matrix
452  friend inline void schurAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
453  {
455 
456  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
457  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
458 
459  schurAssign( ~lhs, rhs.sm_ );
460  }
462  //**********************************************************************************************
463 
464  //**Multiplication assignment to dense matrices*************************************************
477  template< typename MT2 // Type of the target dense matrix
478  , bool SO2 > // Storage order of the target dense matrix
479  friend inline void multAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
480  {
482 
483  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
484  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
485 
486  multAssign( ~lhs, rhs.sm_ );
487  }
489  //**********************************************************************************************
490 
491  //**Multiplication assignment to sparse matrices************************************************
504  template< typename MT2 // Type of the target sparse matrix
505  , bool SO2 > // Storage order of the target sparse matrix
506  friend inline void multAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
507  {
509 
510  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
511  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
512 
513  multAssign( ~lhs, rhs.sm_ );
514  }
516  //**********************************************************************************************
517 
518  //**SMP assignment to dense matrices************************************************************
530  template< typename MT2 // Type of the target dense matrix
531  , bool SO2 > // Storage order of the target dense matrix
532  friend inline void smpAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
533  {
535 
536  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
537  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
538 
539  assign( ~lhs, rhs.sm_ );
540  }
542  //**********************************************************************************************
543 
544  //**SMP assignment to sparse matrices***********************************************************
556  template< typename MT2 // Type of the target sparse matrix
557  , bool SO2 > // Storage order of the target sparse matrix
558  friend inline void smpAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
559  {
561 
562  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
563  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
564 
565  assign( ~lhs, rhs.sm_ );
566  }
568  //**********************************************************************************************
569 
570  //**SMP addition assignment to dense matrices***************************************************
583  template< typename MT2 // Type of the target dense matrix
584  , bool SO2 > // Storage order of the target dense matrix
585  friend inline void smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
586  {
588 
589  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
590  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
591 
592  addAssign( ~lhs, rhs.sm_ );
593  }
595  //**********************************************************************************************
596 
597  //**SMP addition assignment to sparse matrices**************************************************
610  template< typename MT2 // Type of the target sparse matrix
611  , bool SO2 > // Storage order of the target sparse matrix
612  friend inline void smpAddAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
613  {
615 
616  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
617  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
618 
619  addAssign( ~lhs, rhs.sm_ );
620  }
622  //**********************************************************************************************
623 
624  //**SMP subtraction assignment to dense matrices************************************************
637  template< typename MT2 // Type of the target dense matrix
638  , bool SO2 > // Storage order of the target dense matrix
639  friend inline void smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
640  {
642 
643  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
644  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
645 
646  subAssign( ~lhs, rhs.sm_ );
647  }
649  //**********************************************************************************************
650 
651  //**SMP subtraction assignment to sparse matrices***********************************************
664  template< typename MT2 // Type of the target sparse matrix
665  , bool SO2 > // Storage order of the target sparse matrix
666  friend inline void smpSubAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
667  {
669 
670  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
671  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
672 
673  subAssign( ~lhs, rhs.sm_ );
674  }
676  //**********************************************************************************************
677 
678  //**SMP Schur product assignment to dense matrices**********************************************
691  template< typename MT2 // Type of the target dense matrix
692  , bool SO2 > // Storage order of the target dense matrix
693  friend inline void smpSchurAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
694  {
696 
697  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
698  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
699 
700  schurAssign( ~lhs, rhs.sm_ );
701  }
703  //**********************************************************************************************
704 
705  //**SMP Schur product assignment to sparse matrices*********************************************
718  template< typename MT2 // Type of the target sparse matrix
719  , bool SO2 > // Storage order of the target sparse matrix
720  friend inline void smpSchurAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
721  {
723 
724  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
725  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
726 
727  schurAssign( ~lhs, rhs.sm_ );
728  }
730  //**********************************************************************************************
731 
732  //**SMP multiplication assignment to dense matrices*********************************************
745  template< typename MT2 // Type of the target dense matrix
746  , bool SO2 > // Storage order of the target dense matrix
747  friend inline void smpMultAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
748  {
750 
751  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
752  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
753 
754  multAssign( ~lhs, rhs.sm_ );
755  }
757  //**********************************************************************************************
758 
759  //**SMP multiplication assignment to sparse matrices********************************************
772  template< typename MT2 // Type of the target sparse matrix
773  , bool SO2 > // Storage order of the target sparse matrix
774  friend inline void smpMultAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
775  {
777 
778  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
779  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
780 
781  multAssign( ~lhs, rhs.sm_ );
782  }
784  //**********************************************************************************************
785 
786  //**Compile time checks*************************************************************************
791  //**********************************************************************************************
792 };
793 //*************************************************************************************************
794 
795 
796 
797 
798 //=================================================================================================
799 //
800 // GLOBAL FUNCTIONS
801 //
802 //=================================================================================================
803 
804 //*************************************************************************************************
821 template< typename MT // Type of the sparse matrix
822  , bool SO > // Storage order
823 inline decltype(auto) serial( const SparseMatrix<MT,SO>& sm )
824 {
826 
827  using ReturnType = const SMatSerialExpr<MT,SO>;
828  return ReturnType( ~sm );
829 }
830 //*************************************************************************************************
831 
832 
833 
834 
835 //=================================================================================================
836 //
837 // GLOBAL RESTRUCTURING FUNCTIONS
838 //
839 //=================================================================================================
840 
841 //*************************************************************************************************
852 template< typename MT // Type of the sparse matrix
853  , bool SO > // Storage order
854 inline decltype(auto) serial( const SMatSerialExpr<MT,SO>& sm )
855 {
856  return sm;
857 }
859 //*************************************************************************************************
860 
861 
862 
863 
864 //=================================================================================================
865 //
866 // SIZE SPECIALIZATIONS
867 //
868 //=================================================================================================
869 
870 //*************************************************************************************************
872 template< typename MT, bool SO >
873 struct Size< SMatSerialExpr<MT,SO>, 0UL >
874  : public Size<MT,0UL>
875 {};
876 
877 template< typename MT, bool SO >
878 struct Size< SMatSerialExpr<MT,SO>, 1UL >
879  : public Size<MT,1UL>
880 {};
882 //*************************************************************************************************
883 
884 
885 
886 
887 //=================================================================================================
888 //
889 // ISSYMMETRIC SPECIALIZATIONS
890 //
891 //=================================================================================================
892 
893 //*************************************************************************************************
895 template< typename MT, bool SO >
896 struct IsSymmetric< SMatSerialExpr<MT,SO> >
897  : public IsSymmetric<MT>
898 {};
900 //*************************************************************************************************
901 
902 
903 
904 
905 //=================================================================================================
906 //
907 // ISHERMITIAN SPECIALIZATIONS
908 //
909 //=================================================================================================
910 
911 //*************************************************************************************************
913 template< typename MT, bool SO >
914 struct IsHermitian< SMatSerialExpr<MT,SO> >
915  : public IsHermitian<MT>
916 {};
918 //*************************************************************************************************
919 
920 
921 
922 
923 //=================================================================================================
924 //
925 // ISLOWER SPECIALIZATIONS
926 //
927 //=================================================================================================
928 
929 //*************************************************************************************************
931 template< typename MT, bool SO >
932 struct IsLower< SMatSerialExpr<MT,SO> >
933  : public IsLower<MT>
934 {};
936 //*************************************************************************************************
937 
938 
939 
940 
941 //=================================================================================================
942 //
943 // ISUNILOWER SPECIALIZATIONS
944 //
945 //=================================================================================================
946 
947 //*************************************************************************************************
949 template< typename MT, bool SO >
950 struct IsUniLower< SMatSerialExpr<MT,SO> >
951  : public IsUniLower<MT>
952 {};
954 //*************************************************************************************************
955 
956 
957 
958 
959 //=================================================================================================
960 //
961 // ISSTRICTLYLOWER SPECIALIZATIONS
962 //
963 //=================================================================================================
964 
965 //*************************************************************************************************
967 template< typename MT, bool SO >
968 struct IsStrictlyLower< SMatSerialExpr<MT,SO> >
969  : public IsStrictlyLower<MT>
970 {};
972 //*************************************************************************************************
973 
974 
975 
976 
977 //=================================================================================================
978 //
979 // ISUPPER SPECIALIZATIONS
980 //
981 //=================================================================================================
982 
983 //*************************************************************************************************
985 template< typename MT, bool SO >
986 struct IsUpper< SMatSerialExpr<MT,SO> >
987  : public IsUpper<MT>
988 {};
990 //*************************************************************************************************
991 
992 
993 
994 
995 //=================================================================================================
996 //
997 // ISUNIUPPER SPECIALIZATIONS
998 //
999 //=================================================================================================
1000 
1001 //*************************************************************************************************
1003 template< typename MT, bool SO >
1004 struct IsUniUpper< SMatSerialExpr<MT,SO> >
1005  : public IsUniUpper<MT>
1006 {};
1008 //*************************************************************************************************
1009 
1010 
1011 
1012 
1013 //=================================================================================================
1014 //
1015 // ISSTRICTLYUPPER SPECIALIZATIONS
1016 //
1017 //=================================================================================================
1018 
1019 //*************************************************************************************************
1021 template< typename MT, bool SO >
1022 struct IsStrictlyUpper< SMatSerialExpr<MT,SO> >
1023  : public IsStrictlyUpper<MT>
1024 {};
1026 //*************************************************************************************************
1027 
1028 } // namespace blaze
1029 
1030 #endif
Header file for auxiliary alias declarations.
SMatSerialExpr(const MT &sm) noexcept
Constructor for the SMatSerialExpr class.
Definition: SMatSerialExpr.h:114
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatSerialExpr.h:232
ResultType_< MT > ResultType
Result type for expression template evaluations.
Definition: SMatSerialExpr.h:91
Header file for the IsUniUpper type trait.
EnableIf_< IsDenseMatrix< MT1 > > smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:196
Header file for basic type definitions.
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:164
#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
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatSerialExpr.h:177
EnableIf_< IsDenseVector< VT1 > > smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:193
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:87
Header file for the Computation base class.
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:87
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatSerialExpr.h:141
If_< IsExpression< MT >, const MT, const MT &> Operand
Composite data type of the sparse matrix expression.
Definition: SMatSerialExpr.h:101
Header file for the IsUniLower type trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:133
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
Header file for the SparseMatrix base class.
Constraint on the data type.
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition: SMatSerialExpr.h:198
Header file for the If class template.
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:102
#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: SMatSerialExpr.h:157
ElementType_< MT > ElementType
Resulting element type.
Definition: SMatSerialExpr.h:94
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Header file for the IsLower type trait.
TransposeType_< MT > TransposeType
Transpose type for expression template evaluations.
Definition: SMatSerialExpr.h:93
Constraints on the storage order of matrix types.
Compile time check for symmetric matrices.This type trait tests whether or not the given template par...
Definition: IsSymmetric.h:85
Header file for the exception macros of the math module.
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Header file for all forward declarations for expression class templates.
Header file for the MatSerialExpr base class.
Header file for the IsStrictlyLower type trait.
Operand sm_
Sparse matrix of the serial evaluation expression.
Definition: SMatSerialExpr.h:249
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:86
Header file for run time assertion macros.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatSerialExpr.h:242
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatSerialExpr.h:220
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
#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
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatSerialExpr.h:188
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:263
ReturnType_< MT > ReturnType
Return type for expression template evaluations.
Definition: SMatSerialExpr.h:95
OppositeType_< MT > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatSerialExpr.h:92
const ResultType CompositeType
Data type for composite expression templates.
Definition: SMatSerialExpr.h:98
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatSerialExpr.h:126
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
Header file for the IsUpper type trait.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatSerialExpr.h:167
Expression object for the forced serial evaluation of sparse matrices.The SMatSerialExpr class repres...
Definition: Forward.h:115
Header file for the IsHermitian type trait.
Header file for the Size type trait.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
#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
Header file for the IsExpression type trait class.
Header file for the function trace functionality.