StrictlyUpperMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_STRICTLYUPPERMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_STRICTLYUPPERMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
49 #include <blaze/math/Forward.h>
50 #include <blaze/math/Functions.h>
73 #include <blaze/util/Assert.h>
74 #include <blaze/util/EnableIf.h>
76 #include <blaze/util/TrueType.h>
78 #include <blaze/util/Unused.h>
79 
80 
81 namespace blaze {
82 
83 //=================================================================================================
84 //
85 // STRICTLYUPPERMATRIX OPERATORS
86 //
87 //=================================================================================================
88 
89 //*************************************************************************************************
92 template< typename MT, bool SO, bool DF >
93 inline void reset( StrictlyUpperMatrix<MT,SO,DF>& m );
94 
95 template< typename MT, bool SO, bool DF >
96 inline void reset( StrictlyUpperMatrix<MT,SO,DF>& m, size_t i );
97 
98 template< typename MT, bool SO, bool DF >
99 inline void clear( StrictlyUpperMatrix<MT,SO,DF>& m );
100 
101 template< typename MT, bool SO, bool DF >
102 inline bool isDefault( const StrictlyUpperMatrix<MT,SO,DF>& m );
103 
104 template< typename MT, bool SO, bool DF >
105 inline bool isIntact( const StrictlyUpperMatrix<MT,SO,DF>& m );
106 
107 template< typename MT, bool SO, bool DF >
108 inline void swap( StrictlyUpperMatrix<MT,SO,DF>& a, StrictlyUpperMatrix<MT,SO,DF>& b ) noexcept;
110 //*************************************************************************************************
111 
112 
113 //*************************************************************************************************
120 template< typename MT // Type of the adapted matrix
121  , bool SO // Storage order of the adapted matrix
122  , bool DF > // Density flag
124 {
125  m.reset();
126 }
127 //*************************************************************************************************
128 
129 
130 //*************************************************************************************************
143 template< typename MT // Type of the adapted matrix
144  , bool SO // Storage order of the adapted matrix
145  , bool DF > // Density flag
146 inline void reset( StrictlyUpperMatrix<MT,SO,DF>& m, size_t i )
147 {
148  m.reset( i );
149 }
150 //*************************************************************************************************
151 
152 
153 //*************************************************************************************************
160 template< typename MT // Type of the adapted matrix
161  , bool SO // Storage order of the adapted matrix
162  , bool DF > // Density flag
164 {
165  m.clear();
166 }
167 //*************************************************************************************************
168 
169 
170 //*************************************************************************************************
181 template< typename MT // Type of the adapted matrix
182  , bool SO // Storage order of the adapted matrix
183  , bool DF > // Density flag
184 inline bool isDefault_backend( const StrictlyUpperMatrix<MT,SO,DF>& m, TrueType )
185 {
186  return ( m.rows() == 0UL );
187 }
189 //*************************************************************************************************
190 
191 
192 //*************************************************************************************************
203 template< typename MT // Type of the adapted matrix
204  , bool SO // Storage order of the adapted matrix
205  , bool DF > // Density flag
206 inline bool isDefault_backend( const StrictlyUpperMatrix<MT,SO,DF>& m, FalseType )
207 {
208  return isIdentity( m );
209 }
211 //*************************************************************************************************
212 
213 
214 //*************************************************************************************************
234 template< typename MT // Type of the adapted matrix
235  , bool SO // Storage order of the adapted matrix
236  , bool DF > // Density flag
238 {
239  return isDefault_backend( m, typename IsResizable<MT>::Type() );
240 }
241 //*************************************************************************************************
242 
243 
244 //*************************************************************************************************
265 template< typename MT // Type of the adapted matrix
266  , bool SO // Storage order of the adapted matrix
267  , bool DF > // Density flag
269 {
270  return m.isIntact();
271 }
272 //*************************************************************************************************
273 
274 
275 //*************************************************************************************************
283 template< typename MT // Type of the adapted matrix
284  , bool SO // Storage order of the adapted matrix
285  , bool DF > // Density flag
287 {
288  a.swap( b );
289 }
290 //*************************************************************************************************
291 
292 
293 //*************************************************************************************************
310 template< typename MT // Type of the adapted matrix
311  , bool SO // Storage order of the adapted matrix
312  , bool DF // Density flag
313  , typename VT > // Type of the right-hand side dense vector
314 inline bool tryAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
315  const DenseVector<VT,false>& rhs, size_t row, size_t column )
316 {
318 
319  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
320  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
321  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
322 
323  UNUSED_PARAMETER( lhs );
324 
325  const size_t ibegin( ( column <= row )?( 0UL ):( column - row ) );
326 
327  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
328  if( !isDefault( (~rhs)[i] ) )
329  return false;
330  }
331 
332  return true;
333 }
335 //*************************************************************************************************
336 
337 
338 //*************************************************************************************************
355 template< typename MT // Type of the adapted matrix
356  , bool SO // Storage order of the adapted matrix
357  , bool DF // Density flag
358  , typename VT > // Type of the right-hand side dense vector
359 inline bool tryAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
360  const DenseVector<VT,true>& rhs, size_t row, size_t column )
361 {
363 
364  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
365  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
366  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
367 
368  UNUSED_PARAMETER( lhs );
369 
370  if( row < column )
371  return true;
372 
373  const size_t iend( min( row - column + 1UL, (~rhs).size() ) );
374 
375  for( size_t i=0UL; i<iend; ++i ) {
376  if( !isDefault( (~rhs)[i] ) )
377  return false;
378  }
379 
380  return true;
381 }
383 //*************************************************************************************************
384 
385 
386 //*************************************************************************************************
403 template< typename MT // Type of the adapted matrix
404  , bool SO // Storage order of the adapted matrix
405  , bool DF // Density flag
406  , typename VT > // Type of the right-hand side sparse vector
407 inline bool tryAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
408  const SparseVector<VT,false>& rhs, size_t row, size_t column )
409 {
411 
412  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
413  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
414  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
415 
416  UNUSED_PARAMETER( lhs );
417 
418  typedef typename VT::ConstIterator RhsIterator;
419 
420  const RhsIterator last( (~rhs).end() );
421  RhsIterator element( (~rhs).lowerBound( ( column <= row )?( 0UL ):( column - row ) ) );
422 
423  for( ; element!=last; ++element ) {
424  if( !isDefault( element->value() ) )
425  return false;
426  }
427 
428  return true;
429 }
431 //*************************************************************************************************
432 
433 
434 //*************************************************************************************************
451 template< typename MT // Type of the adapted matrix
452  , bool SO // Storage order of the adapted matrix
453  , bool DF // Density flag
454  , typename VT > // Type of the right-hand side sparse vector
455 inline bool tryAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
456  const SparseVector<VT,true>& rhs, size_t row, size_t column )
457 {
459 
460  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
461  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
462  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
463 
464  UNUSED_PARAMETER( lhs );
465 
466  typedef typename VT::ConstIterator RhsIterator;
467 
468  if( row < column )
469  return true;
470 
471  const RhsIterator last( (~rhs).lowerBound( row - column + 1UL ) );
472 
473  for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
474  if( !isDefault( element->value() ) )
475  return false;
476  }
477 
478  return true;
479 }
481 //*************************************************************************************************
482 
483 
484 //*************************************************************************************************
501 template< typename MT1 // Type of the adapted matrix
502  , bool SO // Storage order of the adapted matrix
503  , bool DF // Density flag
504  , typename MT2 > // Type of the right-hand side dense matrix
505 inline bool tryAssign( const StrictlyUpperMatrix<MT1,SO,DF>& lhs,
506  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
507 {
509 
510  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
511  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
512  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
513  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
514 
515  UNUSED_PARAMETER( lhs );
516 
517  const size_t M( (~rhs).rows() );
518  const size_t N( (~rhs).columns() );
519 
520  if( column + 1UL >= row + M )
521  return true;
522 
523  const size_t ibegin( ( column <= row )?( 0UL ):( column - row ) );
524 
525  for( size_t i=ibegin; i<M; ++i )
526  {
527  const size_t jend( min( row + i - column + 1UL, N ) );
528 
529  for( size_t j=0UL; j<jend; ++j ) {
530  if( !isDefault( (~rhs)(i,j) ) )
531  return false;
532  }
533  }
534 
535  return true;
536 }
538 //*************************************************************************************************
539 
540 
541 //*************************************************************************************************
558 template< typename MT1 // Type of the adapted matrix
559  , bool SO // Storage order of the adapted matrix
560  , bool DF // Density flag
561  , typename MT2 > // Type of the right-hand side dense matrix
562 inline bool tryAssign( const StrictlyUpperMatrix<MT1,SO,DF>& lhs,
563  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
564 {
566 
567  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
568  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
569  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
570  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
571 
572  UNUSED_PARAMETER( lhs );
573 
574  const size_t M( (~rhs).rows() );
575  const size_t N( (~rhs).columns() );
576 
577  if( column + 1UL >= row + M )
578  return true;
579 
580  const size_t jend( min( row + M - column, N ) );
581 
582  for( size_t j=0UL; j<jend; ++j )
583  {
584  const bool containsDiagonal( column + j >= row );
585  const size_t ibegin( ( containsDiagonal )?( column + j - row ):( 0UL ) );
586 
587  for( size_t i=ibegin; i<M; ++i ) {
588  if( !isDefault( (~rhs)(i,j) ) )
589  return false;
590  }
591  }
592 
593  return true;
594 }
596 //*************************************************************************************************
597 
598 
599 //*************************************************************************************************
616 template< typename MT1 // Type of the adapted matrix
617  , bool SO // Storage order of the adapted matrix
618  , bool DF // Density flag
619  , typename MT2 > // Type of the right-hand side sparse matrix
620 inline bool tryAssign( const StrictlyUpperMatrix<MT1,SO,DF>& lhs,
621  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
622 {
624 
625  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
626  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
627  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
628  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
629 
630  UNUSED_PARAMETER( lhs );
631 
632  typedef typename MT2::ConstIterator RhsIterator;
633 
634  const size_t M( (~rhs).rows() );
635  const size_t N( (~rhs).columns() );
636 
637  if( column + 1UL >= row + M )
638  return true;
639 
640  const size_t ibegin( ( column < row )?( 0UL ):( column - row ) );
641 
642  for( size_t i=ibegin; i<M; ++i )
643  {
644  const size_t index( row + i - column + 1UL );
645  const RhsIterator last( (~rhs).lowerBound( i, min( index, N ) ) );
646 
647  for( RhsIterator element=(~rhs).begin(i); element!=last; ++element ) {
648  if( !isDefault( element->value() ) )
649  return false;
650  }
651  }
652 
653  return true;
654 }
656 //*************************************************************************************************
657 
658 
659 //*************************************************************************************************
676 template< typename MT1 // Type of the adapted matrix
677  , bool SO // Storage order of the adapted matrix
678  , bool DF // Density flag
679  , typename MT2 > // Type of the right-hand side sparse matrix
680 inline bool tryAssign( const StrictlyUpperMatrix<MT1,SO,DF>& lhs,
681  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
682 {
684 
685  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
686  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
687  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
688  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
689 
690  UNUSED_PARAMETER( lhs );
691 
692  typedef typename MT2::ConstIterator RhsIterator;
693 
694  const size_t M( (~rhs).rows() );
695  const size_t N( (~rhs).columns() );
696 
697  if( column + 1UL >= row + M )
698  return true;
699 
700  const size_t jend( min( row + M - column, N ) );
701 
702  for( size_t j=0UL; j<jend; ++j )
703  {
704  const bool containsDiagonal( column + j >= row );
705  const size_t index( ( containsDiagonal )?( column + j - row ):( 0UL ) );
706 
707  const RhsIterator last( (~rhs).end(j) );
708  RhsIterator element( (~rhs).lowerBound( index, j ) );
709 
710  for( ; element!=last; ++element ) {
711  if( !isDefault( element->value() ) )
712  return false;
713  }
714  }
715 
716  return true;
717 }
719 //*************************************************************************************************
720 
721 
722 //*************************************************************************************************
739 template< typename MT // Type of the adapted matrix
740  , bool SO // Storage order of the adapted matrix
741  , bool DF // Density flag
742  , typename VT // Type of the right-hand side vector
743  , bool TF > // Transpose flag of the right-hand side vector
744 inline bool tryAddAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
745  const Vector<VT,TF>& rhs, size_t row, size_t column )
746 {
747  return tryAssign( lhs, ~rhs, row, column );
748 }
750 //*************************************************************************************************
751 
752 
753 //*************************************************************************************************
770 template< typename MT1 // Type of the adapted matrix
771  , bool SO1 // Storage order of the adapted matrix
772  , bool DF // Density flag
773  , typename MT2 // Type of the right-hand side matrix
774  , bool SO2 > // Storage order of the right-hand side matrix
775 inline bool tryAddAssign( const StrictlyUpperMatrix<MT1,SO1,DF>& lhs,
776  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
777 {
778  return tryAssign( lhs, ~rhs, row, column );
779 }
781 //*************************************************************************************************
782 
783 
784 //*************************************************************************************************
801 template< typename MT // Type of the adapted matrix
802  , bool SO // Storage order of the adapted matrix
803  , bool DF // Density flag
804  , typename VT // Type of the right-hand side vector
805  , bool TF > // Transpose flag of the right-hand side vector
806 inline bool trySubAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
807  const Vector<VT,TF>& rhs, size_t row, size_t column )
808 {
809  return tryAssign( lhs, ~rhs, row, column );
810 }
812 //*************************************************************************************************
813 
814 
815 //*************************************************************************************************
832 template< typename MT1 // Type of the adapted matrix
833  , bool SO1 // Storage order of the adapted matrix
834  , bool DF // Density flag
835  , typename MT2 // Type of the right-hand side matrix
836  , bool SO2 > // Storage order of the right-hand side matrix
837 inline bool trySubAssign( const StrictlyUpperMatrix<MT1,SO1,DF>& lhs,
838  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
839 {
840  return tryAssign( lhs, ~rhs, row, column );
841 }
843 //*************************************************************************************************
844 
845 
846 //*************************************************************************************************
860 template< typename MT // Type of the adapted matrix
861  , bool SO // Storage order of the adapted matrix
862  , bool DF > // Density flag
863 inline MT& derestrict( StrictlyUpperMatrix<MT,SO,DF>& m )
864 {
865  return m.matrix_;
866 }
868 //*************************************************************************************************
869 
870 
871 
872 
873 //=================================================================================================
874 //
875 // ROWS SPECIALIZATIONS
876 //
877 //=================================================================================================
878 
879 //*************************************************************************************************
881 template< typename MT, bool SO, bool DF >
882 struct Rows< StrictlyUpperMatrix<MT,SO,DF> > : public Rows<MT>
883 {};
885 //*************************************************************************************************
886 
887 
888 
889 
890 //=================================================================================================
891 //
892 // COLUMNS SPECIALIZATIONS
893 //
894 //=================================================================================================
895 
896 //*************************************************************************************************
898 template< typename MT, bool SO, bool DF >
899 struct Columns< StrictlyUpperMatrix<MT,SO,DF> > : public Columns<MT>
900 {};
902 //*************************************************************************************************
903 
904 
905 
906 
907 //=================================================================================================
908 //
909 // ISSQUARE SPECIALIZATIONS
910 //
911 //=================================================================================================
912 
913 //*************************************************************************************************
915 template< typename MT, bool SO, bool DF >
916 struct IsSquare< StrictlyUpperMatrix<MT,SO,DF> > : public TrueType
917 {};
919 //*************************************************************************************************
920 
921 
922 
923 
924 //=================================================================================================
925 //
926 // ISSTRICTLYUPPER SPECIALIZATIONS
927 //
928 //=================================================================================================
929 
930 //*************************************************************************************************
932 template< typename MT, bool SO, bool DF >
933 struct IsStrictlyUpper< StrictlyUpperMatrix<MT,SO,DF> > : public TrueType
934 {};
936 //*************************************************************************************************
937 
938 
939 
940 
941 //=================================================================================================
942 //
943 // ISADAPTOR SPECIALIZATIONS
944 //
945 //=================================================================================================
946 
947 //*************************************************************************************************
949 template< typename MT, bool SO, bool DF >
950 struct IsAdaptor< StrictlyUpperMatrix<MT,SO,DF> > : public TrueType
951 {};
953 //*************************************************************************************************
954 
955 
956 
957 
958 //=================================================================================================
959 //
960 // ISRESTRICTED SPECIALIZATIONS
961 //
962 //=================================================================================================
963 
964 //*************************************************************************************************
966 template< typename MT, bool SO, bool DF >
967 struct IsRestricted< StrictlyUpperMatrix<MT,SO,DF> > : public TrueType
968 {};
970 //*************************************************************************************************
971 
972 
973 
974 
975 //=================================================================================================
976 //
977 // HASCONSTDATAACCESS SPECIALIZATIONS
978 //
979 //=================================================================================================
980 
981 //*************************************************************************************************
983 template< typename MT, bool SO >
984 struct HasConstDataAccess< StrictlyUpperMatrix<MT,SO,true> > : public TrueType
985 {};
987 //*************************************************************************************************
988 
989 
990 
991 
992 //=================================================================================================
993 //
994 // ISALIGNED SPECIALIZATIONS
995 //
996 //=================================================================================================
997 
998 //*************************************************************************************************
1000 template< typename MT, bool SO, bool DF >
1001 struct IsAligned< StrictlyUpperMatrix<MT,SO,DF> > : public BoolConstant< IsAligned<MT>::value >
1002 {};
1004 //*************************************************************************************************
1005 
1006 
1007 
1008 
1009 //=================================================================================================
1010 //
1011 // ISPADDED SPECIALIZATIONS
1012 //
1013 //=================================================================================================
1014 
1015 //*************************************************************************************************
1017 template< typename MT, bool SO, bool DF >
1018 struct IsPadded< StrictlyUpperMatrix<MT,SO,DF> > : public BoolConstant< IsPadded<MT>::value >
1019 {};
1021 //*************************************************************************************************
1022 
1023 
1024 
1025 
1026 //=================================================================================================
1027 //
1028 // ISRESIZABLE SPECIALIZATIONS
1029 //
1030 //=================================================================================================
1031 
1032 //*************************************************************************************************
1034 template< typename MT, bool SO, bool DF >
1035 struct IsResizable< StrictlyUpperMatrix<MT,SO,DF> > : public BoolConstant< IsResizable<MT>::value >
1036 {};
1038 //*************************************************************************************************
1039 
1040 
1041 
1042 
1043 //=================================================================================================
1044 //
1045 // REMOVEADAPTOR SPECIALIZATIONS
1046 //
1047 //=================================================================================================
1048 
1049 //*************************************************************************************************
1051 template< typename MT, bool SO, bool DF >
1052 struct RemoveAdaptor< StrictlyUpperMatrix<MT,SO,DF> >
1053 {
1054  using Type = MT;
1055 };
1057 //*************************************************************************************************
1058 
1059 
1060 
1061 
1062 //=================================================================================================
1063 //
1064 // DERESTRICTTRAIT SPECIALIZATIONS
1065 //
1066 //=================================================================================================
1067 
1068 //*************************************************************************************************
1070 template< typename MT, bool SO, bool DF >
1071 struct DerestrictTrait< StrictlyUpperMatrix<MT,SO,DF> >
1072 {
1073  using Type = MT&;
1074 };
1076 //*************************************************************************************************
1077 
1078 
1079 
1080 
1081 //=================================================================================================
1082 //
1083 // ADDTRAIT SPECIALIZATIONS
1084 //
1085 //=================================================================================================
1086 
1087 //*************************************************************************************************
1089 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1090 struct AddTrait< StrictlyUpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1091 {
1092  using Type = AddTrait_< MT, StaticMatrix<T,M,N,SO2> >;
1093 };
1094 
1095 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1096 struct AddTrait< StaticMatrix<T,M,N,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1097 {
1098  using Type = AddTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1099 };
1100 
1101 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1102 struct AddTrait< StrictlyUpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1103 {
1104  using Type = AddTrait_< MT, HybridMatrix<T,M,N,SO2> >;
1105 };
1106 
1107 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1108 struct AddTrait< HybridMatrix<T,M,N,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1109 {
1110  using Type = AddTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1111 };
1112 
1113 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1114 struct AddTrait< StrictlyUpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1115 {
1116  using Type = AddTrait_< MT, DynamicMatrix<T,SO2> >;
1117 };
1118 
1119 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1120 struct AddTrait< DynamicMatrix<T,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1121 {
1122  using Type = AddTrait_< DynamicMatrix<T,SO1>, MT >;
1123 };
1124 
1125 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1126 struct AddTrait< StrictlyUpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1127 {
1128  using Type = AddTrait_< MT, CustomMatrix<T,AF,PF,SO2> >;
1129 };
1130 
1131 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1132 struct AddTrait< CustomMatrix<T,AF,PF,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1133 {
1134  using Type = AddTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1135 };
1136 
1137 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1138 struct AddTrait< StrictlyUpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1139 {
1140  using Type = AddTrait_< MT, CompressedMatrix<T,SO2> >;
1141 };
1142 
1143 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1144 struct AddTrait< CompressedMatrix<T,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1145 {
1146  using Type = AddTrait_< CompressedMatrix<T,SO1>, MT >;
1147 };
1148 
1149 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1150 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1151 {
1152  using Type = AddTrait_<MT1,MT2>;
1153 };
1154 
1155 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1156 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1157 {
1158  using Type = AddTrait_<MT1,MT2>;
1159 };
1160 
1161 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1162 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1163 {
1164  using Type = AddTrait_<MT1,MT2>;
1165 };
1166 
1167 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1168 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1169 {
1170  using Type = AddTrait_<MT1,MT2>;
1171 };
1172 
1173 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1174 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1175 {
1176  using Type = AddTrait_<MT1,MT2>;
1177 };
1178 
1179 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1180 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1181 {
1182  using Type = AddTrait_<MT1,MT2>;
1183 };
1184 
1185 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1186 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1187 {
1188  using Type = AddTrait_<MT1,MT2>;
1189 };
1190 
1191 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1192 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1193 {
1194  using Type = AddTrait_<MT1,MT2>;
1195 };
1196 
1197 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1198 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1199 {
1200  using Type = AddTrait_<MT1,MT2>;
1201 };
1202 
1203 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1204 struct AddTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1205 {
1206  using Type = AddTrait_<MT1,MT2>;
1207 };
1208 
1209 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1210 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1211 {
1212  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
1213 };
1214 
1215 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1216 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1217 {
1218  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
1219 };
1220 
1221 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1222 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1223 {
1224  using Type = UniUpperMatrix< AddTrait_<MT1,MT2> >;
1225 };
1226 
1227 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1228 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1229 {
1230  using Type = UniUpperMatrix< AddTrait_<MT1,MT2> >;
1231 };
1232 
1233 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1234 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1235 {
1236  using Type = StrictlyUpperMatrix< AddTrait_<MT1,MT2> >;
1237 };
1239 //*************************************************************************************************
1240 
1241 
1242 
1243 
1244 //=================================================================================================
1245 //
1246 // SUBTRAIT SPECIALIZATIONS
1247 //
1248 //=================================================================================================
1249 
1250 //*************************************************************************************************
1252 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1253 struct SubTrait< StrictlyUpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1254 {
1255  using Type = SubTrait_< MT, StaticMatrix<T,M,N,SO2> >;
1256 };
1257 
1258 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1259 struct SubTrait< StaticMatrix<T,M,N,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1260 {
1261  using Type = SubTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1262 };
1263 
1264 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1265 struct SubTrait< StrictlyUpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1266 {
1267  using Type = SubTrait_< MT, HybridMatrix<T,M,N,SO2> >;
1268 };
1269 
1270 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1271 struct SubTrait< HybridMatrix<T,M,N,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1272 {
1273  using Type = SubTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1274 };
1275 
1276 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1277 struct SubTrait< StrictlyUpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1278 {
1279  using Type = SubTrait_< MT, DynamicMatrix<T,SO2> >;
1280 };
1281 
1282 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1283 struct SubTrait< DynamicMatrix<T,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1284 {
1285  using Type = SubTrait_< DynamicMatrix<T,SO1>, MT >;
1286 };
1287 
1288 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1289 struct SubTrait< StrictlyUpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1290 {
1291  using Type = SubTrait_< MT, CustomMatrix<T,AF,PF,SO2> >;
1292 };
1293 
1294 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1295 struct SubTrait< CustomMatrix<T,AF,PF,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1296 {
1297  using Type = SubTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1298 };
1299 
1300 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1301 struct SubTrait< StrictlyUpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1302 {
1303  using Type = SubTrait_< MT, CompressedMatrix<T,SO2> >;
1304 };
1305 
1306 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1307 struct SubTrait< CompressedMatrix<T,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1308 {
1309  using Type = SubTrait_< CompressedMatrix<T,SO1>, MT >;
1310 };
1311 
1312 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1313 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1314 {
1315  using Type = SubTrait_<MT1,MT2>;
1316 };
1317 
1318 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1319 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1320 {
1321  using Type = SubTrait_<MT1,MT2>;
1322 };
1323 
1324 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1325 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1326 {
1327  using Type = SubTrait_<MT1,MT2>;
1328 };
1329 
1330 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1331 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1332 {
1333  using Type = SubTrait_<MT1,MT2>;
1334 };
1335 
1336 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1337 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1338 {
1339  using Type = SubTrait_<MT1,MT2>;
1340 };
1341 
1342 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1343 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1344 {
1345  using Type = SubTrait_<MT1,MT2>;
1346 };
1347 
1348 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1349 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1350 {
1351  using Type = SubTrait_<MT1,MT2>;
1352 };
1353 
1354 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1355 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1356 {
1357  using Type = SubTrait_<MT1,MT2>;
1358 };
1359 
1360 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1361 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1362 {
1363  using Type = SubTrait_<MT1,MT2>;
1364 };
1365 
1366 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1367 struct SubTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1368 {
1369  using Type = SubTrait_<MT1,MT2>;
1370 };
1371 
1372 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1373 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1374 {
1375  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
1376 };
1377 
1378 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1379 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1380 {
1381  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
1382 };
1383 
1384 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1385 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1386 {
1387  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
1388 };
1389 
1390 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1391 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1392 {
1393  using Type = UniUpperMatrix< SubTrait_<MT1,MT2> >;
1394 };
1395 
1396 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1397 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1398 {
1399  using Type = StrictlyUpperMatrix< SubTrait_<MT1,MT2> >;
1400 };
1402 //*************************************************************************************************
1403 
1404 
1405 
1406 
1407 //=================================================================================================
1408 //
1409 // MULTTRAIT SPECIALIZATIONS
1410 //
1411 //=================================================================================================
1412 
1413 //*************************************************************************************************
1415 template< typename MT, bool SO, bool DF, typename T >
1416 struct MultTrait< StrictlyUpperMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
1417 {
1418  using Type = StrictlyUpperMatrix< MultTrait_<MT,T> >;
1419 };
1420 
1421 template< typename T, typename MT, bool SO, bool DF >
1422 struct MultTrait< T, StrictlyUpperMatrix<MT,SO,DF>, EnableIf_< IsNumeric<T> > >
1423 {
1424  using Type = StrictlyUpperMatrix< MultTrait_<T,MT> >;
1425 };
1426 
1427 template< typename MT, bool SO, bool DF, typename T, size_t N >
1428 struct MultTrait< StrictlyUpperMatrix<MT,SO,DF>, StaticVector<T,N,false> >
1429 {
1430  using Type = MultTrait_< MT, StaticVector<T,N,false> >;
1431 };
1432 
1433 template< typename T, size_t N, typename MT, bool SO, bool DF >
1434 struct MultTrait< StaticVector<T,N,true>, StrictlyUpperMatrix<MT,SO,DF> >
1435 {
1436  using Type = MultTrait_< StaticVector<T,N,true>, MT >;
1437 };
1438 
1439 template< typename MT, bool SO, bool DF, typename T, size_t N >
1440 struct MultTrait< StrictlyUpperMatrix<MT,SO,DF>, HybridVector<T,N,false> >
1441 {
1442  using Type = MultTrait_< MT, HybridVector<T,N,false> >;
1443 };
1444 
1445 template< typename T, size_t N, typename MT, bool SO, bool DF >
1446 struct MultTrait< HybridVector<T,N,true>, StrictlyUpperMatrix<MT,SO,DF> >
1447 {
1448  using Type = MultTrait_< HybridVector<T,N,true>, MT >;
1449 };
1450 
1451 template< typename MT, bool SO, bool DF, typename T >
1452 struct MultTrait< StrictlyUpperMatrix<MT,SO,DF>, DynamicVector<T,false> >
1453 {
1454  using Type = MultTrait_< MT, DynamicVector<T,false> >;
1455 };
1456 
1457 template< typename T, typename MT, bool SO, bool DF >
1458 struct MultTrait< DynamicVector<T,true>, StrictlyUpperMatrix<MT,SO,DF> >
1459 {
1460  using Type = MultTrait_< DynamicVector<T,true>, MT >;
1461 };
1462 
1463 template< typename MT, bool SO, bool DF, typename T, bool AF, bool PF >
1464 struct MultTrait< StrictlyUpperMatrix<MT,SO,DF>, CustomVector<T,AF,PF,false> >
1465 {
1466  using Type = MultTrait_< MT, CustomVector<T,AF,PF,false> >;
1467 };
1468 
1469 template< typename T, bool AF, bool PF, typename MT, bool SO, bool DF >
1470 struct MultTrait< CustomVector<T,AF,PF,true>, StrictlyUpperMatrix<MT,SO,DF> >
1471 {
1472  using Type = MultTrait_< CustomVector<T,AF,PF,true>, MT >;
1473 };
1474 
1475 template< typename MT, bool SO, bool DF, typename T >
1476 struct MultTrait< StrictlyUpperMatrix<MT,SO,DF>, CompressedVector<T,false> >
1477 {
1478  using Type = MultTrait_< MT, CompressedVector<T,false> >;
1479 };
1480 
1481 template< typename T, typename MT, bool SO, bool DF >
1482 struct MultTrait< CompressedVector<T,true>, StrictlyUpperMatrix<MT,SO,DF> >
1483 {
1484  using Type = MultTrait_< CompressedVector<T,true>, MT >;
1485 };
1486 
1487 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1488 struct MultTrait< StrictlyUpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1489 {
1490  using Type = MultTrait_< MT, StaticMatrix<T,M,N,SO2> >;
1491 };
1492 
1493 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1494 struct MultTrait< StaticMatrix<T,M,N,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1495 {
1496  using Type = MultTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1497 };
1498 
1499 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1500 struct MultTrait< StrictlyUpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1501 {
1502  using Type = MultTrait_< MT, HybridMatrix<T,M,N,SO2> >;
1503 };
1504 
1505 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1506 struct MultTrait< HybridMatrix<T,M,N,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1507 {
1508  using Type = MultTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1509 };
1510 
1511 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1512 struct MultTrait< StrictlyUpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1513 {
1514  using Type = MultTrait_< MT, DynamicMatrix<T,SO2> >;
1515 };
1516 
1517 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1518 struct MultTrait< DynamicMatrix<T,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1519 {
1520  using Type = MultTrait_< DynamicMatrix<T,SO1>, MT >;
1521 };
1522 
1523 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1524 struct MultTrait< StrictlyUpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1525 {
1526  using Type = MultTrait_< MT, CustomMatrix<T,AF,PF,SO2> >;
1527 };
1528 
1529 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1530 struct MultTrait< CustomMatrix<T,AF,PF,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1531 {
1532  using Type = MultTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1533 };
1534 
1535 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1536 struct MultTrait< StrictlyUpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1537 {
1538  using Type = MultTrait_< MT, CompressedMatrix<T,SO2> >;
1539 };
1540 
1541 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1542 struct MultTrait< CompressedMatrix<T,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1543 {
1544  using Type = MultTrait_< CompressedMatrix<T,SO1>, MT >;
1545 };
1546 
1547 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1548 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1549 {
1550  using Type = MultTrait_<MT1,MT2>;
1551 };
1552 
1553 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1554 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1555 {
1556  using Type = MultTrait_<MT1,MT2>;
1557 };
1558 
1559 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1560 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1561 {
1562  using Type = MultTrait_<MT1,MT2>;
1563 };
1564 
1565 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1566 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1567 {
1568  using Type = MultTrait_<MT1,MT2>;
1569 };
1570 
1571 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1572 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1573 {
1574  using Type = MultTrait_<MT1,MT2>;
1575 };
1576 
1577 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1578 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1579 {
1580  using Type = MultTrait_<MT1,MT2>;
1581 };
1582 
1583 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1584 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1585 {
1586  using Type = MultTrait_<MT1,MT2>;
1587 };
1588 
1589 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1590 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1591 {
1592  using Type = MultTrait_<MT1,MT2>;
1593 };
1594 
1595 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1596 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1597 {
1598  using Type = MultTrait_<MT1,MT2>;
1599 };
1600 
1601 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1602 struct MultTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1603 {
1604  using Type = MultTrait_<MT1,MT2>;
1605 };
1606 
1607 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1608 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1609 {
1610  using Type = StrictlyUpperMatrix< MultTrait_<MT1,MT2> >;
1611 };
1612 
1613 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1614 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1615 {
1616  using Type = StrictlyUpperMatrix< MultTrait_<MT1,MT2> >;
1617 };
1618 
1619 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1620 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1621 {
1622  using Type = StrictlyUpperMatrix< MultTrait_<MT1,MT2> >;
1623 };
1624 
1625 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1626 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1627 {
1628  using Type = StrictlyUpperMatrix< MultTrait_<MT1,MT2> >;
1629 };
1630 
1631 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1632 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1633 {
1634  using Type = StrictlyUpperMatrix< MultTrait_<MT1,MT2> >;
1635 };
1637 //*************************************************************************************************
1638 
1639 
1640 
1641 
1642 //=================================================================================================
1643 //
1644 // DIVTRAIT SPECIALIZATIONS
1645 //
1646 //=================================================================================================
1647 
1648 //*************************************************************************************************
1650 template< typename MT, bool SO, bool DF, typename T >
1651 struct DivTrait< StrictlyUpperMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
1652 {
1653  using Type = StrictlyUpperMatrix< DivTrait_<MT,T> >;
1654 };
1656 //*************************************************************************************************
1657 
1658 
1659 
1660 
1661 //=================================================================================================
1662 //
1663 // FOREACHTRAIT SPECIALIZATIONS
1664 //
1665 //=================================================================================================
1666 
1667 //*************************************************************************************************
1669 template< typename MT, bool SO, bool DF >
1670 struct ForEachTrait< StrictlyUpperMatrix<MT,SO,DF>, Abs >
1671 {
1672  using Type = StrictlyUpperMatrix< ForEachTrait_<MT,Abs> >;
1673 };
1674 
1675 template< typename MT, bool SO, bool DF >
1676 struct ForEachTrait< StrictlyUpperMatrix<MT,SO,DF>, Floor >
1677 {
1678  using Type = StrictlyUpperMatrix< ForEachTrait_<MT,Floor> >;
1679 };
1680 
1681 template< typename MT, bool SO, bool DF >
1682 struct ForEachTrait< StrictlyUpperMatrix<MT,SO,DF>, Ceil >
1683 {
1684  using Type = StrictlyUpperMatrix< ForEachTrait_<MT,Ceil> >;
1685 };
1686 
1687 template< typename MT, bool SO, bool DF >
1688 struct ForEachTrait< StrictlyUpperMatrix<MT,SO,DF>, Conj >
1689 {
1690  using Type = StrictlyUpperMatrix< ForEachTrait_<MT,Conj> >;
1691 };
1692 
1693 template< typename MT, bool SO, bool DF >
1694 struct ForEachTrait< StrictlyUpperMatrix<MT,SO,DF>, Real >
1695 {
1696  using Type = StrictlyUpperMatrix< ForEachTrait_<MT,Real> >;
1697 };
1698 
1699 template< typename MT, bool SO, bool DF >
1700 struct ForEachTrait< StrictlyUpperMatrix<MT,SO,DF>, Imag >
1701 {
1702  using Type = StrictlyUpperMatrix< ForEachTrait_<MT,Imag> >;
1703 };
1704 
1705 template< typename MT, bool SO, bool DF >
1706 struct ForEachTrait< StrictlyUpperMatrix<MT,SO,DF>, Sin >
1707 {
1708  using Type = StrictlyUpperMatrix< ForEachTrait_<MT,Sin> >;
1709 };
1710 
1711 template< typename MT, bool SO, bool DF >
1712 struct ForEachTrait< StrictlyUpperMatrix<MT,SO,DF>, Asin >
1713 {
1714  using Type = StrictlyUpperMatrix< ForEachTrait_<MT,Asin> >;
1715 };
1716 
1717 template< typename MT, bool SO, bool DF >
1718 struct ForEachTrait< StrictlyUpperMatrix<MT,SO,DF>, Sinh >
1719 {
1720  using Type = StrictlyUpperMatrix< ForEachTrait_<MT,Sinh> >;
1721 };
1722 
1723 template< typename MT, bool SO, bool DF >
1724 struct ForEachTrait< StrictlyUpperMatrix<MT,SO,DF>, Asinh >
1725 {
1726  using Type = StrictlyUpperMatrix< ForEachTrait_<MT,Asinh> >;
1727 };
1728 
1729 template< typename MT, bool SO, bool DF >
1730 struct ForEachTrait< StrictlyUpperMatrix<MT,SO,DF>, Tan >
1731 {
1732  using Type = StrictlyUpperMatrix< ForEachTrait_<MT,Tan> >;
1733 };
1734 
1735 template< typename MT, bool SO, bool DF >
1736 struct ForEachTrait< StrictlyUpperMatrix<MT,SO,DF>, Atan >
1737 {
1738  using Type = StrictlyUpperMatrix< ForEachTrait_<MT,Atan> >;
1739 };
1740 
1741 template< typename MT, bool SO, bool DF >
1742 struct ForEachTrait< StrictlyUpperMatrix<MT,SO,DF>, Tanh >
1743 {
1744  using Type = StrictlyUpperMatrix< ForEachTrait_<MT,Tanh> >;
1745 };
1746 
1747 template< typename MT, bool SO, bool DF >
1748 struct ForEachTrait< StrictlyUpperMatrix<MT,SO,DF>, Atanh >
1749 {
1750  using Type = StrictlyUpperMatrix< ForEachTrait_<MT,Atanh> >;
1751 };
1752 
1753 template< typename MT, bool SO, bool DF >
1754 struct ForEachTrait< StrictlyUpperMatrix<MT,SO,DF>, Erf >
1755 {
1756  using Type = StrictlyUpperMatrix< ForEachTrait_<MT,Erf> >;
1757 };
1759 //*************************************************************************************************
1760 
1761 
1762 
1763 
1764 //=================================================================================================
1765 //
1766 // MATHTRAIT SPECIALIZATIONS
1767 //
1768 //=================================================================================================
1769 
1770 //*************************************************************************************************
1772 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1773 struct MathTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1774 {
1775  using HighType = StrictlyUpperMatrix< typename MathTrait<MT1,MT2>::HighType >;
1776  using LowType = StrictlyUpperMatrix< typename MathTrait<MT1,MT2>::LowType >;
1777 };
1779 //*************************************************************************************************
1780 
1781 
1782 
1783 
1784 //=================================================================================================
1785 //
1786 // SUBMATRIXTRAIT SPECIALIZATIONS
1787 //
1788 //=================================================================================================
1789 
1790 //*************************************************************************************************
1792 template< typename MT, bool SO, bool DF >
1793 struct SubmatrixTrait< StrictlyUpperMatrix<MT,SO,DF> >
1794 {
1795  using Type = SubmatrixTrait_<MT>;
1796 };
1798 //*************************************************************************************************
1799 
1800 
1801 
1802 
1803 //=================================================================================================
1804 //
1805 // ROWTRAIT SPECIALIZATIONS
1806 //
1807 //=================================================================================================
1808 
1809 //*************************************************************************************************
1811 template< typename MT, bool SO, bool DF >
1812 struct RowTrait< StrictlyUpperMatrix<MT,SO,DF> >
1813 {
1814  using Type = RowTrait_<MT>;
1815 };
1817 //*************************************************************************************************
1818 
1819 
1820 
1821 
1822 //=================================================================================================
1823 //
1824 // COLUMNTRAIT SPECIALIZATIONS
1825 //
1826 //=================================================================================================
1827 
1828 //*************************************************************************************************
1830 template< typename MT, bool SO, bool DF >
1831 struct ColumnTrait< StrictlyUpperMatrix<MT,SO,DF> >
1832 {
1833  using Type = ColumnTrait_<MT>;
1834 };
1836 //*************************************************************************************************
1837 
1838 } // namespace blaze
1839 
1840 #endif
BoolConstant< false > FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: FalseType.h:61
Header file for mathematical functions.
Header file for the Rows type trait.
Header file for the UNUSED_PARAMETER function template.
Header file for the subtraction trait.
Header file for the row trait.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:188
StrictlyUpperMatrix specialization for dense matrices.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1669
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
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, ColumnExprTrait_< MT > > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:126
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Header file for the IsSquare type trait.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Matrix adapter for strictly upper triangular matrices.
Definition: Forward.h:51
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
Header file for the Columns type trait.
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:330
StrictlyUpperMatrix specialization for sparse matrices.
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:254
Header file for the RemoveAdaptor type trait.
Constraint on the data type.
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:553
Header file for the IsPadded type trait.
Header file for the IsAdaptor type trait.
Header file for the implementation of the base template of the StrictlyUpperMatrix.
Header file for the DerestrictTrait class template.
Header file for the IsNumeric type trait.
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
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, RowExprTrait_< MT > > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:126
Header file for run time assertion macros.
Header file for the addition trait.
Header file for the division trait.
Header file for the submatrix trait.
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:258
#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
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
Header file for the mathematical trait.
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:314
Header file for the for-each trait.
Header file for the IntegralConstant class template.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:240
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the implementation of the base template of the UpperMatrix.
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
#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 implementation of the base template of the UniUpperMatrix.
Header file for the TrueType type/value trait base class.
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is an identity matrix.
Definition: DenseMatrix.h:1593