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>
71 #include <blaze/util/Assert.h>
74 #include <blaze/util/InvalidType.h>
75 #include <blaze/util/mpl/And.h>
76 #include <blaze/util/mpl/If.h>
77 #include <blaze/util/Types.h>
78 
79 
80 namespace blaze {
81 
82 //=================================================================================================
83 //
84 // CLASS SMATSERIALEXPR
85 //
86 //=================================================================================================
87 
88 //*************************************************************************************************
95 template< typename MT // Type of the sparse matrix
96  , bool SO > // Storage order
97 class SMatSerialExpr : public SparseMatrix< SMatSerialExpr<MT,SO>, SO >
98  , private MatSerialExpr
99  , private Computation
100 {
101  public:
102  //**Type definitions****************************************************************************
109 
111  typedef const ResultType CompositeType;
112 
114  typedef If_< IsExpression<MT>, const MT, const MT& > Operand;
115  //**********************************************************************************************
116 
117  //**Compilation flags***************************************************************************
119  enum : bool { smpAssignable = MT::smpAssignable };
120  //**********************************************************************************************
121 
122  //**Constructor*********************************************************************************
127  explicit inline SMatSerialExpr( const MT& sm ) noexcept
128  : sm_( sm ) // Sparse matrix of the serial evaluation expression
129  {}
130  //**********************************************************************************************
131 
132  //**Access operator*****************************************************************************
139  inline ReturnType operator()( size_t i, size_t j ) const {
140  BLAZE_INTERNAL_ASSERT( i < sm_.rows() , "Invalid row access index" );
141  BLAZE_INTERNAL_ASSERT( j < sm_.columns(), "Invalid column access index" );
142  return sm_(i,j);
143  }
144  //**********************************************************************************************
145 
146  //**At function*********************************************************************************
154  inline ReturnType at( size_t i, size_t j ) const {
155  if( i >= sm_.rows() ) {
156  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
157  }
158  if( j >= sm_.columns() ) {
159  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
160  }
161  return (*this)(i,j);
162  }
163  //**********************************************************************************************
164 
165  //**Rows function*******************************************************************************
170  inline size_t rows() const noexcept {
171  return sm_.rows();
172  }
173  //**********************************************************************************************
174 
175  //**Columns function****************************************************************************
180  inline size_t columns() const noexcept {
181  return sm_.columns();
182  }
183  //**********************************************************************************************
184 
185  //**NonZeros function***************************************************************************
190  inline size_t nonZeros() const {
191  return sm_.nonZeros();
192  }
193  //**********************************************************************************************
194 
195  //**NonZeros function***************************************************************************
201  inline size_t nonZeros( size_t i ) const {
202  return sm_.nonZeros(i);
203  }
204  //**********************************************************************************************
205 
206  //**Operand access******************************************************************************
211  inline Operand operand() const noexcept {
212  return sm_;
213  }
214  //**********************************************************************************************
215 
216  //**Conversion operator*************************************************************************
221  inline operator Operand() const noexcept {
222  return sm_;
223  }
224  //**********************************************************************************************
225 
226  //**********************************************************************************************
232  template< typename T >
233  inline bool canAlias( const T* alias ) const noexcept {
234  return sm_.canAlias( alias );
235  }
236  //**********************************************************************************************
237 
238  //**********************************************************************************************
244  template< typename T >
245  inline bool isAliased( const T* alias ) const noexcept {
246  return sm_.isAliased( alias );
247  }
248  //**********************************************************************************************
249 
250  //**********************************************************************************************
255  inline bool canSMPAssign() const noexcept {
256  return sm_.canSMPAssign();
257  }
258  //**********************************************************************************************
259 
260  private:
261  //**Member variables****************************************************************************
262  Operand sm_;
263  //**********************************************************************************************
264 
265  //**Assignment to dense matrices****************************************************************
277  template< typename MT2 // Type of the target dense matrix
278  , bool SO2 > // Storage order of the target dense matrix
279  friend inline void assign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
280  {
282 
283  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
284  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
285 
286  assign( ~lhs, rhs.sm_ );
287  }
289  //**********************************************************************************************
290 
291  //**Assignment to sparse matrices***************************************************************
303  template< typename MT2 // Type of the target sparse matrix
304  , bool SO2 > // Storage order of the target sparse matrix
305  friend inline void assign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
306  {
308 
309  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
310  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
311 
312  assign( ~lhs, rhs.sm_ );
313  }
315  //**********************************************************************************************
316 
317  //**Addition assignment to dense matrices*******************************************************
329  template< typename MT2 // Type of the target dense matrix
330  , bool SO2 > // Storage order of the target dense matrix
331  friend inline void addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
332  {
334 
335  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
336  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
337 
338  addAssign( ~lhs, rhs.sm_ );
339  }
341  //**********************************************************************************************
342 
343  //**Addition assignment to sparse matrices******************************************************
355  template< typename MT2 // Type of the target sparse matrix
356  , bool SO2 > // Storage order of the target sparse matrix
357  friend inline void addAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
358  {
360 
361  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
362  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
363 
364  addAssign( ~lhs, rhs.sm_ );
365  }
367  //**********************************************************************************************
368 
369  //**Subtraction assignment to dense matrices****************************************************
382  template< typename MT2 // Type of the target dense matrix
383  , bool SO2 > // Storage order of the target dense matrix
384  friend inline void subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
385  {
387 
388  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
389  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
390 
391  subAssign( ~lhs, rhs.sm_ );
392  }
394  //**********************************************************************************************
395 
396  //**Subtraction assignment to sparse matrices***************************************************
409  template< typename MT2 // Type of the target sparse matrix
410  , bool SO2 > // Storage order of the target sparse matrix
411  friend inline void subAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
412  {
414 
415  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
416  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
417 
418  subAssign( ~lhs, rhs.sm_ );
419  }
421  //**********************************************************************************************
422 
423  //**Multiplication assignment to dense matrices*************************************************
436  template< typename MT2 // Type of the target dense matrix
437  , bool SO2 > // Storage order of the target dense matrix
438  friend inline void multAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
439  {
441 
442  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
443  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
444 
445  multAssign( ~lhs, rhs.sm_ );
446  }
448  //**********************************************************************************************
449 
450  //**Multiplication assignment to sparse matrices************************************************
463  template< typename MT2 // Type of the target sparse matrix
464  , bool SO2 > // Storage order of the target sparse matrix
465  friend inline void multAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
466  {
468 
469  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
470  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
471 
472  multAssign( ~lhs, rhs.sm_ );
473  }
475  //**********************************************************************************************
476 
477  //**SMP assignment to dense matrices************************************************************
489  template< typename MT2 // Type of the target dense matrix
490  , bool SO2 > // Storage order of the target dense matrix
491  friend inline void smpAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
492  {
494 
495  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
496  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
497 
498  assign( ~lhs, rhs.sm_ );
499  }
501  //**********************************************************************************************
502 
503  //**SMP assignment to sparse matrices***********************************************************
515  template< typename MT2 // Type of the target sparse matrix
516  , bool SO2 > // Storage order of the target sparse matrix
517  friend inline void smpAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
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  assign( ~lhs, rhs.sm_ );
525  }
527  //**********************************************************************************************
528 
529  //**SMP addition assignment to dense matrices***************************************************
542  template< typename MT2 // Type of the target dense matrix
543  , bool SO2 > // Storage order of the target dense matrix
544  friend inline void smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
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  addAssign( ~lhs, rhs.sm_ );
552  }
554  //**********************************************************************************************
555 
556  //**SMP addition assignment to sparse matrices**************************************************
569  template< typename MT2 // Type of the target sparse matrix
570  , bool SO2 > // Storage order of the target sparse matrix
571  friend inline void smpAddAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
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  addAssign( ~lhs, rhs.sm_ );
579  }
581  //**********************************************************************************************
582 
583  //**SMP subtraction assignment to dense matrices************************************************
596  template< typename MT2 // Type of the target dense matrix
597  , bool SO2 > // Storage order of the target dense matrix
598  friend inline void smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
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  subAssign( ~lhs, rhs.sm_ );
606  }
608  //**********************************************************************************************
609 
610  //**SMP subtraction assignment to sparse matrices***********************************************
623  template< typename MT2 // Type of the target sparse matrix
624  , bool SO2 > // Storage order of the target sparse matrix
625  friend inline void smpSubAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
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  subAssign( ~lhs, rhs.sm_ );
633  }
635  //**********************************************************************************************
636 
637  //**SMP multiplication assignment to dense matrices*********************************************
650  template< typename MT2 // Type of the target dense matrix
651  , bool SO2 > // Storage order of the target dense matrix
652  friend inline void smpMultAssign( DenseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
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  multAssign( ~lhs, rhs.sm_ );
660  }
662  //**********************************************************************************************
663 
664  //**SMP multiplication assignment to sparse matrices********************************************
677  template< typename MT2 // Type of the target sparse matrix
678  , bool SO2 > // Storage order of the target sparse matrix
679  friend inline void smpMultAssign( SparseMatrix<MT2,SO2>& lhs, const SMatSerialExpr& rhs )
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  multAssign( ~lhs, rhs.sm_ );
687  }
689  //**********************************************************************************************
690 
691  //**Compile time checks*************************************************************************
696  //**********************************************************************************************
697 };
698 //*************************************************************************************************
699 
700 
701 
702 
703 //=================================================================================================
704 //
705 // GLOBAL FUNCTIONS
706 //
707 //=================================================================================================
708 
709 //*************************************************************************************************
726 template< typename MT // Type of the sparse matrix
727  , bool SO > // Storage order
729 {
731 
732  return SMatSerialExpr<MT,SO>( ~sm );
733 }
734 //*************************************************************************************************
735 
736 
737 
738 
739 //=================================================================================================
740 //
741 // GLOBAL RESTRUCTURING FUNCTIONS
742 //
743 //=================================================================================================
744 
745 //*************************************************************************************************
756 template< typename MT // Type of the sparse matrix
757  , bool SO > // Storage order
758 inline const SMatSerialExpr<MT,SO> serial( const SMatSerialExpr<MT,SO>& sm )
759 {
760  return sm;
761 }
763 //*************************************************************************************************
764 
765 
766 
767 
768 //=================================================================================================
769 //
770 // ROWS SPECIALIZATIONS
771 //
772 //=================================================================================================
773 
774 //*************************************************************************************************
776 template< typename MT, bool SO >
777 struct Rows< SMatSerialExpr<MT,SO> > : public Rows<MT>
778 {};
780 //*************************************************************************************************
781 
782 
783 
784 
785 //=================================================================================================
786 //
787 // COLUMNS SPECIALIZATIONS
788 //
789 //=================================================================================================
790 
791 //*************************************************************************************************
793 template< typename MT, bool SO >
794 struct Columns< SMatSerialExpr<MT,SO> > : public Columns<MT>
795 {};
797 //*************************************************************************************************
798 
799 
800 
801 
802 //=================================================================================================
803 //
804 // ISSYMMETRIC SPECIALIZATIONS
805 //
806 //=================================================================================================
807 
808 //*************************************************************************************************
810 template< typename MT, bool SO >
811 struct IsSymmetric< SMatSerialExpr<MT,SO> >
812  : public BoolConstant< IsSymmetric<MT>::value >
813 {};
815 //*************************************************************************************************
816 
817 
818 
819 
820 //=================================================================================================
821 //
822 // ISHERMITIAN SPECIALIZATIONS
823 //
824 //=================================================================================================
825 
826 //*************************************************************************************************
828 template< typename MT, bool SO >
829 struct IsHermitian< SMatSerialExpr<MT,SO> >
830  : public BoolConstant< IsHermitian<MT>::value >
831 {};
833 //*************************************************************************************************
834 
835 
836 
837 
838 //=================================================================================================
839 //
840 // ISLOWER SPECIALIZATIONS
841 //
842 //=================================================================================================
843 
844 //*************************************************************************************************
846 template< typename MT, bool SO >
847 struct IsLower< SMatSerialExpr<MT,SO> >
848  : public BoolConstant< IsLower<MT>::value >
849 {};
851 //*************************************************************************************************
852 
853 
854 
855 
856 //=================================================================================================
857 //
858 // ISUNILOWER SPECIALIZATIONS
859 //
860 //=================================================================================================
861 
862 //*************************************************************************************************
864 template< typename MT, bool SO >
865 struct IsUniLower< SMatSerialExpr<MT,SO> >
866  : public BoolConstant< IsUniLower<MT>::value >
867 {};
869 //*************************************************************************************************
870 
871 
872 
873 
874 //=================================================================================================
875 //
876 // ISSTRICTLYLOWER SPECIALIZATIONS
877 //
878 //=================================================================================================
879 
880 //*************************************************************************************************
882 template< typename MT, bool SO >
883 struct IsStrictlyLower< SMatSerialExpr<MT,SO> >
884  : public BoolConstant< IsStrictlyLower<MT>::value >
885 {};
887 //*************************************************************************************************
888 
889 
890 
891 
892 //=================================================================================================
893 //
894 // ISUPPER SPECIALIZATIONS
895 //
896 //=================================================================================================
897 
898 //*************************************************************************************************
900 template< typename MT, bool SO >
901 struct IsUpper< SMatSerialExpr<MT,SO> >
902  : public BoolConstant< IsUpper<MT>::value >
903 {};
905 //*************************************************************************************************
906 
907 
908 
909 
910 //=================================================================================================
911 //
912 // ISUNIUPPER SPECIALIZATIONS
913 //
914 //=================================================================================================
915 
916 //*************************************************************************************************
918 template< typename MT, bool SO >
919 struct IsUniUpper< SMatSerialExpr<MT,SO> >
920  : public BoolConstant< IsUniUpper<MT>::value >
921 {};
923 //*************************************************************************************************
924 
925 
926 
927 
928 //=================================================================================================
929 //
930 // ISSTRICTLYUPPER SPECIALIZATIONS
931 //
932 //=================================================================================================
933 
934 //*************************************************************************************************
936 template< typename MT, bool SO >
937 struct IsStrictlyUpper< SMatSerialExpr<MT,SO> >
938  : public BoolConstant< IsStrictlyUpper<MT>::value >
939 {};
941 //*************************************************************************************************
942 
943 
944 
945 
946 //=================================================================================================
947 //
948 // EXPRESSION TRAIT SPECIALIZATIONS
949 //
950 //=================================================================================================
951 
952 //*************************************************************************************************
954 template< typename MT >
955 struct SMatSerialExprTrait< SMatSerialExpr<MT,false> >
956 {
957  public:
958  //**********************************************************************************************
961  , INVALID_TYPE >;
962  //**********************************************************************************************
963 };
965 //*************************************************************************************************
966 
967 
968 //*************************************************************************************************
970 template< typename MT >
971 struct TSMatSerialExprTrait< SMatSerialExpr<MT,true> >
972 {
973  public:
974  //**********************************************************************************************
977  , INVALID_TYPE >;
978  //**********************************************************************************************
979 };
981 //*************************************************************************************************
982 
983 
984 //*************************************************************************************************
986 template< typename MT, bool SO, bool AF >
987 struct SubmatrixExprTrait< SMatSerialExpr<MT,SO>, AF >
988 {
989  public:
990  //**********************************************************************************************
992  //**********************************************************************************************
993 };
995 //*************************************************************************************************
996 
997 
998 //*************************************************************************************************
1000 template< typename MT, bool SO >
1001 struct RowExprTrait< SMatSerialExpr<MT,SO> >
1002 {
1003  public:
1004  //**********************************************************************************************
1006  //**********************************************************************************************
1007 };
1009 //*************************************************************************************************
1010 
1011 
1012 //*************************************************************************************************
1014 template< typename MT, bool SO >
1015 struct ColumnExprTrait< SMatSerialExpr<MT,SO> >
1016 {
1017  public:
1018  //**********************************************************************************************
1020  //**********************************************************************************************
1021 };
1023 //*************************************************************************************************
1024 
1025 } // namespace blaze
1026 
1027 #endif
Header file for auxiliary alias declarations.
SMatSerialExpr(const MT &sm) noexcept
Constructor for the SMatSerialExpr class.
Definition: SMatSerialExpr.h:127
ReturnType_< MT > ReturnType
Return type for expression template evaluations.
Definition: SMatSerialExpr.h:108
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SMatSerialExpr.h:245
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.
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
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatSerialExpr.h:190
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
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.
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
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:88
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatSerialExpr.h:154
ResultType_< MT > ResultType
Result type for expression template evaluations.
Definition: SMatSerialExpr.h:104
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:71
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:119
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:106
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:57
Operand operand() const noexcept
Returns the sparse matrix operand.
Definition: SMatSerialExpr.h:211
Header file for the If class template.
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:83
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
#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
Evaluation of the expression type of a sparse matrix serial evaluation operation.Via this type trait ...
Definition: TSMatSerialExprTrait.h:74
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: SMatSerialExpr.h:170
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
Evaluation of the expression type type of a submatrix operation.Via this type trait it is possible to...
Definition: SubmatrixExprTrait.h:80
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:111
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
Evaluation of the expression type type of a row operation.Via this type trait it is possible to evalu...
Definition: RowExprTrait.h:79
Header file for the RowExprTrait class template.
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:262
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:86
Header file for the SubmatrixExprTrait class template.
Header file for run time assertion macros.
Compile time check for column-major matrix types.This type trait tests whether or not the given templ...
Definition: IsColumnMajorMatrix.h:83
Utility type for generic codes.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SMatSerialExpr.h:255
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SMatSerialExpr.h:233
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
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:93
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:201
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:107
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
If_< IsExpression< MT >, const MT, const MT &> Operand
Composite data type of the sparse matrix expression.
Definition: SMatSerialExpr.h:114
Header file for the IsRowMajorMatrix type trait.
Header file for the IntegralConstant class template.
Compile time evaluation of the number of columns of a matrix.The Columns type trait evaluates the num...
Definition: Columns.h:76
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:76
Evaluation of the expression type of a sparse matrix serial evaluation operation.Via this type trait ...
Definition: SMatSerialExprTrait.h:74
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatSerialExpr.h:139
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.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: SMatSerialExpr.h:180
Expression object for the forced serial evaluation of sparse matrices.The SMatSerialExpr class repres...
Definition: Forward.h:107
Header file for the IsHermitian type trait.
OppositeType_< MT > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatSerialExpr.h:105
Evaluation of the expression type type of a column operation.Via this type trait it is possible to ev...
Definition: ColumnExprTrait.h:78
#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
SMatSerialExpr< MT, SO > This
Type of this SMatSerialExpr instance.
Definition: SMatSerialExpr.h:103
#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
typename SerialExprTrait< T >::Type SerialExprTrait_
Auxiliary alias declaration for the SerialExprTrait class template.The SerialExprTrait_ alias declara...
Definition: SerialExprTrait.h:142
Header file for the IsExpression type trait class.
Header file for the function trace functionality.