HermitianMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
49 #include <blaze/math/Exception.h>
50 #include <blaze/math/Forward.h>
87 #include <blaze/util/Assert.h>
88 #include <blaze/util/EnableIf.h>
90 #include <blaze/util/mpl/If.h>
91 #include <blaze/util/TrueType.h>
94 #include <blaze/util/Unused.h>
95 
96 
97 namespace blaze {
98 
99 //=================================================================================================
100 //
101 // HERMITIANMATRIX OPERATORS
102 //
103 //=================================================================================================
104 
105 //*************************************************************************************************
108 template< typename MT, bool SO, bool DF >
109 inline void reset( HermitianMatrix<MT,SO,DF>& m );
110 
111 template< typename MT, bool SO, bool DF >
112 inline void reset( HermitianMatrix<MT,SO,DF>& m, size_t i );
113 
114 template< typename MT, bool SO, bool DF >
115 inline void clear( HermitianMatrix<MT,SO,DF>& m );
116 
117 template< bool RF, typename MT, bool SO, bool DF >
118 inline bool isDefault( const HermitianMatrix<MT,SO,DF>& m );
119 
120 template< typename MT, bool SO, bool DF >
121 inline bool isIntact( const HermitianMatrix<MT,SO,DF>& m );
122 
123 template< typename MT, bool SO, bool DF >
124 inline void swap( HermitianMatrix<MT,SO,DF>& a, HermitianMatrix<MT,SO,DF>& b ) noexcept;
126 //*************************************************************************************************
127 
128 
129 //*************************************************************************************************
136 template< typename MT // Type of the adapted matrix
137  , bool SO // Storage order of the adapted matrix
138  , bool DF > // Density flag
140 {
141  m.reset();
142 }
143 //*************************************************************************************************
144 
145 
146 //*************************************************************************************************
159 template< typename MT // Type of the adapted matrix
160  , bool SO // Storage order of the adapted matrix
161  , bool DF > // Density flag
162 inline void reset( HermitianMatrix<MT,SO,DF>& m, size_t i )
163 {
164  m.reset( i );
165 }
166 //*************************************************************************************************
167 
168 
169 //*************************************************************************************************
176 template< typename MT // Type of the adapted matrix
177  , bool SO // Storage order of the adapted matrix
178  , bool DF > // Density flag
180 {
181  m.clear();
182 }
183 //*************************************************************************************************
184 
185 
186 //*************************************************************************************************
211 template< bool RF // Relaxation flag
212  , typename MT // Type of the adapted matrix
213  , bool SO // Storage order of the adapted matrix
214  , bool DF > // Density flag
215 inline bool isDefault( const HermitianMatrix<MT,SO,DF>& m )
216 {
217  return isDefault<RF>( m.matrix_ );
218 }
219 //*************************************************************************************************
220 
221 
222 //*************************************************************************************************
243 template< typename MT // Type of the adapted matrix
244  , bool SO // Storage order of the adapted matrix
245  , bool DF > // Density flag
246 inline bool isIntact( const HermitianMatrix<MT,SO,DF>& m )
247 {
248  return m.isIntact();
249 }
250 //*************************************************************************************************
251 
252 
253 //*************************************************************************************************
261 template< typename MT // Type of the adapted matrix
262  , bool SO // Storage order of the adapted matrix
263  , bool DF > // Density flag
265 {
266  a.swap( b );
267 }
268 //*************************************************************************************************
269 
270 
271 //*************************************************************************************************
294 template< InversionFlag IF // Inversion algorithm
295  , typename MT // Type of the dense matrix
296  , bool SO > // Storage order of the dense matrix
297 inline void invert( HermitianMatrix<MT,SO,true>& m )
298 {
300 
301  if( IF == asUniLower || IF == asUniUpper ) {
302  BLAZE_INTERNAL_ASSERT( isIdentity( m ), "Violation of preconditions detected" );
303  return;
304  }
305 
306  constexpr InversionFlag flag( ( IF == byLU || IF == byLDLT || IF == byLDLH ||
307  IF == asGeneral || IF == asSymmetric || IF == asHermitian )
308  ? ( byLDLH )
309  : ( ( IF == byLLH )
310  ?( byLLH )
311  :( asDiagonal ) ) );
312 
313  MT tmp( m.matrix_ );
314  invert<flag>( tmp );
315  m.matrix_ = std::move( tmp );
316 
317  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
318 }
320 //*************************************************************************************************
321 
322 
323 //*************************************************************************************************
339 template< typename MT // Type of the adapted matrix
340  , bool SO // Storage order of the adapted matrix
341  , bool DF // Density flag
342  , typename VT > // Type of the right-hand side vector
343 inline bool tryAssign( const HermitianMatrix<MT,SO,DF>& lhs,
344  const Vector<VT,false>& rhs, size_t row, size_t column )
345 {
347 
348  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
349  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
350  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
351 
352  UNUSED_PARAMETER( lhs );
353 
355 
356  return ( IsBuiltin<ET>::value ||
357  column < row ||
358  (~rhs).size() <= column - row ||
359  isReal( (~rhs)[column-row] ) );
360 
361  return true;
362 }
364 //*************************************************************************************************
365 
366 
367 //*************************************************************************************************
383 template< typename MT // Type of the adapted matrix
384  , bool SO // Storage order of the adapted matrix
385  , bool DF // Density flag
386  , typename VT > // Type of the right-hand side vector
387 inline bool tryAssign( const HermitianMatrix<MT,SO,DF>& lhs,
388  const Vector<VT,true>& rhs, size_t row, size_t column )
389 {
391 
392  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
393  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
394  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
395 
396  UNUSED_PARAMETER( lhs );
397 
399 
400  return ( IsBuiltin<ET>::value ||
401  row < column ||
402  (~rhs).size() <= row - column ||
403  isReal( (~rhs)[row-column] ) );
404 
405  return true;
406 }
408 //*************************************************************************************************
409 
410 
411 //*************************************************************************************************
427 template< typename MT1 // Type of the adapted matrix
428  , bool SO1 // Storage order of the adapted matrix
429  , bool DF // Density flag
430  , typename MT2 // Type of the right-hand side matrix
431  , bool SO2 > // Storage order of the right-hand side matrix
432 inline bool tryAssign( const HermitianMatrix<MT1,SO1,DF>& lhs,
433  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
434 {
436 
437  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
438  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
439  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
440  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
441 
442  UNUSED_PARAMETER( lhs );
443 
444  const size_t M( (~rhs).rows() );
445  const size_t N( (~rhs).columns() );
446 
447  if( ( row + M <= column ) || ( column + N <= row ) )
448  return true;
449 
450  const bool lower( row > column );
451  const size_t size ( min( row + M, column + N ) - ( lower ? row : column ) );
452 
453  if( size < 2UL )
454  return true;
455 
456  const size_t subrow( lower ? 0UL : column - row );
457  const size_t subcol( lower ? row - column : 0UL );
458 
459  return isHermitian( submatrix( ~rhs, subrow, subcol, size, size ) );
460 }
462 //*************************************************************************************************
463 
464 
465 //*************************************************************************************************
481 template< typename MT // Type of the adapted matrix
482  , bool SO // Storage order of the adapted matrix
483  , bool DF // Density flag
484  , typename VT // Type of the right-hand side vector
485  , bool TF > // Transpose flag of the right-hand side vector
486 inline bool tryAddAssign( const HermitianMatrix<MT,SO,DF>& lhs,
487  const Vector<VT,TF>& rhs, size_t row, size_t column )
488 {
489  return tryAssign( lhs, ~rhs, row, column );
490 }
492 //*************************************************************************************************
493 
494 
495 //*************************************************************************************************
511 template< typename MT1 // Type of the adapted matrix
512  , bool SO1 // Storage order of the adapted matrix
513  , bool DF // Density flag
514  , typename MT2 // Type of the right-hand side matrix
515  , bool SO2 > // Storage order of the right-hand side matrix
516 inline bool tryAddAssign( const HermitianMatrix<MT1,SO1,DF>& lhs,
517  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
518 {
519  return tryAssign( lhs, ~rhs, row, column );
520 }
522 //*************************************************************************************************
523 
524 
525 //*************************************************************************************************
542 template< typename MT // Type of the adapted matrix
543  , bool SO // Storage order of the adapted matrix
544  , bool DF // Density flag
545  , typename VT // Type of the right-hand side vector
546  , bool TF > // Transpose flag of the right-hand side vector
547 inline bool trySubAssign( const HermitianMatrix<MT,SO,DF>& lhs,
548  const Vector<VT,TF>& rhs, size_t row, size_t column )
549 {
550  return tryAssign( lhs, ~rhs, row, column );
551 }
553 //*************************************************************************************************
554 
555 
556 //*************************************************************************************************
573 template< typename MT1 // Type of the adapted matrix
574  , bool SO1 // Storage order of the adapted matrix
575  , bool DF // Density flag
576  , typename MT2 // Type of the right-hand side matrix
577  , bool SO2 > // Storage order of the right-hand side matrix
578 inline bool trySubAssign( const HermitianMatrix<MT1,SO1,DF>& lhs,
579  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
580 {
581  return tryAssign( lhs, ~rhs, row, column );
582 }
584 //*************************************************************************************************
585 
586 
587 //*************************************************************************************************
604 template< typename MT // Type of the adapted matrix
605  , bool SO // Storage order of the adapted matrix
606  , bool DF // Density flag
607  , typename VT // Type of the right-hand side vector
608  , bool TF > // Transpose flag of the right-hand side vector
609 inline bool tryMultAssign( const HermitianMatrix<MT,SO,DF>& lhs,
610  const Vector<VT,TF>& rhs, size_t row, size_t column )
611 {
612  return tryAssign( lhs, ~rhs, row, column );
613 }
615 //*************************************************************************************************
616 
617 
618 //*************************************************************************************************
635 template< typename MT1 // Type of the adapted matrix
636  , bool SO1 // Storage order of the adapted matrix
637  , bool DF // Density flag
638  , typename MT2 // Type of the right-hand side matrix
639  , bool SO2 > // Storage order of the right-hand side matrix
640 inline bool trySchurAssign( const HermitianMatrix<MT1,SO1,DF>& lhs,
641  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
642 {
643  return tryAssign( lhs, ~rhs, row, column );
644 }
646 //*************************************************************************************************
647 
648 
649 //*************************************************************************************************
665 template< typename MT // Type of the adapted matrix
666  , bool SO // Storage order of the adapted matrix
667  , bool DF // Density flag
668  , typename VT // Type of the right-hand side vector
669  , bool TF > // Transpose flag of the right-hand side vector
670 inline bool tryDivAssign( const HermitianMatrix<MT,SO,DF>& lhs,
671  const Vector<VT,TF>& rhs, size_t row, size_t column )
672 {
673  return tryAssign( lhs, ~rhs, row, column );
674 }
676 //*************************************************************************************************
677 
678 
679 
680 
681 //=================================================================================================
682 //
683 // ROWS SPECIALIZATIONS
684 //
685 //=================================================================================================
686 
687 //*************************************************************************************************
689 template< typename MT, bool SO, bool DF >
690 struct Rows< HermitianMatrix<MT,SO,DF> >
691  : public Rows<MT>
692 {};
694 //*************************************************************************************************
695 
696 
697 
698 
699 //=================================================================================================
700 //
701 // COLUMNS SPECIALIZATIONS
702 //
703 //=================================================================================================
704 
705 //*************************************************************************************************
707 template< typename MT, bool SO, bool DF >
708 struct Columns< HermitianMatrix<MT,SO,DF> >
709  : public Columns<MT>
710 {};
712 //*************************************************************************************************
713 
714 
715 
716 
717 //=================================================================================================
718 //
719 // ISSQUARE SPECIALIZATIONS
720 //
721 //=================================================================================================
722 
723 //*************************************************************************************************
725 template< typename MT, bool SO, bool DF >
726 struct IsSquare< HermitianMatrix<MT,SO,DF> >
727  : public TrueType
728 {};
730 //*************************************************************************************************
731 
732 
733 
734 
735 //=================================================================================================
736 //
737 // ISSYMMETRIC SPECIALIZATIONS
738 //
739 //=================================================================================================
740 
741 //*************************************************************************************************
743 template< typename MT, bool SO, bool DF >
744 struct IsSymmetric< HermitianMatrix<MT,SO,DF> >
745  : public BoolConstant< IsBuiltin< ElementType_<MT> >::value >
746 {};
748 //*************************************************************************************************
749 
750 
751 
752 
753 //=================================================================================================
754 //
755 // ISHERMITIAN SPECIALIZATIONS
756 //
757 //=================================================================================================
758 
759 //*************************************************************************************************
761 template< typename MT, bool SO, bool DF >
762 struct IsHermitian< HermitianMatrix<MT,SO,DF> >
763  : public TrueType
764 {};
766 //*************************************************************************************************
767 
768 
769 
770 
771 //=================================================================================================
772 //
773 // ISADAPTOR SPECIALIZATIONS
774 //
775 //=================================================================================================
776 
777 //*************************************************************************************************
779 template< typename MT, bool SO, bool DF >
780 struct IsAdaptor< HermitianMatrix<MT,SO,DF> >
781  : public TrueType
782 {};
784 //*************************************************************************************************
785 
786 
787 
788 
789 //=================================================================================================
790 //
791 // ISRESTRICTED SPECIALIZATIONS
792 //
793 //=================================================================================================
794 
795 //*************************************************************************************************
797 template< typename MT, bool SO, bool DF >
798 struct IsRestricted< HermitianMatrix<MT,SO,DF> >
799  : public TrueType
800 {};
802 //*************************************************************************************************
803 
804 
805 
806 
807 //=================================================================================================
808 //
809 // HASCONSTDATAACCESS SPECIALIZATIONS
810 //
811 //=================================================================================================
812 
813 //*************************************************************************************************
815 template< typename MT, bool SO >
816 struct HasConstDataAccess< HermitianMatrix<MT,SO,true> >
817  : public TrueType
818 {};
820 //*************************************************************************************************
821 
822 
823 
824 
825 //=================================================================================================
826 //
827 // ISALIGNED SPECIALIZATIONS
828 //
829 //=================================================================================================
830 
831 //*************************************************************************************************
833 template< typename MT, bool SO, bool DF >
834 struct IsAligned< HermitianMatrix<MT,SO,DF> >
835  : public BoolConstant< IsAligned<MT>::value >
836 {};
838 //*************************************************************************************************
839 
840 
841 
842 
843 //=================================================================================================
844 //
845 // ISPADDED SPECIALIZATIONS
846 //
847 //=================================================================================================
848 
849 //*************************************************************************************************
851 template< typename MT, bool SO, bool DF >
852 struct IsPadded< HermitianMatrix<MT,SO,DF> >
853  : public BoolConstant< IsPadded<MT>::value >
854 {};
856 //*************************************************************************************************
857 
858 
859 
860 
861 //=================================================================================================
862 //
863 // ISRESIZABLE SPECIALIZATIONS
864 //
865 //=================================================================================================
866 
867 //*************************************************************************************************
869 template< typename MT, bool SO, bool DF >
870 struct IsResizable< HermitianMatrix<MT,SO,DF> >
871  : public BoolConstant< IsResizable<MT>::value >
872 {};
874 //*************************************************************************************************
875 
876 
877 
878 
879 //=================================================================================================
880 //
881 // ISSHRINKABLE SPECIALIZATIONS
882 //
883 //=================================================================================================
884 
885 //*************************************************************************************************
887 template< typename MT, bool SO, bool DF >
888 struct IsShrinkable< HermitianMatrix<MT,SO,DF> >
889  : public BoolConstant< IsShrinkable<MT>::value >
890 {};
892 //*************************************************************************************************
893 
894 
895 
896 
897 //=================================================================================================
898 //
899 // REMOVEADAPTOR SPECIALIZATIONS
900 //
901 //=================================================================================================
902 
903 //*************************************************************************************************
905 template< typename MT, bool SO, bool DF >
906 struct RemoveAdaptor< HermitianMatrix<MT,SO,DF> >
907 {
908  using Type = MT;
909 };
911 //*************************************************************************************************
912 
913 
914 
915 
916 //=================================================================================================
917 //
918 // ADDTRAIT SPECIALIZATIONS
919 //
920 //=================================================================================================
921 
922 //*************************************************************************************************
924 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
925 struct AddTrait< HermitianMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
926 {
928 };
929 
930 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
931 struct AddTrait< StaticMatrix<T,M,N,SO1>, HermitianMatrix<MT,SO2,DF> >
932 {
933  using Type = AddTrait_< StaticMatrix<T,M,N,SO1>, MT >;
934 };
935 
936 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
937 struct AddTrait< HermitianMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
938 {
940 };
941 
942 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
943 struct AddTrait< HybridMatrix<T,M,N,SO1>, HermitianMatrix<MT,SO2,DF> >
944 {
945  using Type = AddTrait_< HybridMatrix<T,M,N,SO1>, MT >;
946 };
947 
948 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
949 struct AddTrait< HermitianMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
950 {
952 };
953 
954 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
955 struct AddTrait< DynamicMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
956 {
957  using Type = AddTrait_< DynamicMatrix<T,SO1>, MT >;
958 };
959 
960 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
961 struct AddTrait< HermitianMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
962 {
964 };
965 
966 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
967 struct AddTrait< CustomMatrix<T,AF,PF,SO1>, HermitianMatrix<MT,SO2,DF> >
968 {
969  using Type = AddTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
970 };
971 
972 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
973 struct AddTrait< HermitianMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
974 {
976 };
977 
978 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
979 struct AddTrait< CompressedMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
980 {
981  using Type = AddTrait_< CompressedMatrix<T,SO1>, MT >;
982 };
983 
984 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
985 struct AddTrait< HermitianMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
986 {
988 };
989 
990 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
991 struct AddTrait< IdentityMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
992 {
994 };
995 
996 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
997 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
998 {
1001  , AddTrait_<MT1,MT2> >;
1002 };
1003 
1004 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1005 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1006 {
1009  , AddTrait_<MT1,MT2> >;
1010 };
1011 
1012 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1013 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1014 {
1015  using Type = HermitianMatrix< AddTrait_<MT1,MT2> >;
1016 };
1018 //*************************************************************************************************
1019 
1020 
1021 
1022 
1023 //=================================================================================================
1024 //
1025 // SUBTRAIT SPECIALIZATIONS
1026 //
1027 //=================================================================================================
1028 
1029 //*************************************************************************************************
1031 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1032 struct SubTrait< HermitianMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1033 {
1035 };
1036 
1037 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1038 struct SubTrait< StaticMatrix<T,M,N,SO1>, HermitianMatrix<MT,SO2,DF> >
1039 {
1040  using Type = SubTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1041 };
1042 
1043 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1044 struct SubTrait< HermitianMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1045 {
1047 };
1048 
1049 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1050 struct SubTrait< HybridMatrix<T,M,N,SO1>, HermitianMatrix<MT,SO2,DF> >
1051 {
1052  using Type = SubTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1053 };
1054 
1055 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1056 struct SubTrait< HermitianMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1057 {
1058  using Type = SubTrait_< MT, DynamicMatrix<T,SO2> >;
1059 };
1060 
1061 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1062 struct SubTrait< DynamicMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
1063 {
1064  using Type = SubTrait_< DynamicMatrix<T,SO1>, MT >;
1065 };
1066 
1067 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1068 struct SubTrait< HermitianMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1069 {
1071 };
1072 
1073 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1074 struct SubTrait< CustomMatrix<T,AF,PF,SO1>, HermitianMatrix<MT,SO2,DF> >
1075 {
1076  using Type = SubTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1077 };
1078 
1079 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1080 struct SubTrait< HermitianMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1081 {
1083 };
1084 
1085 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1086 struct SubTrait< CompressedMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
1087 {
1088  using Type = SubTrait_< CompressedMatrix<T,SO1>, MT >;
1089 };
1090 
1091 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1092 struct SubTrait< HermitianMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1093 {
1095 };
1096 
1097 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1098 struct SubTrait< IdentityMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
1099 {
1101 };
1102 
1103 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1104 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2> >
1105 {
1108  , SubTrait_<MT1,MT2> >;
1109 };
1110 
1111 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1112 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1113 {
1116  , SubTrait_<MT1,MT2> >;
1117 };
1118 
1119 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1120 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1121 {
1122  using Type = HermitianMatrix< SubTrait_<MT1,MT2> >;
1123 };
1125 //*************************************************************************************************
1126 
1127 
1128 
1129 
1130 //=================================================================================================
1131 //
1132 // SCHURTRAIT SPECIALIZATIONS
1133 //
1134 //=================================================================================================
1135 
1136 //*************************************************************************************************
1138 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1139 struct SchurTrait< HermitianMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1140 {
1142 };
1143 
1144 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1145 struct SchurTrait< StaticMatrix<T,M,N,SO1>, HermitianMatrix<MT,SO2,DF> >
1146 {
1147  using Type = SchurTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1148 };
1149 
1150 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1151 struct SchurTrait< HermitianMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1152 {
1154 };
1155 
1156 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1157 struct SchurTrait< HybridMatrix<T,M,N,SO1>, HermitianMatrix<MT,SO2,DF> >
1158 {
1159  using Type = SchurTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1160 };
1161 
1162 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1163 struct SchurTrait< HermitianMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1164 {
1166 };
1167 
1168 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1169 struct SchurTrait< DynamicMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
1170 {
1171  using Type = SchurTrait_< DynamicMatrix<T,SO1>, MT >;
1172 };
1173 
1174 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1175 struct SchurTrait< HermitianMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1176 {
1178 };
1179 
1180 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1181 struct SchurTrait< CustomMatrix<T,AF,PF,SO1>, HermitianMatrix<MT,SO2,DF> >
1182 {
1183  using Type = SchurTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1184 };
1185 
1186 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1187 struct SchurTrait< HermitianMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1188 {
1190 };
1191 
1192 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1193 struct SchurTrait< CompressedMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
1194 {
1195  using Type = SchurTrait_< CompressedMatrix<T,SO1>, MT >;
1196 };
1197 
1198 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1199 struct SchurTrait< HermitianMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1200 {
1202 };
1203 
1204 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1205 struct SchurTrait< IdentityMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
1206 {
1208 };
1209 
1210 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1211 struct SchurTrait< HermitianMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1212 {
1216 };
1217 
1218 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1219 struct SchurTrait< SymmetricMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1220 {
1224 };
1225 
1226 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1227 struct SchurTrait< HermitianMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1228 {
1230 };
1232 //*************************************************************************************************
1233 
1234 
1235 
1236 
1237 //=================================================================================================
1238 //
1239 // MULTTRAIT SPECIALIZATIONS
1240 //
1241 //=================================================================================================
1242 
1243 //*************************************************************************************************
1245 template< typename MT, bool SO, bool DF, typename T >
1246 struct MultTrait< HermitianMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
1247 {
1248  using Type = HermitianMatrix< MultTrait_<MT,T> >;
1249 };
1250 
1251 template< typename T, typename MT, bool SO, bool DF >
1252 struct MultTrait< T, HermitianMatrix<MT,SO,DF>, EnableIf_< IsNumeric<T> > >
1253 {
1254  using Type = HermitianMatrix< MultTrait_<T,MT> >;
1255 };
1256 
1257 template< typename MT, bool SO, bool DF, typename T, size_t N >
1258 struct MultTrait< HermitianMatrix<MT,SO,DF>, StaticVector<T,N,false> >
1259 {
1261 };
1262 
1263 template< typename T, size_t N, typename MT, bool SO, bool DF >
1264 struct MultTrait< StaticVector<T,N,true>, HermitianMatrix<MT,SO,DF> >
1265 {
1266  using Type = MultTrait_< StaticVector<T,N,true>, MT >;
1267 };
1268 
1269 template< typename MT, bool SO, bool DF, typename T, size_t N >
1270 struct MultTrait< HermitianMatrix<MT,SO,DF>, HybridVector<T,N,false> >
1271 {
1273 };
1274 
1275 template< typename T, size_t N, typename MT, bool SO, bool DF >
1276 struct MultTrait< HybridVector<T,N,true>, HermitianMatrix<MT,SO,DF> >
1277 {
1278  using Type = MultTrait_< HybridVector<T,N,true>, MT >;
1279 };
1280 
1281 template< typename MT, bool SO, bool DF, typename T >
1282 struct MultTrait< HermitianMatrix<MT,SO,DF>, DynamicVector<T,false> >
1283 {
1285 };
1286 
1287 template< typename T, typename MT, bool SO, bool DF >
1288 struct MultTrait< DynamicVector<T,true>, HermitianMatrix<MT,SO,DF> >
1289 {
1290  using Type = MultTrait_< DynamicVector<T,true>, MT >;
1291 };
1292 
1293 template< typename MT, bool SO, bool DF, typename T, bool AF, bool PF >
1294 struct MultTrait< HermitianMatrix<MT,SO,DF>, CustomVector<T,AF,PF,false> >
1295 {
1297 };
1298 
1299 template< typename T, bool AF, bool PF, typename MT, bool SO, bool DF >
1300 struct MultTrait< CustomVector<T,AF,PF,true>, HermitianMatrix<MT,SO,DF> >
1301 {
1302  using Type = MultTrait_< CustomVector<T,AF,PF,true>, MT >;
1303 };
1304 
1305 template< typename MT, bool SO, bool DF, typename T >
1306 struct MultTrait< HermitianMatrix<MT,SO,DF>, CompressedVector<T,false> >
1307 {
1309 };
1310 
1311 template< typename T, typename MT, bool SO, bool DF >
1312 struct MultTrait< CompressedVector<T,true>, HermitianMatrix<MT,SO,DF> >
1313 {
1314  using Type = MultTrait_< CompressedVector<T,true>, MT >;
1315 };
1316 
1317 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1318 struct MultTrait< HermitianMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1319 {
1321 };
1322 
1323 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1324 struct MultTrait< StaticMatrix<T,M,N,SO1>, HermitianMatrix<MT,SO2,DF> >
1325 {
1326  using Type = MultTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1327 };
1328 
1329 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1330 struct MultTrait< HermitianMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1331 {
1333 };
1334 
1335 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1336 struct MultTrait< HybridMatrix<T,M,N,SO1>, HermitianMatrix<MT,SO2,DF> >
1337 {
1338  using Type = MultTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1339 };
1340 
1341 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1342 struct MultTrait< HermitianMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1343 {
1344  using Type = MultTrait_< MT, DynamicMatrix<T,SO2> >;
1345 };
1346 
1347 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1348 struct MultTrait< DynamicMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
1349 {
1350  using Type = MultTrait_< DynamicMatrix<T,SO1>, MT >;
1351 };
1352 
1353 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1354 struct MultTrait< HermitianMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1355 {
1357 };
1358 
1359 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1360 struct MultTrait< CustomMatrix<T,AF,PF,SO1>, HermitianMatrix<MT,SO2,DF> >
1361 {
1362  using Type = MultTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1363 };
1364 
1365 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1366 struct MultTrait< HermitianMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1367 {
1369 };
1370 
1371 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1372 struct MultTrait< CompressedMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
1373 {
1374  using Type = MultTrait_< CompressedMatrix<T,SO1>, MT >;
1375 };
1376 
1377 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1378 struct MultTrait< HermitianMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1379 {
1381 };
1382 
1383 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1384 struct MultTrait< IdentityMatrix<T,SO1>, HermitianMatrix<MT,SO2,DF> >
1385 {
1387 };
1388 
1389 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1390 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2> >
1391 {
1392  using Type = MultTrait_<MT1,MT2>;
1393 };
1394 
1395 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1396 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1397 {
1398  using Type = MultTrait_<MT1,MT2>;
1399 };
1400 
1401 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1402 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1403 {
1404  using Type = MultTrait_<MT1,MT2>;
1405 };
1407 //*************************************************************************************************
1408 
1409 
1410 
1411 
1412 //=================================================================================================
1413 //
1414 // DIVTRAIT SPECIALIZATIONS
1415 //
1416 //=================================================================================================
1417 
1418 //*************************************************************************************************
1420 template< typename MT, bool SO, bool DF, typename T >
1421 struct DivTrait< HermitianMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
1422 {
1423  using Type = HermitianMatrix< DivTrait_<MT,T> >;
1424 };
1426 //*************************************************************************************************
1427 
1428 
1429 
1430 
1431 //=================================================================================================
1432 //
1433 // UNARYMAPTRAIT SPECIALIZATIONS
1434 //
1435 //=================================================================================================
1436 
1437 //*************************************************************************************************
1439 template< typename MT, bool SO, bool DF >
1440 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Abs >
1441 {
1443 };
1444 
1445 template< typename MT, bool SO, bool DF >
1446 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Floor >
1447 {
1449 };
1450 
1451 template< typename MT, bool SO, bool DF >
1452 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Ceil >
1453 {
1455 };
1456 
1457 template< typename MT, bool SO, bool DF >
1458 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Trunc >
1459 {
1461 };
1462 
1463 template< typename MT, bool SO, bool DF >
1464 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Round >
1465 {
1467 };
1468 
1469 template< typename MT, bool SO, bool DF >
1470 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Conj >
1471 {
1473 };
1474 
1475 template< typename MT, bool SO, bool DF >
1476 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Real >
1477 {
1479 };
1480 
1481 template< typename MT, bool SO, bool DF >
1482 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Imag >
1483 {
1484  using Type = If_< IsBuiltin< ElementType_<MT> >
1487 };
1488 
1489 template< typename MT, bool SO, bool DF >
1490 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Sqrt >
1491 {
1493 };
1494 
1495 template< typename MT, bool SO, bool DF >
1496 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, InvSqrt >
1497 {
1499 };
1500 
1501 template< typename MT, bool SO, bool DF >
1502 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Cbrt >
1503 {
1505 };
1506 
1507 template< typename MT, bool SO, bool DF >
1508 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, InvCbrt >
1509 {
1511 };
1512 
1513 template< typename MT, bool SO, bool DF, typename ET >
1514 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Pow<ET> >
1515 {
1517 };
1518 
1519 template< typename MT, bool SO, bool DF >
1520 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Exp >
1521 {
1523 };
1524 
1525 template< typename MT, bool SO, bool DF >
1526 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Log >
1527 {
1529 };
1530 
1531 template< typename MT, bool SO, bool DF >
1532 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Log10 >
1533 {
1535 };
1536 
1537 template< typename MT, bool SO, bool DF >
1538 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Sin >
1539 {
1541 };
1542 
1543 template< typename MT, bool SO, bool DF >
1544 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Asin >
1545 {
1547 };
1548 
1549 template< typename MT, bool SO, bool DF >
1550 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Sinh >
1551 {
1553 };
1554 
1555 template< typename MT, bool SO, bool DF >
1556 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Asinh >
1557 {
1559 };
1560 
1561 template< typename MT, bool SO, bool DF >
1562 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Cos >
1563 {
1565 };
1566 
1567 template< typename MT, bool SO, bool DF >
1568 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Acos >
1569 {
1571 };
1572 
1573 template< typename MT, bool SO, bool DF >
1574 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Cosh >
1575 {
1577 };
1578 
1579 template< typename MT, bool SO, bool DF >
1580 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Acosh >
1581 {
1583 };
1584 
1585 template< typename MT, bool SO, bool DF >
1586 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Tan >
1587 {
1589 };
1590 
1591 template< typename MT, bool SO, bool DF >
1592 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Atan >
1593 {
1595 };
1596 
1597 template< typename MT, bool SO, bool DF >
1598 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Tanh >
1599 {
1601 };
1602 
1603 template< typename MT, bool SO, bool DF >
1604 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Atanh >
1605 {
1607 };
1608 
1609 template< typename MT, bool SO, bool DF >
1610 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Erf >
1611 {
1613 };
1614 
1615 template< typename MT, bool SO, bool DF >
1616 struct UnaryMapTrait< HermitianMatrix<MT,SO,DF>, Erfc >
1617 {
1619 };
1621 //*************************************************************************************************
1622 
1623 
1624 
1625 
1626 //=================================================================================================
1627 //
1628 // BINARYMAPTRAIT SPECIALIZATIONS
1629 //
1630 //=================================================================================================
1631 
1632 //*************************************************************************************************
1634 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1635 struct BinaryMapTrait< HermitianMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF>, Min >
1636 {
1638 };
1639 
1640 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1641 struct BinaryMapTrait< HermitianMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF>, Max >
1642 {
1644 };
1645 
1646 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1647 struct BinaryMapTrait< SymmetricMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2>, Min >
1648 {
1650 };
1651 
1652 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1653 struct BinaryMapTrait< SymmetricMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2>, Max >
1654 {
1656 };
1657 
1658 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1659 struct BinaryMapTrait< HermitianMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2>, Min >
1660 {
1662 };
1663 
1664 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1665 struct BinaryMapTrait< HermitianMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2>, Max >
1666 {
1668 };
1670 //*************************************************************************************************
1671 
1672 
1673 
1674 
1675 //=================================================================================================
1676 //
1677 // DECLSYMTRAIT SPECIALIZATIONS
1678 //
1679 //=================================================================================================
1680 
1681 //*************************************************************************************************
1683 template< typename MT, bool SO, bool DF >
1684 struct DeclSymTrait< HermitianMatrix<MT,SO,DF> >
1685 {
1686  using Type = HermitianMatrix<MT,SO,DF>;
1687 };
1689 //*************************************************************************************************
1690 
1691 
1692 
1693 
1694 //=================================================================================================
1695 //
1696 // DECLHERMTRAIT SPECIALIZATIONS
1697 //
1698 //=================================================================================================
1699 
1700 //*************************************************************************************************
1702 template< typename MT, bool SO, bool DF >
1703 struct DeclHermTrait< HermitianMatrix<MT,SO,DF> >
1704 {
1705  using Type = HermitianMatrix<MT,SO,DF>;
1706 };
1708 //*************************************************************************************************
1709 
1710 
1711 
1712 
1713 //=================================================================================================
1714 //
1715 // DECLLOWTRAIT SPECIALIZATIONS
1716 //
1717 //=================================================================================================
1718 
1719 //*************************************************************************************************
1721 template< typename MT, bool SO, bool DF >
1722 struct DeclLowTrait< HermitianMatrix<MT,SO,DF> >
1723 {
1724  using Type = HermitianMatrix<MT,SO,DF>;
1725 };
1727 //*************************************************************************************************
1728 
1729 
1730 
1731 
1732 //=================================================================================================
1733 //
1734 // DECLUPPTRAIT SPECIALIZATIONS
1735 //
1736 //=================================================================================================
1737 
1738 //*************************************************************************************************
1740 template< typename MT, bool SO, bool DF >
1741 struct DeclUppTrait< HermitianMatrix<MT,SO,DF> >
1742 {
1743  using Type = HermitianMatrix<MT,SO,DF>;
1744 };
1746 //*************************************************************************************************
1747 
1748 
1749 
1750 
1751 //=================================================================================================
1752 //
1753 // DECLDIAGTRAIT SPECIALIZATIONS
1754 //
1755 //=================================================================================================
1756 
1757 //*************************************************************************************************
1759 template< typename MT, bool SO, bool DF >
1760 struct DeclDiagTrait< HermitianMatrix<MT,SO,DF> >
1761 {
1762  using Type = HermitianMatrix<MT,SO,DF>;
1763 };
1765 //*************************************************************************************************
1766 
1767 
1768 
1769 
1770 //=================================================================================================
1771 //
1772 // HIGHTYPE SPECIALIZATIONS
1773 //
1774 //=================================================================================================
1775 
1776 //*************************************************************************************************
1778 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1779 struct HighType< HermitianMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1780 {
1782 };
1784 //*************************************************************************************************
1785 
1786 
1787 
1788 
1789 //=================================================================================================
1790 //
1791 // LOWTYPE SPECIALIZATIONS
1792 //
1793 //=================================================================================================
1794 
1795 //*************************************************************************************************
1797 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1798 struct LowType< HermitianMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1799 {
1801 };
1803 //*************************************************************************************************
1804 
1805 
1806 
1807 
1808 //=================================================================================================
1809 //
1810 // SUBMATRIXTRAIT SPECIALIZATIONS
1811 //
1812 //=================================================================================================
1813 
1814 //*************************************************************************************************
1816 template< typename MT, bool SO, bool DF >
1817 struct SubmatrixTrait< HermitianMatrix<MT,SO,DF> >
1818 {
1819  using Type = SubmatrixTrait_<MT>;
1820 };
1822 //*************************************************************************************************
1823 
1824 
1825 
1826 
1827 //=================================================================================================
1828 //
1829 // ROWTRAIT SPECIALIZATIONS
1830 //
1831 //=================================================================================================
1832 
1833 //*************************************************************************************************
1835 template< typename MT, bool SO, bool DF >
1836 struct RowTrait< HermitianMatrix<MT,SO,DF> >
1837 {
1838  using Type = RowTrait_<MT>;
1839 };
1841 //*************************************************************************************************
1842 
1843 
1844 
1845 
1846 //=================================================================================================
1847 //
1848 // COLUMNTRAIT SPECIALIZATIONS
1849 //
1850 //=================================================================================================
1851 
1852 //*************************************************************************************************
1854 template< typename MT, bool SO, bool DF >
1855 struct ColumnTrait< HermitianMatrix<MT,SO,DF> >
1856 {
1857  using Type = ColumnTrait_<MT>;
1858 };
1860 //*************************************************************************************************
1861 
1862 } // namespace blaze
1863 
1864 #endif
bool isReal(const DiagonalProxy< MT > &proxy)
Returns whether the matrix element represents a real number.
Definition: DiagonalProxy.h:622
Header file for auxiliary alias declarations.
Headerfile for the generic min algorithm.
Header file for the decldiag trait.
Header file for the Schur product trait.
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
Header file for the Rows type trait.
Header file for the UNUSED_PARAMETER function template.
Header file for the subtraction trait.
Flag for the inversion of a diagonal matrix.
Definition: InversionFlag.h:115
Flag for the inversion of a general matrix (same as byLU).
Definition: InversionFlag.h:108
Header file for the row trait.
Header file for the declherm trait.
Base template for the SubmatrixTrait class.
Definition: SubmatrixTrait.h:128
Flag for the inversion of a upper unitriangular matrix.
Definition: InversionFlag.h:114
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:127
Flag for the inversion of a lower unitriangular matrix.
Definition: InversionFlag.h:112
typename RowTrait< MT >::Type RowTrait_
Auxiliary alias declaration for the RowTrait type trait.The RowTrait_ alias declaration provides a co...
Definition: RowTrait.h:162
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
Base template for the DeclUppTrait class.
Definition: DeclUppTrait.h:133
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Header file for the dense matrix inversion flags.
Base template for the SchurTrait class.
Definition: SchurTrait.h:124
Flag for the Bunch-Kaufman-based inversion for Hermitian matrices.
Definition: InversionFlag.h:105
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:560
Submatrix< MT, AF > submatrix(Matrix< MT, SO > &matrix, size_t row, size_t column, size_t m, size_t n)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:352
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1762
Matrix adapter for symmetric matrices.
Definition: BaseTemplate.h:611
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:250
Column< MT > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:124
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is an identity matrix.
Definition: DenseMatrix.h:1686
Compile time check for data types with restricted data access.This type trait tests whether the given...
Definition: IsRestricted.h:82
Header file for the IsSquare type trait.
Row< MT > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:124
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:772
Base template for the RowTrait class.
Definition: RowTrait.h:127
Constraint on the data type.
Header file for the LowType type trait.
Base template for the HighType type trait.
Definition: HighType.h:133
Header file for the multiplication trait.
Header file for the unary map trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
Flag for the LU-based matrix inversion.
Definition: InversionFlag.h:103
Header file for the IsShrinkable type trait.
Header file for all forward declarations of the math module.
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
Header file for the decllow trait.
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
Flag for the inversion of a Hermitian matrix (same as byLDLH).
Definition: InversionFlag.h:110
Compile time check for square matrices.This type trait tests whether or not the given template parame...
Definition: IsSquare.h:88
typename SchurTrait< T1, T2 >::Type SchurTrait_
Auxiliary alias declaration for the SchurTrait class template.The SchurTrait_ alias declaration provi...
Definition: SchurTrait.h:167
Header file for the IsAligned type trait.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:340
Flag for the Bunch-Kaufman-based inversion for symmetric matrices.
Definition: InversionFlag.h:104
HermitianMatrix specialization for sparse matrices.
Base template for the DeclSymTrait class.
Definition: DeclSymTrait.h:134
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.
Header file for the RemoveAdaptor type trait.
Header file for the implementation of the base template of the HeritianMatrix.
Constraint on the data type.
Compile time check for adaptors.This type trait tests whether the given template parameter is an adap...
Definition: IsAdaptor.h:88
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:580
Header file for the IsPadded type trait.
Header file for the IsAdaptor type trait.
Compile time check for shrinkable data types.This type trait tests whether the given data type is a s...
Definition: IsShrinkable.h:75
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
Base template for the LowType type trait.
Definition: LowType.h:133
Header file for the HasConstDataAccess type trait.
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:75
Header file for the declupp trait.
Flag for the inversion of a symmetric matrix (same as byLDLT).
Definition: InversionFlag.h:109
Header file for the binary map trait.
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:139
Base template for the DeclHermTrait class.
Definition: DeclHermTrait.h:134
Base template for the MultTrait class.
Definition: MultTrait.h:139
Header file for the addition trait.
Header file for the division trait.
Header file for the submatrix trait.
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:154
Header file for the declsym trait.
bool isHermitian(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is Hermitian.
Definition: DenseMatrix.h:778
Matrix adapter for Hermitian matrices.
Definition: BaseTemplate.h:614
Header file for the column trait.
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:270
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
Compile time check for built-in data types.This type trait tests whether or not the given template pa...
Definition: IsBuiltin.h:75
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:101
#define BLAZE_CONSTRAINT_MUST_BE_BLAS_COMPATIBLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a BLAS compatible data type (i...
Definition: BLASCompatible.h:61
Flag for the Cholesky-based inversion for positive-definite matrices.
Definition: InversionFlag.h:106
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
typename SubmatrixTrait< MT >::Type SubmatrixTrait_
Auxiliary alias declaration for the SubmatrixTrait type trait.The SubmatrixTrait_ alias declaration p...
Definition: SubmatrixTrait.h:163
Base template for the DivTrait class.
Definition: DivTrait.h:139
typename ColumnTrait< MT >::Type ColumnTrait_
Auxiliary alias declaration for the ColumnTrait type trait.The ColumnTrait_ alias declaration provide...
Definition: ColumnTrait.h:162
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:324
Base template for the DeclLowTrait class.
Definition: DeclLowTrait.h:133
typename UnaryMapTrait< T, OP >::Type UnaryMapTrait_
Auxiliary alias declaration for the UnaryMapTrait class template.The UnaryMapTrait_ alias declaration...
Definition: UnaryMapTrait.h:156
Removal of top level adaptor types.In case the given type is an adaptor type (SymmetricMatrix, LowerMatrix, UpperMatrix, ...), the RemoveAdaptor type trait removes the adaptor and extracts the contained general matrix type. Else the given type is returned as is. Note that cv-qualifiers are preserved.
Definition: RemoveAdaptor.h:76
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:177
Header file for the IsBuiltin type trait.
typename SubTrait< T1, T2 >::Type SubTrait_
Auxiliary alias declaration for the SubTrait class template.The SubTrait_ alias declaration provides ...
Definition: SubTrait.h:250
Header file for the isDivisor shim.
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:75
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:252
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:75
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:600
Base template for the SubTrait class.
Definition: SubTrait.h:139
Matrix adapter for diagonal matrices.
Definition: BaseTemplate.h:560
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the IsHermitian type trait.
Base template for the DeclDiagTrait class.
Definition: DeclDiagTrait.h:133
Base template for the BinaryMapTrait class.
Definition: BinaryMapTrait.h:119
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
Base template for the UnaryMapTrait class.
Definition: UnaryMapTrait.h:117
Header file for the isReal shim.
HermitianMatrix specialization for dense matrices.
typename AddTrait< T1, T2 >::Type AddTrait_
Auxiliary alias declaration for the AddTrait class template.The AddTrait_ alias declaration provides ...
Definition: AddTrait.h:250
InversionFlag
Inversion flag.The InversionFlag type enumeration represents the different types of matrix inversion ...
Definition: InversionFlag.h:101
#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 HighType type trait.
Header file for the TrueType type/value trait base class.