SymmetricMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
51 #include <blaze/math/Exception.h>
53 #include <blaze/math/Forward.h>
96 #include <blaze/util/Assert.h>
97 #include <blaze/util/EnableIf.h>
98 #include <blaze/util/TrueType.h>
101 #include <blaze/util/Unused.h>
102 
103 
104 namespace blaze {
105 
106 //=================================================================================================
107 //
108 // SYMMETRICMATRIX OPERATORS
109 //
110 //=================================================================================================
111 
112 //*************************************************************************************************
115 template< typename MT, bool SO, bool DF, bool NF >
116 void reset( SymmetricMatrix<MT,SO,DF,NF>& m );
117 
118 template< typename MT, bool SO, bool DF, bool NF >
119 void reset( SymmetricMatrix<MT,SO,DF,NF>& m, size_t i );
120 
121 template< typename MT, bool SO, bool DF, bool NF >
122 void clear( SymmetricMatrix<MT,SO,DF,NF>& m );
123 
124 template< bool RF, typename MT, bool SO, bool DF, bool NF >
125 bool isDefault( const SymmetricMatrix<MT,SO,DF,NF>& m );
126 
127 template< typename MT, bool SO, bool DF, bool NF >
128 bool isIntact( const SymmetricMatrix<MT,SO,DF,NF>& m );
129 
130 template< typename MT, bool SO, bool DF, bool NF >
131 void swap( SymmetricMatrix<MT,SO,DF,NF>& a, SymmetricMatrix<MT,SO,DF,NF>& b ) noexcept;
133 //*************************************************************************************************
134 
135 
136 //*************************************************************************************************
143 template< typename MT // Type of the adapted matrix
144  , bool SO // Storage order of the adapted matrix
145  , bool DF // Density flag
146  , bool NF > // Numeric flag
148 {
149  m.reset();
150 }
151 //*************************************************************************************************
152 
153 
154 //*************************************************************************************************
167 template< typename MT // Type of the adapted matrix
168  , bool SO // Storage order of the adapted matrix
169  , bool DF // Density flag
170  , bool NF > // Numeric flag
171 inline void reset( SymmetricMatrix<MT,SO,DF,NF>& m, size_t i )
172 {
173  m.reset( i );
174 }
175 //*************************************************************************************************
176 
177 
178 //*************************************************************************************************
185 template< typename MT // Type of the adapted matrix
186  , bool SO // Storage order of the adapted matrix
187  , bool DF // Density flag
188  , bool NF > // Numeric flag
190 {
191  m.clear();
192 }
193 //*************************************************************************************************
194 
195 
196 //*************************************************************************************************
221 template< bool RF // Relaxation flag
222  , typename MT // Type of the adapted matrix
223  , bool SO // Storage order of the adapted matrix
224  , bool DF // Density flag
225  , bool NF > // Numeric flag
227 {
228  return isDefault<RF>( m.matrix_ );
229 }
230 //*************************************************************************************************
231 
232 
233 //*************************************************************************************************
254 template< typename MT // Type of the adapted matrix
255  , bool SO // Storage order of the adapted matrix
256  , bool DF // Density flag
257  , bool NF > // Numeric flag
258 inline bool isIntact( const SymmetricMatrix<MT,SO,DF,NF>& m )
259 {
260  return m.isIntact();
261 }
262 //*************************************************************************************************
263 
264 
265 //*************************************************************************************************
273 template< typename MT // Type of the adapted matrix
274  , bool SO // Storage order of the adapted matrix
275  , bool DF // Density flag
276  , bool NF > // Numeric flag
278 {
279  a.swap( b );
280 }
281 //*************************************************************************************************
282 
283 
284 //*************************************************************************************************
307 template< InversionFlag IF // Inversion algorithm
308  , typename MT // Type of the dense matrix
309  , bool SO > // Storage order of the dense matrix
310 inline void invert( SymmetricMatrix<MT,SO,true,true>& m )
311 {
313 
314  if( IF == asUniLower || IF == asUniUpper ) {
315  BLAZE_INTERNAL_ASSERT( isIdentity( m ), "Violation of preconditions detected" );
316  return;
317  }
318 
319  constexpr InversionFlag flag( ( IF == byLU || IF == byLDLT || IF == byLDLH ||
320  IF == asGeneral || IF == asSymmetric || IF == asHermitian )
321  ? ( byLDLT )
322  : ( ( IF == byLLH )
323  ?( byLLH )
324  :( asDiagonal ) ) );
325 
326  MT tmp( m.matrix_ );
327  invert<flag>( tmp );
328  m.matrix_ = std::move( tmp );
329 
330  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
331 }
333 //*************************************************************************************************
334 
335 
336 //*************************************************************************************************
352 template< typename MT1 // Type of the adapted matrix
353  , bool SO1 // Storage order of the adapted matrix
354  , bool DF // Density flag
355  , bool NF // Numeric flag
356  , typename MT2 // Type of the right-hand side matrix
357  , bool SO2 > // Storage order of the right-hand side matrix
358 inline bool tryAssign( const SymmetricMatrix<MT1,SO1,DF,NF>& lhs,
359  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
360 {
362 
363  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
364  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
365  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
366  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
367 
368  UNUSED_PARAMETER( lhs );
369 
370  const size_t M( (~rhs).rows() );
371  const size_t N( (~rhs).columns() );
372 
373  if( ( row + M <= column ) || ( column + N <= row ) )
374  return true;
375 
376  const bool lower( row > column );
377  const size_t size ( min( row + M, column + N ) - ( lower ? row : column ) );
378 
379  if( size < 2UL )
380  return true;
381 
382  const size_t subrow( lower ? 0UL : column - row );
383  const size_t subcol( lower ? row - column : 0UL );
384 
385  return isSymmetric( submatrix( ~rhs, subrow, subcol, size, size ) );
386 }
388 //*************************************************************************************************
389 
390 
391 //*************************************************************************************************
407 template< typename MT1 // Type of the adapted matrix
408  , bool SO1 // Storage order of the adapted matrix
409  , bool DF // Density flag
410  , bool NF // Numeric flag
411  , typename MT2 // Type of the right-hand side matrix
412  , bool SO2 > // Storage order of the right-hand side matrix
413 inline bool tryAddAssign( const SymmetricMatrix<MT1,SO1,DF,NF>& lhs,
414  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
415 {
416  return tryAssign( lhs, ~rhs, row, column );
417 }
419 //*************************************************************************************************
420 
421 
422 //*************************************************************************************************
439 template< typename MT1 // Type of the adapted matrix
440  , bool SO1 // Storage order of the adapted matrix
441  , bool DF // Density flag
442  , bool NF // Numeric flag
443  , typename MT2 // Type of the right-hand side matrix
444  , bool SO2 > // Storage order of the right-hand side matrix
445 inline bool trySubAssign( const SymmetricMatrix<MT1,SO1,DF,NF>& lhs,
446  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
447 {
448  return tryAssign( lhs, ~rhs, row, column );
449 }
451 //*************************************************************************************************
452 
453 
454 //*************************************************************************************************
471 template< typename MT1 // Type of the adapted matrix
472  , bool SO1 // Storage order of the adapted matrix
473  , bool DF // Density flag
474  , bool NF // Numeric flag
475  , typename MT2 // Type of the right-hand side matrix
476  , bool SO2 > // Storage order of the right-hand side matrix
477 inline bool trySchurAssign( const SymmetricMatrix<MT1,SO1,DF,NF>& lhs,
478  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
479 {
480  return tryAssign( lhs, ~rhs, row, column );
481 }
483 //*************************************************************************************************
484 
485 
486 
487 
488 //=================================================================================================
489 //
490 // SIZE SPECIALIZATIONS
491 //
492 //=================================================================================================
493 
494 //*************************************************************************************************
496 template< typename MT, bool SO, bool DF, bool NF >
497 struct Size< SymmetricMatrix<MT,SO,DF,NF>, 0UL >
498  : public Size<MT,0UL>
499 {};
500 
501 template< typename MT, bool SO, bool DF, bool NF >
502 struct Size< SymmetricMatrix<MT,SO,DF,NF>, 1UL >
503  : public Size<MT,1UL>
504 {};
506 //*************************************************************************************************
507 
508 
509 
510 
511 //=================================================================================================
512 //
513 // MAXSIZE SPECIALIZATIONS
514 //
515 //=================================================================================================
516 
517 //*************************************************************************************************
519 template< typename MT, bool SO, bool DF, bool NF >
520 struct MaxSize< SymmetricMatrix<MT,SO,DF,NF>, 0UL >
521  : public MaxSize<MT,0UL>
522 {};
523 
524 template< typename MT, bool SO, bool DF, bool NF >
525 struct MaxSize< SymmetricMatrix<MT,SO,DF,NF>, 1UL >
526  : public MaxSize<MT,1UL>
527 {};
529 //*************************************************************************************************
530 
531 
532 
533 
534 //=================================================================================================
535 //
536 // ISSQUARE SPECIALIZATIONS
537 //
538 //=================================================================================================
539 
540 //*************************************************************************************************
542 template< typename MT, bool SO, bool DF, bool NF >
543 struct IsSquare< SymmetricMatrix<MT,SO,DF,NF> >
544  : public TrueType
545 {};
547 //*************************************************************************************************
548 
549 
550 
551 
552 //=================================================================================================
553 //
554 // ISUNIFORM SPECIALIZATIONS
555 //
556 //=================================================================================================
557 
558 //*************************************************************************************************
560 template< typename MT, bool SO, bool DF, bool NF >
561 struct IsUniform< SymmetricMatrix<MT,SO,DF,NF> >
562  : public IsUniform<MT>
563 {};
565 //*************************************************************************************************
566 
567 
568 
569 
570 //=================================================================================================
571 //
572 // ISSYMMETRIC SPECIALIZATIONS
573 //
574 //=================================================================================================
575 
576 //*************************************************************************************************
578 template< typename MT, bool SO, bool DF, bool NF >
579 struct IsSymmetric< SymmetricMatrix<MT,SO,DF,NF> >
580  : public TrueType
581 {};
583 //*************************************************************************************************
584 
585 
586 
587 
588 //=================================================================================================
589 //
590 // ISHERMITIAN SPECIALIZATIONS
591 //
592 //=================================================================================================
593 
594 //*************************************************************************************************
596 template< typename MT, bool SO, bool DF, bool NF >
597 struct IsHermitian< SymmetricMatrix<MT,SO,DF,NF> >
598  : public IsBuiltin< ElementType_t<MT> >
599 {};
601 //*************************************************************************************************
602 
603 
604 
605 
606 //=================================================================================================
607 //
608 // ISSTRICTLYLOWER SPECIALIZATIONS
609 //
610 //=================================================================================================
611 
612 //*************************************************************************************************
614 template< typename MT, bool SO, bool DF, bool NF >
615 struct IsStrictlyLower< SymmetricMatrix<MT,SO,DF,NF> >
616  : public IsZero<MT>
617 {};
619 //*************************************************************************************************
620 
621 
622 
623 
624 //=================================================================================================
625 //
626 // ISSTRICTLYUPPER SPECIALIZATIONS
627 //
628 //=================================================================================================
629 
630 //*************************************************************************************************
632 template< typename MT, bool SO, bool DF, bool NF >
633 struct IsStrictlyUpper< SymmetricMatrix<MT,SO,DF,NF> >
634  : public IsZero<MT>
635 {};
637 //*************************************************************************************************
638 
639 
640 
641 
642 //=================================================================================================
643 //
644 // ISADAPTOR SPECIALIZATIONS
645 //
646 //=================================================================================================
647 
648 //*************************************************************************************************
650 template< typename MT, bool SO, bool DF, bool NF >
651 struct IsAdaptor< SymmetricMatrix<MT,SO,DF,NF> >
652  : public TrueType
653 {};
655 //*************************************************************************************************
656 
657 
658 
659 
660 //=================================================================================================
661 //
662 // ISRESTRICTED SPECIALIZATIONS
663 //
664 //=================================================================================================
665 
666 //*************************************************************************************************
668 template< typename MT, bool SO, bool DF, bool NF >
669 struct IsRestricted< SymmetricMatrix<MT,SO,DF,NF> >
670  : public TrueType
671 {};
673 //*************************************************************************************************
674 
675 
676 
677 
678 //=================================================================================================
679 //
680 // HASCONSTDATAACCESS SPECIALIZATIONS
681 //
682 //=================================================================================================
683 
684 //*************************************************************************************************
686 template< typename MT, bool SO, bool NF >
687 struct HasConstDataAccess< SymmetricMatrix<MT,SO,true,NF> >
688  : public TrueType
689 {};
691 //*************************************************************************************************
692 
693 
694 
695 
696 //=================================================================================================
697 //
698 // ISALIGNED SPECIALIZATIONS
699 //
700 //=================================================================================================
701 
702 //*************************************************************************************************
704 template< typename MT, bool SO, bool DF, bool NF >
705 struct IsAligned< SymmetricMatrix<MT,SO,DF,NF> >
706  : public IsAligned<MT>
707 {};
709 //*************************************************************************************************
710 
711 
712 
713 
714 //=================================================================================================
715 //
716 // ISCONTIGUOUS SPECIALIZATIONS
717 //
718 //=================================================================================================
719 
720 //*************************************************************************************************
722 template< typename MT, bool SO, bool DF, bool NF >
723 struct IsContiguous< SymmetricMatrix<MT,SO,DF,NF> >
724  : public IsContiguous<MT>
725 {};
727 //*************************************************************************************************
728 
729 
730 
731 
732 //=================================================================================================
733 //
734 // ISPADDED SPECIALIZATIONS
735 //
736 //=================================================================================================
737 
738 //*************************************************************************************************
740 template< typename MT, bool SO, bool DF, bool NF >
741 struct IsPadded< SymmetricMatrix<MT,SO,DF,NF> >
742  : public IsPadded<MT>
743 {};
745 //*************************************************************************************************
746 
747 
748 
749 
750 //=================================================================================================
751 //
752 // ISRESIZABLE SPECIALIZATIONS
753 //
754 //=================================================================================================
755 
756 //*************************************************************************************************
758 template< typename MT, bool SO, bool DF, bool NF >
759 struct IsResizable< SymmetricMatrix<MT,SO,DF,NF> >
760  : public IsResizable<MT>
761 {};
763 //*************************************************************************************************
764 
765 
766 
767 
768 //=================================================================================================
769 //
770 // ISSHRINKABLE SPECIALIZATIONS
771 //
772 //=================================================================================================
773 
774 //*************************************************************************************************
776 template< typename MT, bool SO, bool DF, bool NF >
777 struct IsShrinkable< SymmetricMatrix<MT,SO,DF,NF> >
778  : public IsShrinkable<MT>
779 {};
781 //*************************************************************************************************
782 
783 
784 
785 
786 //=================================================================================================
787 //
788 // REMOVEADAPTOR SPECIALIZATIONS
789 //
790 //=================================================================================================
791 
792 //*************************************************************************************************
794 template< typename MT, bool SO, bool DF, bool NF >
795 struct RemoveAdaptor< SymmetricMatrix<MT,SO,DF,NF> >
796 {
797  using Type = MT;
798 };
800 //*************************************************************************************************
801 
802 
803 
804 
805 //=================================================================================================
806 //
807 // ADDTRAIT SPECIALIZATIONS
808 //
809 //=================================================================================================
810 
811 //*************************************************************************************************
813 template< typename T1, typename T2 >
814 struct AddTraitEval1< T1, T2
815  , EnableIf_t< IsMatrix_v<T1> &&
816  IsMatrix_v<T2> &&
817  ( ( IsSymmetric_v<T1> && IsSymmetric_v<T2> ) ||
818  ( IsSymmetric_v<T1> && IsDiagonal_v<T2> ) ||
819  ( IsDiagonal_v<T1> && IsSymmetric_v<T2> ) ) &&
820  !( IsDiagonal_v<T1> && IsDiagonal_v<T2> ) &&
821  !( IsUniform_v<T1> && IsUniform_v<T2> ) &&
822  !( IsZero_v<T1> || IsZero_v<T2> ) > >
823 {
824  using Type = SymmetricMatrix< typename AddTraitEval2<T1,T2>::Type >;
825 };
827 //*************************************************************************************************
828 
829 
830 
831 
832 //=================================================================================================
833 //
834 // SUBTRAIT SPECIALIZATIONS
835 //
836 //=================================================================================================
837 
838 //*************************************************************************************************
840 template< typename T1, typename T2 >
841 struct SubTraitEval1< T1, T2
842  , EnableIf_t< IsMatrix_v<T1> &&
843  IsMatrix_v<T2> &&
844  ( ( IsSymmetric_v<T1> && IsSymmetric_v<T2> ) ||
845  ( IsSymmetric_v<T1> && IsDiagonal_v<T2> ) ||
846  ( IsDiagonal_v<T1> && IsSymmetric_v<T2> ) ) &&
847  !( IsDiagonal_v<T1> && IsDiagonal_v<T2> ) &&
848  !( IsUniform_v<T1> && IsUniform_v<T2> ) &&
849  !( IsZero_v<T1> || IsZero_v<T2> ) > >
850 {
851  using Type = SymmetricMatrix< typename SubTraitEval2<T1,T2>::Type >;
852 };
854 //*************************************************************************************************
855 
856 
857 
858 
859 //=================================================================================================
860 //
861 // SCHURTRAIT SPECIALIZATIONS
862 //
863 //=================================================================================================
864 
865 //*************************************************************************************************
867 template< typename T1, typename T2 >
868 struct SchurTraitEval1< T1, T2
869  , EnableIf_t< IsMatrix_v<T1> &&
870  IsMatrix_v<T2> &&
871  ( IsSymmetric_v<T1> && IsSymmetric_v<T2> ) &&
872  !( IsDiagonal_v<T1> || IsDiagonal_v<T2> ) &&
873  !( IsUniform_v<T1> && IsUniform_v<T2> ) &&
874  !( IsZero_v<T1> || IsZero_v<T2> ) > >
875 {
876  using Type = SymmetricMatrix< typename SchurTraitEval2<T1,T2>::Type >;
877 };
879 //*************************************************************************************************
880 
881 
882 
883 
884 //=================================================================================================
885 //
886 // MULTTRAIT SPECIALIZATIONS
887 //
888 //=================================================================================================
889 
890 //*************************************************************************************************
892 template< typename T1, typename T2 >
893 struct MultTraitEval1< T1, T2
894  , EnableIf_t< IsMatrix_v<T1> &&
895  IsNumeric_v<T2> &&
896  ( IsSymmetric_v<T1> && !IsDiagonal_v<T1> && !IsUniform_v<T1> ) > >
897 {
898  using Type = SymmetricMatrix< typename MultTraitEval2<T1,T2>::Type >;
899 };
900 
901 template< typename T1, typename T2 >
902 struct MultTraitEval1< T1, T2
903  , EnableIf_t< IsNumeric_v<T1> &&
904  IsMatrix_v<T2> &&
905  ( IsSymmetric_v<T2> && !IsDiagonal_v<T2> && !IsUniform_v<T2> ) > >
906 {
907  using Type = SymmetricMatrix< typename MultTraitEval2<T1,T2>::Type >;
908 };
910 //*************************************************************************************************
911 
912 
913 
914 
915 //=================================================================================================
916 //
917 // DIVTRAIT SPECIALIZATIONS
918 //
919 //=================================================================================================
920 
921 //*************************************************************************************************
923 template< typename T1, typename T2 >
924 struct DivTraitEval1< T1, T2
925  , EnableIf_t< IsSymmetric_v<T1> && !IsDiagonal_v<T1> && IsNumeric_v<T2> > >
926 {
927  using Type = SymmetricMatrix< typename DivTraitEval2<T1,T2>::Type >;
928 };
930 //*************************************************************************************************
931 
932 
933 
934 
935 //=================================================================================================
936 //
937 // MAPTRAIT SPECIALIZATIONS
938 //
939 //=================================================================================================
940 
941 //*************************************************************************************************
943 template< typename T, typename OP >
944 struct UnaryMapTraitEval1< T, OP
945  , EnableIf_t< YieldsSymmetric_v<OP,T> &&
946  !YieldsHermitian_v<OP,T> &&
947  !YieldsDiagonal_v<OP,T> &&
948  !YieldsIdentity_v<OP,T> > >
949 {
950  using Type = SymmetricMatrix< typename UnaryMapTraitEval2<T,OP>::Type, StorageOrder_v<T> >;
951 };
953 //*************************************************************************************************
954 
955 
956 //*************************************************************************************************
958 template< typename T1, typename T2, typename OP >
959 struct BinaryMapTraitEval1< T1, T2, OP
960  , EnableIf_t< YieldsSymmetric_v<OP,T1,T2> &&
961  !YieldsHermitian_v<OP,T1,T2> &&
962  !YieldsDiagonal_v<OP,T1,T2> &&
963  !YieldsIdentity_v<OP,T1,T2> > >
964 {
965  using Type = SymmetricMatrix< typename BinaryMapTraitEval2<T1,T2,OP>::Type >;
966 };
968 //*************************************************************************************************
969 
970 
971 
972 
973 //=================================================================================================
974 //
975 // DECLSYMTRAIT SPECIALIZATIONS
976 //
977 //=================================================================================================
978 
979 //*************************************************************************************************
981 template< typename MT, bool SO, bool DF, bool NF >
982 struct DeclSymTrait< SymmetricMatrix<MT,SO,DF,NF> >
983 {
984  using Type = SymmetricMatrix<MT,SO,DF,NF>;
985 };
987 //*************************************************************************************************
988 
989 
990 
991 
992 //=================================================================================================
993 //
994 // DECLHERMTRAIT SPECIALIZATIONS
995 //
996 //=================================================================================================
997 
998 //*************************************************************************************************
1000 template< typename MT, bool SO, bool DF, bool NF >
1001 struct DeclHermTrait< SymmetricMatrix<MT,SO,DF,NF> >
1002 {
1003  using Type = HermitianMatrix<MT>;
1004 };
1006 //*************************************************************************************************
1007 
1008 
1009 
1010 
1011 //=================================================================================================
1012 //
1013 // DECLLOWTRAIT SPECIALIZATIONS
1014 //
1015 //=================================================================================================
1016 
1017 //*************************************************************************************************
1019 template< typename MT, bool SO, bool DF, bool NF >
1020 struct DeclLowTrait< SymmetricMatrix<MT,SO,DF,NF> >
1021 {
1022  using Type = DiagonalMatrix<MT>;
1023 };
1025 //*************************************************************************************************
1026 
1027 
1028 
1029 
1030 //=================================================================================================
1031 //
1032 // DECLUPPTRAIT SPECIALIZATIONS
1033 //
1034 //=================================================================================================
1035 
1036 //*************************************************************************************************
1038 template< typename MT, bool SO, bool DF, bool NF >
1039 struct DeclUppTrait< SymmetricMatrix<MT,SO,DF,NF> >
1040 {
1041  using Type = DiagonalMatrix<MT>;
1042 };
1044 //*************************************************************************************************
1045 
1046 
1047 
1048 
1049 //=================================================================================================
1050 //
1051 // DECLDIAGTRAIT SPECIALIZATIONS
1052 //
1053 //=================================================================================================
1054 
1055 //*************************************************************************************************
1057 template< typename MT, bool SO, bool DF, bool NF >
1058 struct DeclDiagTrait< SymmetricMatrix<MT,SO,DF,NF> >
1059 {
1060  using Type = DiagonalMatrix<MT>;
1061 };
1063 //*************************************************************************************************
1064 
1065 
1066 
1067 
1068 //=================================================================================================
1069 //
1070 // HIGHTYPE SPECIALIZATIONS
1071 //
1072 //=================================================================================================
1073 
1074 //*************************************************************************************************
1076 template< typename MT1, bool SO1, bool DF1, bool NF1, typename MT2, bool SO2, bool DF2, bool NF2 >
1077 struct HighType< SymmetricMatrix<MT1,SO1,DF1,NF1>, SymmetricMatrix<MT2,SO2,DF2,NF2> >
1078 {
1079  using Type = SymmetricMatrix< typename HighType<MT1,MT2>::Type >;
1080 };
1082 //*************************************************************************************************
1083 
1084 
1085 
1086 
1087 //=================================================================================================
1088 //
1089 // LOWTYPE SPECIALIZATIONS
1090 //
1091 //=================================================================================================
1092 
1093 //*************************************************************************************************
1095 template< typename MT1, bool SO1, bool DF1, bool NF1, typename MT2, bool SO2, bool DF2, bool NF2 >
1096 struct LowType< SymmetricMatrix<MT1,SO1,DF1,NF1>, SymmetricMatrix<MT2,SO2,DF2,NF2> >
1097 {
1098  using Type = SymmetricMatrix< typename LowType<MT1,MT2>::Type >;
1099 };
1101 //*************************************************************************************************
1102 
1103 
1104 
1105 
1106 //=================================================================================================
1107 //
1108 // SUBMATRIXTRAIT SPECIALIZATIONS
1109 //
1110 //=================================================================================================
1111 
1112 //*************************************************************************************************
1114 template< typename MT, size_t I, size_t N >
1115 struct SubmatrixTraitEval1< MT, I, I, N, N
1116  , EnableIf_t< IsSymmetric_v<MT> &&
1117  !IsDiagonal_v<MT> > >
1118 {
1119  using Type = SymmetricMatrix< typename SubmatrixTraitEval2<MT,I,I,N,N>::Type >;
1120 };
1122 //*************************************************************************************************
1123 
1124 } // namespace blaze
1125 
1126 #endif
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
Headerfile for the generic min algorithm.
Header file for the decldiag trait.
Header file for the Schur product 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
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.The IsMatrix_v variable template provides a c...
Definition: IsMatrix.h:139
Header file for the declherm trait.
Flag for the inversion of a upper unitriangular matrix.
Definition: InversionFlag.h:114
Flag for the inversion of a lower unitriangular matrix.
Definition: InversionFlag.h:112
Header file for the IsDiagonal type trait.
Header file for the dense matrix inversion flags.
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:591
Header file for the YieldsIdentity type trait.
Matrix adapter for symmetric matrices.
Definition: BaseTemplate.h:608
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the MaxSize type trait.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
constexpr bool YieldsSymmetric_v
Auxiliary variable template for the YieldsSymmetric type trait.The YieldsSymmetric_v variable templat...
Definition: YieldsSymmetric.h:125
Header file for the implementation of the base template of the SymmetricMatrix.
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is an identity matrix.
Definition: DenseMatrix.h:1644
Header file for the IsMatrix type trait.
Header file for the IsSquare type trait.
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
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:775
Constraint on the data type.
SymmetricMatrix specialization for dense matrices with non-numeric element type.
Header file for the LowType type trait.
Header file for the IsUniform type trait.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
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.
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1147
SymmetricMatrix specialization for sparse matrices with numeric element type.
Header file for the decllow trait.
constexpr bool IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.The IsNumeric_v variable template provides a...
Definition: IsNumeric.h:143
Flag for the inversion of a Hermitian matrix (same as byLDLH).
Definition: InversionFlag.h:110
Header file for the IsAligned type trait.
Flag for the Bunch-Kaufman-based inversion for symmetric matrices.
Definition: InversionFlag.h:104
constexpr bool IsSymmetric_v
Auxiliary variable template for the IsSymmetric type trait.The IsSymmetric_v variable template provid...
Definition: IsSymmetric.h:171
Header file for the exception macros of the math module.
Header file for the RemoveAdaptor type trait.
Constraint on the data type.
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:360
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:611
Header file for the IsPadded type trait.
Header file for the IsAdaptor type trait.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
Header file for the declupp trait.
SymmetricMatrix specialization for sparse matrices with non-numeric element type. ...
Flag for the inversion of a symmetric matrix (same as byLDLT).
Definition: InversionFlag.h:109
Header file for run time assertion macros.
Header file for the YieldsSymmetric type trait.
Header file for the addition trait.
Header file for the division trait.
Header file for the submatrix trait.
Header file for the IsContiguous type trait.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
Header file for the IsZero type trait.
Header file for the declsym 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:281
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
#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
bool isSymmetric(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is symmetric.
Definition: DenseMatrix.h:539
#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
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
SymmetricMatrix specialization for dense matrices with numeric element type.
Header file for the YieldsDiagonal type trait.
Header file for the IsBuiltin type trait.
Header file for the isDivisor shim.
Header file for the StorageOrder type trait.
Header file for the map trait.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:631
Header file for the YieldsHermitian type trait.
Header file for the IsHermitian type trait.
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
Header file for the Size type trait.
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.