Blaze  3.6
DMatDeclHermExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATDECLHERMEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATDECLHERMEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
45 #include <blaze/math/Aliases.h>
51 #include <blaze/math/Exception.h>
65 #include <blaze/util/Assert.h>
66 #include <blaze/util/DisableIf.h>
67 #include <blaze/util/EnableIf.h>
70 #include <blaze/util/InvalidType.h>
71 #include <blaze/util/mpl/If.h>
72 #include <blaze/util/Types.h>
74 
75 
76 namespace blaze {
77 
78 //=================================================================================================
79 //
80 // CLASS DMATDECLHERMEXPR
81 //
82 //=================================================================================================
83 
84 //*************************************************************************************************
91 template< typename MT // Type of the dense matrix
92  , bool SO > // Storage order
94  : public DeclHermExpr< DenseMatrix< DMatDeclHermExpr<MT,SO>, SO > >
95  , public Declaration<MT>
96 {
97  private:
98  //**Type definitions****************************************************************************
99  using RT = ResultType_t<MT>;
100 
102  BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT( GetConstIterator, ConstIterator, INVALID_TYPE );
103  //**********************************************************************************************
104 
105  //**Serial evaluation strategy******************************************************************
107 
113  static constexpr bool useAssign = RequiresEvaluation_v<MT>;
114 
116  template< typename MT2 >
118  static constexpr bool UseAssign_v = useAssign;
120  //**********************************************************************************************
121 
122  //**Parallel evaluation strategy****************************************************************
124 
130  template< typename MT2 >
131  static constexpr bool UseSMPAssign_v = ( MT2::smpAssignable && useAssign );
133  //**********************************************************************************************
134 
135  public:
136  //**Type definitions****************************************************************************
144 
147 
149  using ConstIterator = GetConstIterator_t<MT>;
150 
152  using Operand = If_t< IsExpression_v<MT>, const MT, const MT& >;
153  //**********************************************************************************************
154 
155  //**Compilation flags***************************************************************************
157  static constexpr bool simdEnabled = MT::simdEnabled;
158 
160  static constexpr bool smpAssignable = MT::smpAssignable;
161  //**********************************************************************************************
162 
163  //**SIMD properties*****************************************************************************
165  static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
166  //**********************************************************************************************
167 
168  //**Constructor*********************************************************************************
173  explicit inline DMatDeclHermExpr( const MT& dm ) noexcept
174  : dm_( dm ) // Dense matrix of the declherm expression
175  {
176  BLAZE_INTERNAL_ASSERT( isSquare( ~dm ), "Non-square matrix detected" );
177  }
178  //**********************************************************************************************
179 
180  //**Access operator*****************************************************************************
187  inline ReturnType operator()( size_t i, size_t j ) const {
188  BLAZE_INTERNAL_ASSERT( i < dm_.rows() , "Invalid row access index" );
189  BLAZE_INTERNAL_ASSERT( j < dm_.columns(), "Invalid column access index" );
190  return dm_(i,j);
191  }
192  //**********************************************************************************************
193 
194  //**At function*********************************************************************************
202  inline ReturnType at( size_t i, size_t j ) const {
203  if( i >= dm_.rows() ) {
204  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
205  }
206  if( j >= dm_.columns() ) {
207  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
208  }
209  return (*this)(i,j);
210  }
211  //**********************************************************************************************
212 
213  //**Load function*******************************************************************************
220  BLAZE_ALWAYS_INLINE auto load( size_t i, size_t j ) const noexcept {
221  BLAZE_INTERNAL_ASSERT( i < dm_.columns(), "Invalid row access index" );
222  BLAZE_INTERNAL_ASSERT( j < dm_.rows() , "Invalid column access index" );
223  BLAZE_INTERNAL_ASSERT( !SO || ( i % SIMDSIZE == 0UL ), "Invalid row access index" );
224  BLAZE_INTERNAL_ASSERT( SO || ( j % SIMDSIZE == 0UL ), "Invalid column access index" );
225  return dm_.load(i,j);
226  }
227  //**********************************************************************************************
228 
229  //**Low-level data access***********************************************************************
234  inline const ElementType* data() const noexcept {
235  return dm_.data();
236  }
237  //**********************************************************************************************
238 
239  //**Begin function******************************************************************************
245  inline ConstIterator begin( size_t i ) const {
246  return ConstIterator( dm_.begin(i) );
247  }
248  //**********************************************************************************************
249 
250  //**End function********************************************************************************
256  inline ConstIterator end( size_t i ) const {
257  return ConstIterator( dm_.end(i) );
258  }
259  //**********************************************************************************************
260 
261  //**Rows function*******************************************************************************
266  inline size_t rows() const noexcept {
267  return dm_.rows();
268  }
269  //**********************************************************************************************
270 
271  //**Columns function****************************************************************************
276  inline size_t columns() const noexcept {
277  return dm_.columns();
278  }
279  //**********************************************************************************************
280 
281  //**Operand access******************************************************************************
286  inline Operand operand() const noexcept {
287  return dm_;
288  }
289  //**********************************************************************************************
290 
291  //**********************************************************************************************
297  template< typename T >
298  inline bool canAlias( const T* alias ) const noexcept {
299  return dm_.canAlias( alias );
300  }
301  //**********************************************************************************************
302 
303  //**********************************************************************************************
309  template< typename T >
310  inline bool isAliased( const T* alias ) const noexcept {
311  return dm_.isAliased( alias );
312  }
313  //**********************************************************************************************
314 
315  //**********************************************************************************************
320  inline bool isAligned() const noexcept {
321  return dm_.isAligned();
322  }
323  //**********************************************************************************************
324 
325  //**********************************************************************************************
330  inline bool canSMPAssign() const noexcept {
331  return dm_.canSMPAssign();
332  }
333  //**********************************************************************************************
334 
335  private:
336  //**Member variables****************************************************************************
338  //**********************************************************************************************
339 
340  //**Assignment to dense matrices****************************************************************
352  template< typename MT2 // Type of the target dense matrix
353  , bool SO2 > // Storage order of the target dense matrix
354  friend inline auto assign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
356  {
358 
359  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
360  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
361 
362  assign( ~lhs, rhs.dm_ );
363  }
365  //**********************************************************************************************
366 
367  //**Assignment to sparse matrices***************************************************************
379  template< typename MT2 // Type of the target sparse matrix
380  , bool SO2 > // Storage order of the target dense matrix
381  friend inline auto assign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
383  {
385 
386  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
387  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
388 
389  assign( ~lhs, rhs.dm_ );
390  }
392  //**********************************************************************************************
393 
394  //**Addition assignment to dense matrices*******************************************************
406  template< typename MT2 // Type of the target dense matrix
407  , bool SO2 > // Storage order of the target dense matrix
408  friend inline auto addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
409  -> EnableIf_t< UseAssign_v<MT2> >
410  {
412 
413  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
414  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
415 
416  addAssign( ~lhs, rhs.dm_ );
417  }
419  //**********************************************************************************************
420 
421  //**Addition assignment to sparse matrices******************************************************
433  template< typename MT2 // Type of the target sparse matrix
434  , bool SO2 > // Storage order of the target dense matrix
435  friend inline auto addAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
436  -> EnableIf_t< UseAssign_v<MT2> >
437  {
439 
440  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
441  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
442 
443  addAssign( ~lhs, rhs.dm_ );
444  }
446  //**********************************************************************************************
447 
448  //**Subtraction assignment to dense matrices****************************************************
460  template< typename MT2 // Type of the target dense matrix
461  , bool SO2 > // Storage order of the target dense matrix
462  friend inline auto subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
463  -> EnableIf_t< UseAssign_v<MT2> >
464  {
466 
467  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
468  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
469 
470  subAssign( ~lhs, rhs.dm_ );
471  }
473  //**********************************************************************************************
474 
475  //**Subtraction assignment to sparse matrices***************************************************
487  template< typename MT2 // Type of the target sparse matrix
488  , bool SO2 > // Storage order of the target dense matrix
489  friend inline auto subAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
490  -> EnableIf_t< UseAssign_v<MT2> >
491  {
493 
494  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
495  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
496 
497  subAssign( ~lhs, rhs.dm_ );
498  }
500  //**********************************************************************************************
501 
502  //**Schur product assignment to dense matrices**************************************************
514  template< typename MT2 // Type of the target dense matrix
515  , bool SO2 > // Storage order of the target dense matrix
516  friend inline auto schurAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
517  -> EnableIf_t< UseAssign_v<MT2> >
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  schurAssign( ~lhs, rhs.dm_ );
525  }
527  //**********************************************************************************************
528 
529  //**Schur product assignment to sparse matrices*************************************************
541  template< typename MT2 // Type of the target sparse matrix
542  , bool SO2 > // Storage order of the target dense matrix
543  friend inline auto schurAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
544  -> EnableIf_t< UseAssign_v<MT2> >
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  schurAssign( ~lhs, rhs.dm_ );
552  }
554  //**********************************************************************************************
555 
556  //**Multiplication assignment to dense matrices*************************************************
568  template< typename MT2 // Type of the target dense matrix
569  , bool SO2 > // Storage order of the target dense matrix
570  friend inline auto multAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
571  -> EnableIf_t< UseAssign_v<MT2> >
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  multAssign( ~lhs, rhs.dm_ );
579  }
581  //**********************************************************************************************
582 
583  //**Multiplication assignment to sparse matrices************************************************
595  template< typename MT2 // Type of the target sparse matrix
596  , bool SO2 > // Storage order of the target dense matrix
597  friend inline auto multAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
598  -> EnableIf_t< UseAssign_v<MT2> >
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  multAssign( ~lhs, rhs.dm_ );
606  }
608  //**********************************************************************************************
609 
610  //**SMP assignment to dense matrices************************************************************
622  template< typename MT2 // Type of the target dense matrix
623  , bool SO2 > // Storage order of the target dense matrix
624  friend inline auto smpAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
625  -> EnableIf_t< UseSMPAssign_v<MT2> >
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  smpAssign( ~lhs, rhs.dm_ );
633  }
635  //**********************************************************************************************
636 
637  //**SMP assignment to sparse matrices***********************************************************
649  template< typename MT2 // Type of the target sparse matrix
650  , bool SO2 > // Storage order of the target dense matrix
651  friend inline auto smpAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
652  -> EnableIf_t< UseSMPAssign_v<MT2> >
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  smpAssign( ~lhs, rhs.dm_ );
660  }
662  //**********************************************************************************************
663 
664  //**SMP addition assignment to dense matrices***************************************************
676  template< typename MT2 // Type of the target dense matrix
677  , bool SO2 > // Storage order of the target dense matrix
678  friend inline auto smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
679  -> EnableIf_t< UseSMPAssign_v<MT2> >
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  smpAddAssign( ~lhs, rhs.dm_ );
687  }
689  //**********************************************************************************************
690 
691  //**SMP addition assignment to sparse matrices**************************************************
703  template< typename MT2 // Type of the target sparse matrix
704  , bool SO2 > // Storage order of the target dense matrix
705  friend inline auto smpAddAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
706  -> EnableIf_t< UseSMPAssign_v<MT2> >
707  {
709 
710  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
711  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
712 
713  smpAddAssign( ~lhs, rhs.dm_ );
714  }
716  //**********************************************************************************************
717 
718  //**SMP subtraction assignment to dense matrices************************************************
730  template< typename MT2 // Type of the target dense matrix
731  , bool SO2 > // Storage order of the target dense matrix
732  friend inline auto smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
733  -> EnableIf_t< UseSMPAssign_v<MT2> >
734  {
736 
737  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
738  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
739 
740  smpSubAssign( ~lhs, rhs.dm_ );
741  }
743  //**********************************************************************************************
744 
745  //**SMP subtraction assignment to sparse matrices***********************************************
757  template< typename MT2 // Type of the target sparse matrix
758  , bool SO2 > // Storage order of the target dense matrix
759  friend inline auto smpSubAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
760  -> EnableIf_t< UseSMPAssign_v<MT2> >
761  {
763 
764  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
765  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
766 
767  smpSubAssign( ~lhs, rhs.dm_ );
768  }
770  //**********************************************************************************************
771 
772  //**SMP Schur product assignment to dense matrices**********************************************
784  template< typename MT2 // Type of the target dense matrix
785  , bool SO2 > // Storage order of the target dense matrix
786  friend inline auto smpSchurAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
787  -> EnableIf_t< UseSMPAssign_v<MT2> >
788  {
790 
791  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
792  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
793 
794  smpSchurAssign( ~lhs, rhs.dm_ );
795  }
797  //**********************************************************************************************
798 
799  //**SMP Schur product assignment to sparse matrices*********************************************
811  template< typename MT2 // Type of the target sparse matrix
812  , bool SO2 > // Storage order of the target dense matrix
813  friend inline auto smpSchurAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
814  -> EnableIf_t< UseSMPAssign_v<MT2> >
815  {
817 
818  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
819  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
820 
821  smpSchurAssign( ~lhs, rhs.dm_ );
822  }
824  //**********************************************************************************************
825 
826  //**SMP multiplication assignment to dense matrices*********************************************
839  template< typename MT2 // Type of the target dense matrix
840  , bool SO2 > // Storage order of the target dense matrix
841  friend inline auto smpMultAssign( DenseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
842  -> EnableIf_t< UseSMPAssign_v<MT2> >
843  {
845 
846  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
847  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
848 
849  smpMultAssign( ~lhs, rhs.dm_ );
850  }
852  //**********************************************************************************************
853 
854  //**SMP multiplication assignment to sparse matrices********************************************
867  template< typename MT2 // Type of the target sparse matrix
868  , bool SO2 > // Storage order of the target dense matrix
869  friend inline auto smpMultAssign( SparseMatrix<MT2,SO2>& lhs, const DMatDeclHermExpr& rhs )
870  -> EnableIf_t< UseSMPAssign_v<MT2> >
871  {
873 
874  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
875  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
876 
877  smpMultAssign( ~lhs, rhs.dm_ );
878  }
880  //**********************************************************************************************
881 
882  //**Compile time checks*************************************************************************
890  //**********************************************************************************************
891 };
892 //*************************************************************************************************
893 
894 
895 
896 
897 //=================================================================================================
898 //
899 // GLOBAL FUNCTIONS
900 //
901 //=================================================================================================
902 
903 //*************************************************************************************************
914 template< typename MT // Type of the dense matrix
915  , bool SO // Storage order
916  , DisableIf_t< IsHermitian_v<MT> || IsUniTriangular_v<MT> >* = nullptr >
917 inline const DMatDeclHermExpr<MT,SO> declherm_backend( const DenseMatrix<MT,SO>& dm )
918 {
920 
921  BLAZE_INTERNAL_ASSERT( isSquare( ~dm ), "Non-square matrix detected" );
922 
923  return DMatDeclHermExpr<MT,SO>( ~dm );
924 }
926 //*************************************************************************************************
927 
928 
929 //*************************************************************************************************
940 template< typename MT // Type of the dense matrix
941  , bool SO // Storage order
942  , EnableIf_t< !IsHermitian_v<MT> && IsUniTriangular_v<MT> >* = nullptr >
943 inline const IdentityMatrix<ElementType_t<MT>,SO> declherm_backend( const DenseMatrix<MT,SO>& dm )
944 {
946 
947  BLAZE_INTERNAL_ASSERT( isSquare( ~dm ), "Non-square matrix detected" );
948 
949  return IdentityMatrix<ElementType_t<MT>,SO>( (~dm).rows() );
950 }
952 //*************************************************************************************************
953 
954 
955 //*************************************************************************************************
966 template< typename MT // Type of the dense matrix
967  , bool SO // Storage order
968  , EnableIf_t< IsHermitian_v<MT> >* = nullptr >
969 inline const MT& declherm_backend( const DenseMatrix<MT,SO>& dm )
970 {
972 
973  BLAZE_INTERNAL_ASSERT( isSquare( ~dm ), "Non-square matrix detected" );
974 
975  return ~dm;
976 }
978 //*************************************************************************************************
979 
980 
981 //*************************************************************************************************
1000 template< typename MT // Type of the dense matrix
1001  , bool SO > // Storage order
1002 inline decltype(auto) declherm( const DenseMatrix<MT,SO>& dm )
1003 {
1005 
1006  if( !isSquare( ~dm ) ) {
1007  BLAZE_THROW_INVALID_ARGUMENT( "Invalid Hermitian matrix specification" );
1008  }
1009 
1010  return declherm_backend( ~dm );
1011 }
1012 //*************************************************************************************************
1013 
1014 
1015 
1016 
1017 //=================================================================================================
1018 //
1019 // GLOBAL RESTRUCTURING FUNCTIONS
1020 //
1021 //=================================================================================================
1022 
1023 //*************************************************************************************************
1037 template< typename MT // Type of the left-hand side dense matrix
1038  , typename ST // Type of the right-hand side scalar value
1039  , bool SO // Storage order
1040  , DisableIf_t< IsHermitian_v<MT> >* = nullptr >
1041 inline decltype(auto) declherm( const DMatScalarMultExpr<MT,ST,SO>& dm )
1042 {
1044 
1045  if( !isSquare( ~dm ) ) {
1046  BLAZE_THROW_INVALID_ARGUMENT( "Invalid Hermitian matrix specification" );
1047  }
1048 
1049  return declherm( dm.leftOperand() ) * dm.rightOperand();
1050 }
1052 //*************************************************************************************************
1053 
1054 
1055 
1056 
1057 //=================================================================================================
1058 //
1059 // HASCONSTDATAACCESS SPECIALIZATIONS
1060 //
1061 //=================================================================================================
1062 
1063 //*************************************************************************************************
1065 template< typename MT, bool SO >
1066 struct HasConstDataAccess< DMatDeclHermExpr<MT,SO> >
1067  : public HasConstDataAccess<MT>
1068 {};
1070 //*************************************************************************************************
1071 
1072 
1073 
1074 
1075 //=================================================================================================
1076 //
1077 // ISALIGNED SPECIALIZATIONS
1078 //
1079 //=================================================================================================
1080 
1081 //*************************************************************************************************
1083 template< typename MT, bool SO >
1084 struct IsAligned< DMatDeclHermExpr<MT,SO> >
1085  : public IsAligned<MT>
1086 {};
1088 //*************************************************************************************************
1089 
1090 
1091 
1092 
1093 //=================================================================================================
1094 //
1095 // ISHERMITIAN SPECIALIZATIONS
1096 //
1097 //=================================================================================================
1098 
1099 //*************************************************************************************************
1101 template< typename MT, bool SO >
1102 struct IsHermitian< DMatDeclHermExpr<MT,SO> >
1103  : public TrueType
1104 {};
1106 //*************************************************************************************************
1107 
1108 } // namespace blaze
1109 
1110 #endif
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
static constexpr bool useAssign
Compilation switch for the serial evaluation strategy of the Hermitian declaration expression.
Definition: DMatDeclHermExpr.h:113
Header file for auxiliary alias declarations.
DeclHermTrait_t< RT > ResultType
Result type for expression template evaluations.
Definition: DMatDeclHermExpr.h:139
ElementType_t< MT > ElementType
Resulting element type.
Definition: DMatDeclHermExpr.h:142
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DMatDeclHermExpr.h:245
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DMatDeclHermExpr.h:330
Header file for basic type definitions.
Header file for all forward declarations for sparse vectors and matrices.
typename DeclHermTrait< MT >::Type DeclHermTrait_t
Auxiliary alias declaration for the DeclHermTrait type trait.The DeclHermTrait_t alias declaration pr...
Definition: DeclHermTrait.h:160
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DMatDeclHermExpr.h:276
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DMatDeclHermExpr.h:141
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias template for the If class template.The If_t alias template provides a convenient shor...
Definition: If.h:109
const ElementType * data() const noexcept
Low-level data access to the matrix elements.
Definition: DMatDeclHermExpr.h:234
Header file for the declherm trait.
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
#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
#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
Base class for all declaration expression templates.The Declaration class serves as a tag for all dec...
Definition: Declaration.h:70
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition: DMatDeclHermExpr.h:157
ResultType_t< MT > RT
Result type of the dense matrix expression.
Definition: DMatDeclHermExpr.h:99
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DMatDeclHermExpr.h:298
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower or upper unitriangular matrix ty...
Definition: UniTriangular.h:81
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: IntegralConstant.h:132
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatDeclHermExpr.h:320
Header file for the RequiresEvaluation type trait.
Base class for all declherm expression templates.The DeclHermExpr class serves as a tag for all expre...
Definition: DeclHermExpr.h:66
GetConstIterator_t< MT > ConstIterator
Iterator over the elements of the dense matrix.
Definition: DMatDeclHermExpr.h:149
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition: DMatDeclHermExpr.h:160
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.The ReturnType_t alias declaration provides ...
Definition: Aliases.h:410
Header file for the SIMD trait.
If_t< IsExpression_v< MT >, const MT, const MT & > Operand
Composite data type of the dense matrix expression.
Definition: DMatDeclHermExpr.h:152
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DMatDeclHermExpr.h:266
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes....
Definition: DenseMatrix.h:81
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes....
Definition: Forward.h:145
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DMatDeclHermExpr.h:256
Constraint on the data type.
Constraint on the data type.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Header file for the DisableIf class template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the DeclHermExpr base class.
Header file for the If class template.
#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.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatDeclHermExpr.h:187
Header file for the GetMemberType type trait.
Header file for the IsAligned type trait.
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatDeclHermExpr.h:140
#define BLAZE_CONSTRAINT_MUST_NOT_BE_MATMATMULTEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a matrix/matrix multiplication expressio...
Definition: MatMatMultExpr.h:83
Header file for the IsUniTriangular type trait.
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
ReturnType_t< MT > ReturnType
Return type for expression template evaluations.
Definition: DMatDeclHermExpr.h:143
Header file for the implementation of the base template of the HeritianMatrix.
Header file for the EnableIf class template.
Operand operand() const noexcept
Returns the dense matrix operand.
Definition: DMatDeclHermExpr.h:286
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.The OppositeType_t alias declaration provi...
Definition: Aliases.h:270
BLAZE_ALWAYS_INLINE auto load(size_t i, size_t j) const noexcept
Access to the SIMD elements of the matrix.
Definition: DMatDeclHermExpr.h:220
Constraint on the data type.
Header file for the HasConstDataAccess type trait.
Header file for the Declaration base class.
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: DMatDeclHermExpr.h:165
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.The TransposeType_t alias declaration pro...
Definition: Aliases.h:470
Header file for run time assertion macros.
Utility type for generic codes.
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:295
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
Header file for all forward declarations for expression class templates.
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
auto smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:194
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: DMatDeclHermExpr.h:202
decltype(auto) declherm(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as Hermitian.
Definition: DMatDeclHermExpr.h:1002
If_t< RequiresEvaluation_v< MT >, const ResultType, const DMatDeclHermExpr & > CompositeType
Data type for composite expression templates.
Definition: DMatDeclHermExpr.h:146
Expression object for the explicit Hermitian declaration of dense matrices.The DMatDeclHermExpr class...
Definition: DMatDeclHermExpr.h:93
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
Header file for the IntegralConstant class template.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DMatDeclHermExpr.h:310
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type,...
Definition: Hermitian.h:79
BLAZE_CREATE_GET_TYPE_MEMBER_TYPE_TRAIT(GetConstIterator, ConstIterator, INVALID_TYPE)
Definition of the GetConstIterator type trait.
Constraint on the data type.
Header file for the IsHermitian type trait.
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:951
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
Definition: Assert.h:101
Operand dm_
Dense matrix of the declherm expression.
Definition: DMatDeclHermExpr.h:337
auto smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP multiplication assignment of a vector to a dense vector.
Definition: DenseVector.h:191
DMatDeclHermExpr(const MT &dm) noexcept
Constructor for the DMatDeclHermExpr class.
Definition: DMatDeclHermExpr.h:173
Header file for the IsExpression type trait class.
Header file for the function trace functionality.