DMatEvalExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATEVALEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATEVALEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
46 #include <blaze/math/Exception.h>
72 #include <blaze/util/Assert.h>
75 #include <blaze/util/InvalidType.h>
76 #include <blaze/util/mpl/And.h>
77 #include <blaze/util/mpl/If.h>
78 #include <blaze/util/Types.h>
79 
80 
81 namespace blaze {
82 
83 //=================================================================================================
84 //
85 // CLASS DMATEVALEXPR
86 //
87 //=================================================================================================
88 
89 //*************************************************************************************************
96 template< typename MT // Type of the dense matrix
97  , bool SO > // Storage order
98 class DMatEvalExpr : public DenseMatrix< DMatEvalExpr<MT,SO>, SO >
99  , private MatEvalExpr
100  , private Computation
101 {
102  public:
103  //**Type definitions****************************************************************************
110 
112  typedef const ResultType CompositeType;
113 
115  typedef If_< IsExpression<MT>, const MT, const MT& > Operand;
116  //**********************************************************************************************
117 
118  //**Compilation flags***************************************************************************
120  enum : bool { simdEnabled = false };
121 
123  enum : bool { smpAssignable = MT::smpAssignable };
124  //**********************************************************************************************
125 
126  //**Constructor*********************************************************************************
131  explicit inline DMatEvalExpr( const MT& dm ) noexcept
132  : dm_( dm ) // Dense matrix of the evaluation expression
133  {}
134  //**********************************************************************************************
135 
136  //**Access operator*****************************************************************************
143  inline ReturnType operator()( size_t i, size_t j ) const {
144  BLAZE_INTERNAL_ASSERT( i < dm_.rows() , "Invalid row access index" );
145  BLAZE_INTERNAL_ASSERT( j < dm_.columns(), "Invalid column access index" );
146  return dm_(i,j);
147  }
148  //**********************************************************************************************
149 
150  //**At function*********************************************************************************
158  inline ReturnType at( size_t i, size_t j ) const {
159  if( i >= dm_.rows() ) {
160  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
161  }
162  if( j >= dm_.columns() ) {
163  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
164  }
165  return (*this)(i,j);
166  }
167  //**********************************************************************************************
168 
169  //**Rows function*******************************************************************************
174  inline size_t rows() const noexcept {
175  return dm_.rows();
176  }
177  //**********************************************************************************************
178 
179  //**Columns function****************************************************************************
184  inline size_t columns() const noexcept {
185  return dm_.columns();
186  }
187  //**********************************************************************************************
188 
189  //**Operand access******************************************************************************
194  inline Operand operand() const noexcept {
195  return dm_;
196  }
197  //**********************************************************************************************
198 
199  //**********************************************************************************************
205  template< typename T >
206  inline bool canAlias( const T* alias ) const noexcept {
207  return dm_.canAlias( alias );
208  }
209  //**********************************************************************************************
210 
211  //**********************************************************************************************
217  template< typename T >
218  inline bool isAliased( const T* alias ) const noexcept {
219  return dm_.isAliased( alias );
220  }
221  //**********************************************************************************************
222 
223  //**********************************************************************************************
228  inline bool isAligned() const noexcept {
229  return dm_.isAligned();
230  }
231  //**********************************************************************************************
232 
233  //**********************************************************************************************
238  inline bool canSMPAssign() const noexcept {
239  return dm_.canSMPAssign();
240  }
241  //**********************************************************************************************
242 
243  private:
244  //**Member variables****************************************************************************
245  Operand dm_;
246  //**********************************************************************************************
247 
248  //**Assignment to dense matrices****************************************************************
260  template< typename MT2 // Type of the target dense matrix
261  , bool SO2 > // Storage order of the target dense matrix
262  friend inline void assign( DenseMatrix<MT2,SO2>& lhs, const DMatEvalExpr& rhs )
263  {
265 
266  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
267  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
268 
269  assign( ~lhs, rhs.dm_ );
270  }
272  //**********************************************************************************************
273 
274  //**Assignment to sparse matrices***************************************************************
286  template< typename MT2 // Type of the target sparse matrix
287  , bool SO2 > // Storage order of the target dense matrix
288  friend inline void assign( SparseMatrix<MT2,SO2>& lhs, const DMatEvalExpr& rhs )
289  {
291 
292  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
293  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
294 
295  assign( ~lhs, rhs.dm_ );
296  }
298  //**********************************************************************************************
299 
300  //**Addition assignment to dense matrices*******************************************************
312  template< typename MT2 // Type of the target dense matrix
313  , bool SO2 > // Storage order of the target dense matrix
314  friend inline void addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatEvalExpr& rhs )
315  {
317 
318  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
319  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
320 
321  addAssign( ~lhs, rhs.dm_ );
322  }
324  //**********************************************************************************************
325 
326  //**Addition assignment to sparse matrices******************************************************
338  template< typename MT2 // Type of the target sparse matrix
339  , bool SO2 > // Storage order of the target dense matrix
340  friend inline void addAssign( SparseMatrix<MT2,SO2>& lhs, const DMatEvalExpr& rhs )
341  {
343 
344  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
345  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
346 
347  addAssign( ~lhs, rhs.dm_ );
348  }
350  //**********************************************************************************************
351 
352  //**Subtraction assignment to dense matrices****************************************************
364  template< typename MT2 // Type of the target dense matrix
365  , bool SO2 > // Storage order of the target dense matrix
366  friend inline void subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatEvalExpr& rhs )
367  {
369 
370  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
371  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
372 
373  subAssign( ~lhs, rhs.dm_ );
374  }
376  //**********************************************************************************************
377 
378  //**Subtraction assignment to sparse matrices***************************************************
390  template< typename MT2 // Type of the target sparse matrix
391  , bool SO2 > // Storage order of the target dense matrix
392  friend inline void subAssign( SparseMatrix<MT2,SO2>& lhs, const DMatEvalExpr& rhs )
393  {
395 
396  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
397  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
398 
399  subAssign( ~lhs, rhs.dm_ );
400  }
402  //**********************************************************************************************
403 
404  //**Multiplication assignment to dense matrices*************************************************
416  template< typename MT2 // Type of the target dense matrix
417  , bool SO2 > // Storage order of the target dense matrix
418  friend inline void multAssign( DenseMatrix<MT2,SO2>& lhs, const DMatEvalExpr& rhs )
419  {
421 
422  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
423  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
424 
425  multAssign( ~lhs, rhs.dm_ );
426  }
428  //**********************************************************************************************
429 
430  //**Multiplication assignment to sparse matrices************************************************
442  template< typename MT2 // Type of the target sparse matrix
443  , bool SO2 > // Storage order of the target dense matrix
444  friend inline void multAssign( SparseMatrix<MT2,SO2>& lhs, const DMatEvalExpr& rhs )
445  {
447 
448  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
449  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
450 
451  multAssign( ~lhs, rhs.dm_ );
452  }
454  //**********************************************************************************************
455 
456  //**SMP assignment to dense matrices************************************************************
468  template< typename MT2 // Type of the target dense matrix
469  , bool SO2 > // Storage order of the target dense matrix
470  friend inline void smpAssign( DenseMatrix<MT2,SO2>& lhs, const DMatEvalExpr& rhs )
471  {
473 
474  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
475  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
476 
477  smpAssign( ~lhs, rhs.dm_ );
478  }
480  //**********************************************************************************************
481 
482  //**SMP assignment to sparse matrices***********************************************************
494  template< typename MT2 // Type of the target sparse matrix
495  , bool SO2 > // Storage order of the target dense matrix
496  friend inline void smpAssign( SparseMatrix<MT2,SO2>& lhs, const DMatEvalExpr& rhs )
497  {
499 
500  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
501  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
502 
503  smpAssign( ~lhs, rhs.dm_ );
504  }
506  //**********************************************************************************************
507 
508  //**SMP addition assignment to dense matrices***************************************************
520  template< typename MT2 // Type of the target dense matrix
521  , bool SO2 > // Storage order of the target dense matrix
522  friend inline void smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const DMatEvalExpr& rhs )
523  {
525 
526  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
527  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
528 
529  smpAddAssign( ~lhs, rhs.dm_ );
530  }
532  //**********************************************************************************************
533 
534  //**SMP addition assignment to sparse matrices**************************************************
546  template< typename MT2 // Type of the target sparse matrix
547  , bool SO2 > // Storage order of the target dense matrix
548  friend inline void smpAddAssign( SparseMatrix<MT2,SO2>& lhs, const DMatEvalExpr& rhs )
549  {
551 
552  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
553  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
554 
555  smpAddAssign( ~lhs, rhs.dm_ );
556  }
558  //**********************************************************************************************
559 
560  //**SMP subtraction assignment to dense matrices************************************************
572  template< typename MT2 // Type of the target dense matrix
573  , bool SO2 > // Storage order of the target dense matrix
574  friend inline void smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const DMatEvalExpr& rhs )
575  {
577 
578  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
579  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
580 
581  smpSubAssign( ~lhs, rhs.dm_ );
582  }
584  //**********************************************************************************************
585 
586  //**SMP subtraction assignment to sparse matrices***********************************************
598  template< typename MT2 // Type of the target sparse matrix
599  , bool SO2 > // Storage order of the target dense matrix
600  friend inline void smpSubAssign( SparseMatrix<MT2,SO2>& lhs, const DMatEvalExpr& 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  smpSubAssign( ~lhs, rhs.dm_ );
608  }
610  //**********************************************************************************************
611 
612  //**SMP multiplication assignment to dense matrices*********************************************
625  template< typename MT2 // Type of the target dense matrix
626  , bool SO2 > // Storage order of the target dense matrix
627  friend inline void smpMultAssign( DenseMatrix<MT2,SO2>& lhs, const DMatEvalExpr& 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  smpMultAssign( ~lhs, rhs.dm_ );
635  }
637  //**********************************************************************************************
638 
639  //**SMP multiplication assignment to sparse matrices********************************************
652  template< typename MT2 // Type of the target sparse matrix
653  , bool SO2 > // Storage order of the target dense matrix
654  friend inline void smpMultAssign( SparseMatrix<MT2,SO2>& lhs, const DMatEvalExpr& 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  smpMultAssign( ~lhs, rhs.dm_ );
662  }
664  //**********************************************************************************************
665 
666  //**Compile time checks*************************************************************************
671  //**********************************************************************************************
672 };
673 //*************************************************************************************************
674 
675 
676 
677 
678 //=================================================================================================
679 //
680 // GLOBAL FUNCTIONS
681 //
682 //=================================================================================================
683 
684 //*************************************************************************************************
701 template< typename MT // Type of the dense matrix
702  , bool SO > // Storage order
703 inline const DMatEvalExpr<MT,SO> eval( const DenseMatrix<MT,SO>& dm )
704 {
706 
707  return DMatEvalExpr<MT,SO>( ~dm );
708 }
709 //*************************************************************************************************
710 
711 
712 
713 
714 //=================================================================================================
715 //
716 // GLOBAL RESTRUCTURING FUNCTIONS
717 //
718 //=================================================================================================
719 
720 //*************************************************************************************************
731 template< typename MT // Type of the dense matrix
732  , bool SO > // Storage order
733 inline const DMatEvalExpr<MT,SO> eval( const DMatEvalExpr<MT,SO>& dm )
734 {
735  return dm;
736 }
738 //*************************************************************************************************
739 
740 
741 
742 
743 //=================================================================================================
744 //
745 // ROWS SPECIALIZATIONS
746 //
747 //=================================================================================================
748 
749 //*************************************************************************************************
751 template< typename MT, bool SO >
752 struct Rows< DMatEvalExpr<MT,SO> > : public Rows<MT>
753 {};
755 //*************************************************************************************************
756 
757 
758 
759 
760 //=================================================================================================
761 //
762 // COLUMNS SPECIALIZATIONS
763 //
764 //=================================================================================================
765 
766 //*************************************************************************************************
768 template< typename MT, bool SO >
769 struct Columns< DMatEvalExpr<MT,SO> > : public Columns<MT>
770 {};
772 //*************************************************************************************************
773 
774 
775 
776 
777 //=================================================================================================
778 //
779 // ISALIGNED SPECIALIZATIONS
780 //
781 //=================================================================================================
782 
783 //*************************************************************************************************
785 template< typename MT, bool SO >
786 struct IsAligned< DMatEvalExpr<MT,SO> >
787  : public BoolConstant< IsAligned<MT>::value >
788 {};
790 //*************************************************************************************************
791 
792 
793 
794 
795 //=================================================================================================
796 //
797 // ISSYMMETRIC SPECIALIZATIONS
798 //
799 //=================================================================================================
800 
801 //*************************************************************************************************
803 template< typename MT, bool SO >
804 struct IsSymmetric< DMatEvalExpr<MT,SO> >
805  : public BoolConstant< IsSymmetric<MT>::value >
806 {};
808 //*************************************************************************************************
809 
810 
811 
812 
813 //=================================================================================================
814 //
815 // ISHERMITIAN SPECIALIZATIONS
816 //
817 //=================================================================================================
818 
819 //*************************************************************************************************
821 template< typename MT, bool SO >
822 struct IsHermitian< DMatEvalExpr<MT,SO> >
823  : public BoolConstant< IsHermitian<MT>::value >
824 {};
826 //*************************************************************************************************
827 
828 
829 
830 
831 //=================================================================================================
832 //
833 // ISLOWER SPECIALIZATIONS
834 //
835 //=================================================================================================
836 
837 //*************************************************************************************************
839 template< typename MT, bool SO >
840 struct IsLower< DMatEvalExpr<MT,SO> >
841  : public BoolConstant< IsLower<MT>::value >
842 {};
844 //*************************************************************************************************
845 
846 
847 
848 
849 //=================================================================================================
850 //
851 // ISUNILOWER SPECIALIZATIONS
852 //
853 //=================================================================================================
854 
855 //*************************************************************************************************
857 template< typename MT, bool SO >
858 struct IsUniLower< DMatEvalExpr<MT,SO> >
859  : public BoolConstant< IsUniLower<MT>::value >
860 {};
862 //*************************************************************************************************
863 
864 
865 
866 
867 //=================================================================================================
868 //
869 // ISSTRICTLYLOWER SPECIALIZATIONS
870 //
871 //=================================================================================================
872 
873 //*************************************************************************************************
875 template< typename MT, bool SO >
876 struct IsStrictlyLower< DMatEvalExpr<MT,SO> >
877  : public BoolConstant< IsStrictlyLower<MT>::value >
878 {};
880 //*************************************************************************************************
881 
882 
883 
884 
885 //=================================================================================================
886 //
887 // ISUPPER SPECIALIZATIONS
888 //
889 //=================================================================================================
890 
891 //*************************************************************************************************
893 template< typename MT, bool SO >
894 struct IsUpper< DMatEvalExpr<MT,SO> >
895  : public BoolConstant< IsUpper<MT>::value >
896 {};
898 //*************************************************************************************************
899 
900 
901 
902 
903 //=================================================================================================
904 //
905 // ISUNIUPPER SPECIALIZATIONS
906 //
907 //=================================================================================================
908 
909 //*************************************************************************************************
911 template< typename MT, bool SO >
912 struct IsUniUpper< DMatEvalExpr<MT,SO> >
913  : public BoolConstant< 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< DMatEvalExpr<MT,SO> >
931  : public BoolConstant< IsStrictlyUpper<MT>::value >
932 {};
934 //*************************************************************************************************
935 
936 
937 
938 
939 //=================================================================================================
940 //
941 // EXPRESSION TRAIT SPECIALIZATIONS
942 //
943 //=================================================================================================
944 
945 //*************************************************************************************************
947 template< typename MT >
948 struct DMatEvalExprTrait< DMatEvalExpr<MT,false> >
949 {
950  public:
951  //**********************************************************************************************
954  , INVALID_TYPE >;
955  //**********************************************************************************************
956 };
958 //*************************************************************************************************
959 
960 
961 //*************************************************************************************************
963 template< typename MT >
964 struct TDMatEvalExprTrait< DMatEvalExpr<MT,true> >
965 {
966  public:
967  //**********************************************************************************************
970  , INVALID_TYPE >;
971  //**********************************************************************************************
972 };
974 //*************************************************************************************************
975 
976 
977 //*************************************************************************************************
979 template< typename MT, bool SO, bool AF >
980 struct SubmatrixExprTrait< DMatEvalExpr<MT,SO>, AF >
981 {
982  public:
983  //**********************************************************************************************
985  //**********************************************************************************************
986 };
988 //*************************************************************************************************
989 
990 
991 //*************************************************************************************************
993 template< typename MT, bool SO >
994 struct RowExprTrait< DMatEvalExpr<MT,SO> >
995 {
996  public:
997  //**********************************************************************************************
999  //**********************************************************************************************
1000 };
1002 //*************************************************************************************************
1003 
1004 
1005 //*************************************************************************************************
1007 template< typename MT, bool SO >
1008 struct ColumnExprTrait< DMatEvalExpr<MT,SO> >
1009 {
1010  public:
1011  //**********************************************************************************************
1013  //**********************************************************************************************
1014 };
1016 //*************************************************************************************************
1017 
1018 } // namespace blaze
1019 
1020 #endif
DMatEvalExpr(const MT &dm) noexcept
Constructor for the DMatEvalExpr class.
Definition: DMatEvalExpr.h:131
Header file for auxiliary alias declarations.
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
Header file for basic type definitions.
Header file for the DMatEvalExprTrait 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
#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
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
Header file for the ColumnExprTrait class template.
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatEvalExpr.h:158
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
Header file for the MatEvalExpr base class.
Header file for the Computation base class.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatEvalExpr.h:238
typename EvalExprTrait< T >::Type EvalExprTrait_
Auxiliary alias declaration for the EvalExprTrait class template.The EvalExprTrait_ alias declaration...
Definition: EvalExprTrait.h:142
Operand operand() const noexcept
Returns the dense matrix operand.
Definition: DMatEvalExpr.h:194
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
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
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
OppositeType_< MT > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatEvalExpr.h:106
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
Constraint on the data type.
DMatEvalExpr< MT, SO > This
Type of this DMatEvalExpr instance.
Definition: DMatEvalExpr.h:104
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
ReturnType_< MT > ReturnType
Return type for expression template evaluations.
Definition: DMatEvalExpr.h:109
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
Evaluation of the expression type of a dense matrix evaluation operation.Via this type trait it is po...
Definition: DMatEvalExprTrait.h:74
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatEvalExpr.h:228
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
If_< IsExpression< MT >, const MT, const MT &> Operand
Composite data type of the dense matrix expression.
Definition: DMatEvalExpr.h:115
TransposeType_< MT > TransposeType
Transpose type for expression template evaluations.
Definition: DMatEvalExpr.h:107
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatEvalExpr.h:143
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
Header file for the DenseMatrix base class.
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
const ResultType CompositeType
Data type for composite expression templates.
Definition: DMatEvalExpr.h:112
Evaluation of the expression type type of a submatrix operation.Via this type trait it is possible to...
Definition: SubmatrixExprTrait.h:80
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatEvalExpr.h:206
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
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.
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatEvalExpr.h:174
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 IsDenseMatrix type trait.
Header file for the IsStrictlyLower type trait.
Operand dm_
Dense matrix of the evaluation expression.
Definition: DMatEvalExpr.h:245
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:86
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatEvalExpr.h:184
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.
Header file for the EvalExprTrait class template.
Evaluation of the expression type of a dense matrix evaluation operation.Via this type trait it is po...
Definition: TDMatEvalExprTrait.h:74
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
Base class for all matrix evaluation expression templates.The MatEvalExpr class serves as a tag for a...
Definition: MatEvalExpr.h:65
#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
const DMatEvalExpr< MT, SO > eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:703
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatEvalExpr.h:218
Header file for the IsRowMajorMatrix type trait.
Expression object for the forced evaluation of dense matrices.The DMatEvalExpr class represents the c...
Definition: DMatEvalExpr.h:98
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
ResultType_< MT > ResultType
Result type for expression template evaluations.
Definition: DMatEvalExpr.h:105
Header file for the TDMatEvalExprTrait class template.
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
ElementType_< MT > ElementType
Resulting element type.
Definition: DMatEvalExpr.h:108
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.
Header file for the IsHermitian type trait.
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
Header file for the IsExpression type trait class.
Header file for the function trace functionality.