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>
70 #include <blaze/util/Assert.h>
72 #include <blaze/util/Exception.h>
73 #include <blaze/util/InvalidType.h>
75 #include <blaze/util/SelectType.h>
76 #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****************************************************************************
104  typedef typename MT::ResultType ResultType;
105  typedef typename MT::OppositeType OppositeType;
106  typedef typename MT::TransposeType TransposeType;
107  typedef typename MT::ElementType ElementType;
108  typedef typename MT::ReturnType ReturnType;
109 
111  typedef const ResultType CompositeType;
112 
114  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type Operand;
115  //**********************************************************************************************
116 
117  //**Compilation flags***************************************************************************
119  enum { smpAssignable = MT::smpAssignable };
120  //**********************************************************************************************
121 
122  //**Constructor*********************************************************************************
127  explicit inline SMatSerialExpr( const MT& sm )
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 {
171  return sm_.rows();
172  }
173  //**********************************************************************************************
174 
175  //**Columns function****************************************************************************
180  inline size_t columns() const {
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 {
212  return sm_;
213  }
214  //**********************************************************************************************
215 
216  //**Conversion operator*************************************************************************
221  inline operator Operand() const {
222  return sm_;
223  }
224  //**********************************************************************************************
225 
226  //**********************************************************************************************
232  template< typename T >
233  inline bool canAlias( const T* alias ) const {
234  return sm_.canAlias( alias );
235  }
236  //**********************************************************************************************
237 
238  //**********************************************************************************************
244  template< typename T >
245  inline bool isAliased( const T* alias ) const {
246  return sm_.isAliased( alias );
247  }
248  //**********************************************************************************************
249 
250  //**********************************************************************************************
255  inline bool canSMPAssign() const {
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> > : public IsTrue< IsSymmetric<MT>::value >
812 {};
814 //*************************************************************************************************
815 
816 
817 
818 
819 //=================================================================================================
820 //
821 // ISHERMITIAN SPECIALIZATIONS
822 //
823 //=================================================================================================
824 
825 //*************************************************************************************************
827 template< typename MT, bool SO >
828 struct IsHermitian< SMatSerialExpr<MT,SO> > : public IsTrue< IsHermitian<MT>::value >
829 {};
831 //*************************************************************************************************
832 
833 
834 
835 
836 //=================================================================================================
837 //
838 // ISLOWER SPECIALIZATIONS
839 //
840 //=================================================================================================
841 
842 //*************************************************************************************************
844 template< typename MT, bool SO >
845 struct IsLower< SMatSerialExpr<MT,SO> > : public IsTrue< IsLower<MT>::value >
846 {};
848 //*************************************************************************************************
849 
850 
851 
852 
853 //=================================================================================================
854 //
855 // ISUNILOWER SPECIALIZATIONS
856 //
857 //=================================================================================================
858 
859 //*************************************************************************************************
861 template< typename MT, bool SO >
862 struct IsUniLower< SMatSerialExpr<MT,SO> > : public IsTrue< IsUniLower<MT>::value >
863 {};
865 //*************************************************************************************************
866 
867 
868 
869 
870 //=================================================================================================
871 //
872 // ISSTRICTLYLOWER SPECIALIZATIONS
873 //
874 //=================================================================================================
875 
876 //*************************************************************************************************
878 template< typename MT, bool SO >
879 struct IsStrictlyLower< SMatSerialExpr<MT,SO> > : public IsTrue< IsStrictlyLower<MT>::value >
880 {};
882 //*************************************************************************************************
883 
884 
885 
886 
887 //=================================================================================================
888 //
889 // ISUPPER SPECIALIZATIONS
890 //
891 //=================================================================================================
892 
893 //*************************************************************************************************
895 template< typename MT, bool SO >
896 struct IsUpper< SMatSerialExpr<MT,SO> > : public IsTrue< IsUpper<MT>::value >
897 {};
899 //*************************************************************************************************
900 
901 
902 
903 
904 //=================================================================================================
905 //
906 // ISUNIUPPER SPECIALIZATIONS
907 //
908 //=================================================================================================
909 
910 //*************************************************************************************************
912 template< typename MT, bool SO >
913 struct IsUniUpper< SMatSerialExpr<MT,SO> > : public IsTrue< IsUniUpper<MT>::value >
914 {};
916 //*************************************************************************************************
917 
918 
919 
920 
921 //=================================================================================================
922 //
923 // ISSTRICTLYUPPER SPECIALIZATIONS
924 //
925 //=================================================================================================
926 
927 //*************************************************************************************************
929 template< typename MT, bool SO >
930 struct IsStrictlyUpper< SMatSerialExpr<MT,SO> > : public IsTrue< IsStrictlyUpper<MT>::value >
931 {};
933 //*************************************************************************************************
934 
935 
936 
937 
938 //=================================================================================================
939 //
940 // EXPRESSION TRAIT SPECIALIZATIONS
941 //
942 //=================================================================================================
943 
944 //*************************************************************************************************
946 template< typename MT >
947 struct SMatSerialExprTrait< SMatSerialExpr<MT,false> >
948 {
949  public:
950  //**********************************************************************************************
951  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value
952  , SMatSerialExpr<MT,false>
953  , INVALID_TYPE >::Type Type;
954  //**********************************************************************************************
955 };
957 //*************************************************************************************************
958 
959 
960 //*************************************************************************************************
962 template< typename MT >
963 struct TSMatSerialExprTrait< SMatSerialExpr<MT,true> >
964 {
965  public:
966  //**********************************************************************************************
967  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value
968  , SMatSerialExpr<MT,true>
969  , INVALID_TYPE >::Type Type;
970  //**********************************************************************************************
971 };
973 //*************************************************************************************************
974 
975 
976 //*************************************************************************************************
978 template< typename MT, bool SO, bool AF >
979 struct SubmatrixExprTrait< SMatSerialExpr<MT,SO>, AF >
980 {
981  public:
982  //**********************************************************************************************
983  typedef typename SerialExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type >::Type Type;
984  //**********************************************************************************************
985 };
987 //*************************************************************************************************
988 
989 
990 //*************************************************************************************************
992 template< typename MT, bool SO >
993 struct RowExprTrait< SMatSerialExpr<MT,SO> >
994 {
995  public:
996  //**********************************************************************************************
997  typedef typename SerialExprTrait< typename RowExprTrait<const MT>::Type >::Type Type;
998  //**********************************************************************************************
999 };
1001 //*************************************************************************************************
1002 
1003 
1004 //*************************************************************************************************
1006 template< typename MT, bool SO >
1007 struct ColumnExprTrait< SMatSerialExpr<MT,SO> >
1008 {
1009  public:
1010  //**********************************************************************************************
1011  typedef typename SerialExprTrait< typename ColumnExprTrait<const MT>::Type >::Type Type;
1012  //**********************************************************************************************
1013 };
1015 //*************************************************************************************************
1016 
1017 } // namespace blaze
1018 
1019 #endif
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatSerialExpr.h:139
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
Header file for basic type definitions.
SMatSerialExpr(const MT &sm)
Constructor for the SMatSerialExpr class.
Definition: SMatSerialExpr.h:127
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:190
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:81
Header file for the ColumnExprTrait class template.
Header file for the IsColumnMajorMatrix type trait.
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type Operand
Composite data type of the sparse matrix expression.
Definition: SMatSerialExpr.h:114
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.
MT::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatSerialExpr.h:106
Header file for the IsUniLower type trait.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2584
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:117
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:201
Header file for the TSMatSerialExprTrait class template.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: SMatSerialExpr.h:255
Header file for the SparseMatrix base class.
MT::ResultType ResultType
Result type for expression template evaluations.
Definition: SMatSerialExpr.h:104
Constraint on the data type.
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
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
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatSerialExpr.h:170
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
Header file for the Columns type trait.
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SMatSerialExpr.h:233
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
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2585
Constraints on the storage order of matrix types.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: SMatSerialExpr.h:154
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
Header file for the SelectType class template.
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
MT::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatSerialExpr.h:105
EnableIf< IsDenseMatrix< MT1 > >::Type 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 SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2587
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type 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
Utility type for generic codes.
MT::ElementType ElementType
Resulting element type.
Definition: SMatSerialExpr.h:107
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SMatSerialExpr.h:245
Operand operand() const
Returns the sparse matrix operand.
Definition: SMatSerialExpr.h:211
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: SMatSerialExpr.h:108
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatSerialExpr.h:180
Header file for the IsRowMajorMatrix type trait.
EnableIf< IsDenseMatrix< MT1 > >::Type 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
#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
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
Header file for the IsTrue value trait.
Header file for the IsUpper type trait.
Header file for exception macros.
Expression object for the forced serial evaluation of sparse matrices.The SMatSerialExpr class repres...
Definition: Forward.h:105
Header file for the IsHermitian type trait.
EnableIf< IsDenseVector< VT1 > >::Type 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:189
#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:79
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.