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 <cmath>
44 #include <blaze/math/Aliases.h>
47 #include <blaze/math/Exception.h>
72 #include <blaze/util/Assert.h>
75 #include <blaze/util/InvalidType.h>
77 #include <blaze/util/mpl/And.h>
78 #include <blaze/util/mpl/If.h>
79 #include <blaze/util/Types.h>
80 
81 
82 namespace blaze {
83 
84 //=================================================================================================
85 //
86 // CLASS SMATSERIALEXPR
87 //
88 //=================================================================================================
89 
90 //*************************************************************************************************
97 template< typename MT // Type of the sparse matrix
98  , bool SO > // Storage order
99 class SMatSerialExpr : public SparseMatrix< SMatSerialExpr<MT,SO>, SO >
100  , private MatSerialExpr
101  , private Computation
102 {
103  public:
104  //**Type definitions****************************************************************************
111 
113  typedef const ResultType CompositeType;
114 
116  typedef If_< IsExpression<MT>, const MT, const MT& > Operand;
117  //**********************************************************************************************
118 
119  //**Compilation flags***************************************************************************
121  enum : bool { smpAssignable = MT::smpAssignable };
122  //**********************************************************************************************
123 
124  //**Constructor*********************************************************************************
129  explicit inline SMatSerialExpr( const MT& sm ) noexcept
130  : sm_( sm ) // Sparse matrix of the serial evaluation expression
131  {}
132  //**********************************************************************************************
133 
134  //**Access operator*****************************************************************************
141  inline ReturnType operator()( size_t i, size_t j ) const {
142  BLAZE_INTERNAL_ASSERT( i < sm_.rows() , "Invalid row access index" );
143  BLAZE_INTERNAL_ASSERT( j < sm_.columns(), "Invalid column access index" );
144  return sm_(i,j);
145  }
146  //**********************************************************************************************
147 
148  //**At function*********************************************************************************
156  inline ReturnType at( size_t i, size_t j ) const {
157  if( i >= sm_.rows() ) {
158  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
159  }
160  if( j >= sm_.columns() ) {
161  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
162  }
163  return (*this)(i,j);
164  }
165  //**********************************************************************************************
166 
167  //**Rows function*******************************************************************************
172  inline size_t rows() const noexcept {
173  return sm_.rows();
174  }
175  //**********************************************************************************************
176 
177  //**Columns function****************************************************************************
182  inline size_t columns() const noexcept {
183  return sm_.columns();
184  }
185  //**********************************************************************************************
186 
187  //**NonZeros function***************************************************************************
192  inline size_t nonZeros() const {
193  return sm_.nonZeros();
194  }
195  //**********************************************************************************************
196 
197  //**NonZeros function***************************************************************************
203  inline size_t nonZeros( size_t i ) const {
204  return sm_.nonZeros(i);
205  }
206  //**********************************************************************************************
207 
208  //**Operand access******************************************************************************
213  inline Operand operand() const noexcept {
214  return sm_;
215  }
216  //**********************************************************************************************
217 
218  //**Conversion operator*************************************************************************
223  inline operator Operand() const noexcept {
224  return sm_;
225  }
226  //**********************************************************************************************
227 
228  //**********************************************************************************************
234  template< typename T >
235  inline bool canAlias( const T* alias ) const noexcept {
236  return sm_.canAlias( alias );
237  }
238  //**********************************************************************************************
239 
240  //**********************************************************************************************
246  template< typename T >
247  inline bool isAliased( const T* alias ) const noexcept {
248  return sm_.isAliased( alias );
249  }
250  //**********************************************************************************************
251 
252  //**********************************************************************************************
257  inline bool canSMPAssign() const noexcept {
258  return sm_.canSMPAssign();
259  }
260  //**********************************************************************************************
261 
262  private:
263  //**Member variables****************************************************************************
264  Operand sm_;
265  //**********************************************************************************************
266 
267  //**Assignment to dense matrices****************************************************************
279  template< typename MT2 // Type of the target dense matrix
280  , bool SO2 > // Storage order of the target dense matrix
281  friend inline void assign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
282  {
284 
285  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
286  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
287 
288  assign( ~lhs, rhs.sm_ );
289  }
291  //**********************************************************************************************
292 
293  //**Assignment to sparse matrices***************************************************************
305  template< typename MT2 // Type of the target sparse matrix
306  , bool SO2 > // Storage order of the target sparse matrix
307  friend inline void assign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
308  {
310 
311  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
312  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
313 
314  assign( ~lhs, rhs.sm_ );
315  }
317  //**********************************************************************************************
318 
319  //**Addition assignment to dense matrices*******************************************************
331  template< typename MT2 // Type of the target dense matrix
332  , bool SO2 > // Storage order of the target dense matrix
333  friend inline void addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& 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  addAssign( ~lhs, rhs.sm_ );
341  }
343  //**********************************************************************************************
344 
345  //**Addition 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 void addAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
360  {
362 
363  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
364  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
365 
366  addAssign( ~lhs, rhs.sm_ );
367  }
369  //**********************************************************************************************
370 
371  //**Subtraction 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 void subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
387  {
389 
390  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
391  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
392 
393  subAssign( ~lhs, rhs.sm_ );
394  }
396  //**********************************************************************************************
397 
398  //**Subtraction 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 void subAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
414  {
416 
417  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
418  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
419 
420  subAssign( ~lhs, rhs.sm_ );
421  }
423  //**********************************************************************************************
424 
425  //**Multiplication 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 void multAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
441  {
443 
444  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
445  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
446 
447  multAssign( ~lhs, rhs.sm_ );
448  }
450  //**********************************************************************************************
451 
452  //**Multiplication 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 void multAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
468  {
470 
471  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
472  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
473 
474  multAssign( ~lhs, rhs.sm_ );
475  }
477  //**********************************************************************************************
478 
479  //**SMP assignment to dense matrices************************************************************
491  template< typename MT2 // Type of the target dense matrix
492  , bool SO2 > // Storage order of the target dense matrix
493  friend inline void smpAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
494  {
496 
497  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
498  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
499 
500  assign( ~lhs, rhs.sm_ );
501  }
503  //**********************************************************************************************
504 
505  //**SMP assignment to sparse matrices***********************************************************
517  template< typename MT2 // Type of the target sparse matrix
518  , bool SO2 > // Storage order of the target sparse matrix
519  friend inline void smpAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
520  {
522 
523  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
524  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
525 
526  assign( ~lhs, rhs.sm_ );
527  }
529  //**********************************************************************************************
530 
531  //**SMP addition assignment to dense matrices***************************************************
544  template< typename MT2 // Type of the target dense matrix
545  , bool SO2 > // Storage order of the target dense matrix
546  friend inline void smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
547  {
549 
550  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
551  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
552 
553  addAssign( ~lhs, rhs.sm_ );
554  }
556  //**********************************************************************************************
557 
558  //**SMP addition assignment to sparse matrices**************************************************
571  template< typename MT2 // Type of the target sparse matrix
572  , bool SO2 > // Storage order of the target sparse matrix
573  friend inline void smpAddAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
574  {
576 
577  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
578  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
579 
580  addAssign( ~lhs, rhs.sm_ );
581  }
583  //**********************************************************************************************
584 
585  //**SMP subtraction assignment to dense matrices************************************************
598  template< typename MT2 // Type of the target dense matrix
599  , bool SO2 > // Storage order of the target dense matrix
600  friend inline void smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
601  {
603 
604  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
605  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
606 
607  subAssign( ~lhs, rhs.sm_ );
608  }
610  //**********************************************************************************************
611 
612  //**SMP subtraction assignment to sparse matrices***********************************************
625  template< typename MT2 // Type of the target sparse matrix
626  , bool SO2 > // Storage order of the target sparse matrix
627  friend inline void smpSubAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
628  {
630 
631  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
632  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
633 
634  subAssign( ~lhs, rhs.sm_ );
635  }
637  //**********************************************************************************************
638 
639  //**SMP multiplication assignment to dense matrices*********************************************
652  template< typename MT2 // Type of the target dense matrix
653  , bool SO2 > // Storage order of the target dense matrix
654  friend inline void smpMultAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
655  {
657 
658  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
659  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
660 
661  multAssign( ~lhs, rhs.sm_ );
662  }
664  //**********************************************************************************************
665 
666  //**SMP multiplication assignment to sparse matrices********************************************
679  template< typename MT2 // Type of the target sparse matrix
680  , bool SO2 > // Storage order of the target sparse matrix
681  friend inline void smpMultAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
682  {
684 
685  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
686  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
687 
688  multAssign( ~lhs, rhs.sm_ );
689  }
691  //**********************************************************************************************
692 
693  //**Compile time checks*************************************************************************
698  //**********************************************************************************************
699 };
700 //*************************************************************************************************
701 
702 
703 
704 
705 //=================================================================================================
706 //
707 // GLOBAL FUNCTIONS
708 //
709 //=================================================================================================
710 
711 //*************************************************************************************************
728 template< typename MT // Type of the sparse matrix
729  , bool SO > // Storage order
731 {
733 
734  return SMatSerialExpr<MT,SO>( ~sm );
735 }
736 //*************************************************************************************************
737 
738 
739 
740 
741 //=================================================================================================
742 //
743 // GLOBAL RESTRUCTURING FUNCTIONS
744 //
745 //=================================================================================================
746 
747 //*************************************************************************************************
758 template< typename MT // Type of the sparse matrix
759  , bool SO > // Storage order
760 inline const SMatSerialExpr<MT,SO> serial( const SMatSerialExpr<MT,SO>& sm )
761 {
762  return sm;
763 }
765 //*************************************************************************************************
766 
767 
768 
769 
770 //=================================================================================================
771 //
772 // ROWS SPECIALIZATIONS
773 //
774 //=================================================================================================
775 
776 //*************************************************************************************************
778 template< typename MT, bool SO >
779 struct Rows< SMatSerialExpr<MT,SO> > : public Rows<MT>
780 {};
782 //*************************************************************************************************
783 
784 
785 
786 
787 //=================================================================================================
788 //
789 // COLUMNS SPECIALIZATIONS
790 //
791 //=================================================================================================
792 
793 //*************************************************************************************************
795 template< typename MT, bool SO >
796 struct Columns< SMatSerialExpr<MT,SO> > : public Columns<MT>
797 {};
799 //*************************************************************************************************
800 
801 
802 
803 
804 //=================================================================================================
805 //
806 // ISSYMMETRIC SPECIALIZATIONS
807 //
808 //=================================================================================================
809 
810 //*************************************************************************************************
812 template< typename MT, bool SO >
813 struct IsSymmetric< SMatSerialExpr<MT,SO> >
814  : public BoolConstant< IsSymmetric<MT>::value >
815 {};
817 //*************************************************************************************************
818 
819 
820 
821 
822 //=================================================================================================
823 //
824 // ISHERMITIAN SPECIALIZATIONS
825 //
826 //=================================================================================================
827 
828 //*************************************************************************************************
830 template< typename MT, bool SO >
831 struct IsHermitian< SMatSerialExpr<MT,SO> >
832  : public BoolConstant< IsHermitian<MT>::value >
833 {};
835 //*************************************************************************************************
836 
837 
838 
839 
840 //=================================================================================================
841 //
842 // ISLOWER SPECIALIZATIONS
843 //
844 //=================================================================================================
845 
846 //*************************************************************************************************
848 template< typename MT, bool SO >
849 struct IsLower< SMatSerialExpr<MT,SO> >
850  : public BoolConstant< IsLower<MT>::value >
851 {};
853 //*************************************************************************************************
854 
855 
856 
857 
858 //=================================================================================================
859 //
860 // ISUNILOWER SPECIALIZATIONS
861 //
862 //=================================================================================================
863 
864 //*************************************************************************************************
866 template< typename MT, bool SO >
867 struct IsUniLower< SMatSerialExpr<MT,SO> >
868  : public BoolConstant< IsUniLower<MT>::value >
869 {};
871 //*************************************************************************************************
872 
873 
874 
875 
876 //=================================================================================================
877 //
878 // ISSTRICTLYLOWER SPECIALIZATIONS
879 //
880 //=================================================================================================
881 
882 //*************************************************************************************************
884 template< typename MT, bool SO >
885 struct IsStrictlyLower< SMatSerialExpr<MT,SO> >
886  : public BoolConstant< IsStrictlyLower<MT>::value >
887 {};
889 //*************************************************************************************************
890 
891 
892 
893 
894 //=================================================================================================
895 //
896 // ISUPPER SPECIALIZATIONS
897 //
898 //=================================================================================================
899 
900 //*************************************************************************************************
902 template< typename MT, bool SO >
903 struct IsUpper< SMatSerialExpr<MT,SO> >
904  : public BoolConstant< IsUpper<MT>::value >
905 {};
907 //*************************************************************************************************
908 
909 
910 
911 
912 //=================================================================================================
913 //
914 // ISUNIUPPER SPECIALIZATIONS
915 //
916 //=================================================================================================
917 
918 //*************************************************************************************************
920 template< typename MT, bool SO >
921 struct IsUniUpper< SMatSerialExpr<MT,SO> >
922  : public BoolConstant< IsUniUpper<MT>::value >
923 {};
925 //*************************************************************************************************
926 
927 
928 
929 
930 //=================================================================================================
931 //
932 // ISSTRICTLYUPPER SPECIALIZATIONS
933 //
934 //=================================================================================================
935 
936 //*************************************************************************************************
938 template< typename MT, bool SO >
939 struct IsStrictlyUpper< SMatSerialExpr<MT,SO> >
940  : public BoolConstant< IsStrictlyUpper<MT>::value >
941 {};
943 //*************************************************************************************************
944 
945 
946 
947 
948 //=================================================================================================
949 //
950 // EXPRESSION TRAIT SPECIALIZATIONS
951 //
952 //=================================================================================================
953 
954 //*************************************************************************************************
956 template< typename MT >
957 struct SMatSerialExprTrait< SMatSerialExpr<MT,false> >
958 {
959  public:
960  //**********************************************************************************************
961  using Type = If_< And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT> >
962  , SMatSerialExpr<MT,false>
963  , INVALID_TYPE >;
964  //**********************************************************************************************
965 };
967 //*************************************************************************************************
968 
969 
970 //*************************************************************************************************
972 template< typename MT >
973 struct TSMatSerialExprTrait< SMatSerialExpr<MT,true> >
974 {
975  public:
976  //**********************************************************************************************
977  using Type = If_< And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT> >
978  , SMatSerialExpr<MT,true>
979  , INVALID_TYPE >;
980  //**********************************************************************************************
981 };
983 //*************************************************************************************************
984 
985 
986 //*************************************************************************************************
988 template< typename MT, bool SO, bool AF >
989 struct SubmatrixExprTrait< SMatSerialExpr<MT,SO>, AF >
990 {
991  public:
992  //**********************************************************************************************
993  using Type = SerialExprTrait_< SubmatrixExprTrait_<const MT,AF> >;
994  //**********************************************************************************************
995 };
997 //*************************************************************************************************
998 
999 
1000 //*************************************************************************************************
1002 template< typename MT, bool SO >
1003 struct RowExprTrait< SMatSerialExpr<MT,SO> >
1004 {
1005  public:
1006  //**********************************************************************************************
1007  using Type = SerialExprTrait_< RowExprTrait_<const MT> >;
1008  //**********************************************************************************************
1009 };
1011 //*************************************************************************************************
1012 
1013 
1014 //*************************************************************************************************
1016 template< typename MT, bool SO >
1017 struct ColumnExprTrait< SMatSerialExpr<MT,SO> >
1018 {
1019  public:
1020  //**********************************************************************************************
1021  using Type = SerialExprTrait_< ColumnExprTrait_<const MT> >;
1022  //**********************************************************************************************
1023 };
1025 //*************************************************************************************************
1026 
1027 } // namespace blaze
1028 
1029 #endif
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatSerialExpr.h:182
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatSerialExpr.h:141
Header file for auxiliary alias declarations.
SMatSerialExpr(const MT &sm) noexcept
Constructor for the SMatSerialExpr class.
Definition: SMatSerialExpr.h:129
ReturnType_< MT > ReturnType
Return type for expression template evaluations.
Definition: SMatSerialExpr.h:110
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatSerialExpr.h:247
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
Header file for basic type definitions.
Header file for the SMatSerialExprTrait class template.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatSerialExpr.h:192
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:160
Header file for the IsSparseMatrix type trait.
#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
Header file for the ColumnExprTrait class template.
Header file for the IsColumnMajorMatrix type trait.
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
Header file for the And class template.
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
Header file for the Computation base class.
ResultType_< MT > ResultType
Result type for expression template evaluations.
Definition: SMatSerialExpr.h:106
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:323
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:129
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:109
Constraint on the data type.
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatSerialExpr.h:203
Header file for the TSMatSerialExprTrait class template.
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
Header file for the SparseMatrix base class.
TransposeType_< MT > TransposeType
Transpose type for expression template evaluations.
Definition: SMatSerialExpr.h:108
Constraint on the data type.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatSerialExpr.h:257
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:98
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatSerialExpr.h:235
#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
Header file for the Columns type trait.
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.
Header file for the SerialExprTrait class template.
const ResultType CompositeType
Data type for composite expression templates.
Definition: SMatSerialExpr.h:113
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatSerialExpr.h:156
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Header file for the MatSerialExpr base class.
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition: SMatSerialExpr.h:213
Header file for the IsStrictlyLower type trait.
Operand sm_
Sparse matrix of the serial evaluation expression.
Definition: SMatSerialExpr.h:264
Header file for the SubmatrixExprTrait class template.
Header file for run time assertion macros.
Utility type for generic codes.
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:160
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
ElementType_< MT > ElementType
Resulting element type.
Definition: SMatSerialExpr.h:109
If_< IsExpression< MT >, const MT, const MT & > Operand
Composite data type of the sparse matrix expression.
Definition: SMatSerialExpr.h:116
Header file for the IsRowMajorMatrix type trait.
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
Header file for the IntegralConstant class template.
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
Header file for the IsUpper type trait.
Expression object for the forced serial evaluation of sparse matrices.The SMatSerialExpr class repres...
Definition: Forward.h:97
Header file for the IsHermitian type trait.
OppositeType_< MT > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatSerialExpr.h:107
#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
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatSerialExpr.h:172
SMatSerialExpr< MT, SO > This
Type of this SMatSerialExpr instance.
Definition: SMatSerialExpr.h:105
#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 FunctionTrace class.