UpperMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_UPPERMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_UPPERMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
54 #include <blaze/math/Exception.h>
55 #include <blaze/math/Forward.h>
89 #include <blaze/util/Assert.h>
90 #include <blaze/util/EnableIf.h>
92 #include <blaze/util/TrueType.h>
94 #include <blaze/util/Unused.h>
95 
96 
97 namespace blaze {
98 
99 //=================================================================================================
100 //
101 // UPPERMATRIX OPERATORS
102 //
103 //=================================================================================================
104 
105 //*************************************************************************************************
108 template< typename MT, bool SO, bool DF >
109 inline void reset( UpperMatrix<MT,SO,DF>& m );
110 
111 template< typename MT, bool SO, bool DF >
112 inline void reset( UpperMatrix<MT,SO,DF>& m, size_t i );
113 
114 template< typename MT, bool SO, bool DF >
115 inline void clear( UpperMatrix<MT,SO,DF>& m );
116 
117 template< bool RF, typename MT, bool SO, bool DF >
118 inline bool isDefault( const UpperMatrix<MT,SO,DF>& m );
119 
120 template< typename MT, bool SO, bool DF >
121 inline bool isIntact( const UpperMatrix<MT,SO,DF>& m );
122 
123 template< typename MT, bool SO, bool DF >
124 inline void swap( UpperMatrix<MT,SO,DF>& a, UpperMatrix<MT,SO,DF>& b ) noexcept;
126 //*************************************************************************************************
127 
128 
129 //*************************************************************************************************
136 template< typename MT // Type of the adapted matrix
137  , bool SO // Storage order of the adapted matrix
138  , bool DF > // Density flag
139 inline void reset( UpperMatrix<MT,SO,DF>& m )
140 {
141  m.reset();
142 }
143 //*************************************************************************************************
144 
145 
146 //*************************************************************************************************
159 template< typename MT // Type of the adapted matrix
160  , bool SO // Storage order of the adapted matrix
161  , bool DF > // Density flag
162 inline void reset( UpperMatrix<MT,SO,DF>& m, size_t i )
163 {
164  m.reset( i );
165 }
166 //*************************************************************************************************
167 
168 
169 //*************************************************************************************************
176 template< typename MT // Type of the adapted matrix
177  , bool SO // Storage order of the adapted matrix
178  , bool DF > // Density flag
179 inline void clear( UpperMatrix<MT,SO,DF>& m )
180 {
181  m.clear();
182 }
183 //*************************************************************************************************
184 
185 
186 //*************************************************************************************************
214 template< bool RF // Relaxation flag
215  , typename MT // Type of the adapted matrix
216  , bool SO // Storage order of the adapted matrix
217  , bool DF > // Density flag
218 inline bool isDefault( const UpperMatrix<MT,SO,DF>& m )
219 {
220  return isDefault<RF>( m.matrix_ );
221 }
222 //*************************************************************************************************
223 
224 
225 //*************************************************************************************************
246 template< typename MT // Type of the adapted matrix
247  , bool SO // Storage order of the adapted matrix
248  , bool DF > // Density flag
249 inline bool isIntact( const UpperMatrix<MT,SO,DF>& m )
250 {
251  return m.isIntact();
252 }
253 //*************************************************************************************************
254 
255 
256 //*************************************************************************************************
264 template< typename MT // Type of the adapted matrix
265  , bool SO // Storage order of the adapted matrix
266  , bool DF > // Density flag
267 inline void swap( UpperMatrix<MT,SO,DF>& a, UpperMatrix<MT,SO,DF>& b ) noexcept
268 {
269  a.swap( b );
270 }
271 //*************************************************************************************************
272 
273 
274 //*************************************************************************************************
297 template< InversionFlag IF // Inversion algorithm
298  , typename MT // Type of the dense matrix
299  , bool SO > // Storage order of the dense matrix
300 inline void invert( UpperMatrix<MT,SO,true>& m )
301 {
303 
304  if( IF == asUniLower ) {
305  BLAZE_INTERNAL_ASSERT( isIdentity( m ), "Violation of preconditions detected" );
306  return;
307  }
308 
309  constexpr InversionFlag flag( ( IF == byLU || IF == asGeneral || IF == asUpper )
310  ? ( asUpper )
311  : ( ( IF == asUniUpper )
312  ?( asUniUpper )
313  :( asDiagonal ) ) );
314 
315  invert<flag>( derestrict( m ) );
316 
317  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
318 }
320 //*************************************************************************************************
321 
322 
323 //*************************************************************************************************
342 template< typename MT1, bool SO1, typename MT2, typename MT3, typename MT4, bool SO2 >
343 inline void lu( const UpperMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
345 {
347 
352 
357 
358  using ET2 = ElementType_<MT2>;
359  using ET4 = ElementType_<MT4>;
360 
361  const size_t n( (~A).rows() );
362 
363  decltype(auto) L2( derestrict( ~L ) );
364 
365  (~U) = A;
366 
367  resize( ~L, n, n );
368  reset( L2 );
369 
370  resize( ~P, n, n );
371  reset( ~P );
372 
373  for( size_t i=0UL; i<n; ++i ) {
374  L2(i,i) = ET2(1);
375  (~P)(i,i) = ET4(1);
376  }
377 }
379 //*************************************************************************************************
380 
381 
382 //*************************************************************************************************
398 template< typename MT // Type of the adapted matrix
399  , bool SO // Storage order of the adapted matrix
400  , bool DF // Density flag
401  , typename VT > // Type of the right-hand side dense vector
402 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs,
403  const DenseVector<VT,false>& rhs, size_t row, size_t column )
404 {
406 
407  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
408  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
409  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
410 
411  UNUSED_PARAMETER( lhs );
412 
413  const size_t ibegin( ( column < row )?( 0UL ):( column - row + 1UL ) );
414 
415  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
416  if( !isDefault( (~rhs)[i] ) )
417  return false;
418  }
419 
420  return true;
421 }
423 //*************************************************************************************************
424 
425 
426 //*************************************************************************************************
442 template< typename MT // Type of the adapted matrix
443  , bool SO // Storage order of the adapted matrix
444  , bool DF // Density flag
445  , typename VT > // Type of the right-hand side dense vector
446 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs,
447  const DenseVector<VT,true>& rhs, size_t row, size_t column )
448 {
450 
451  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
452  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
453  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
454 
455  UNUSED_PARAMETER( lhs );
456 
457  if( row <= column )
458  return true;
459 
460  const size_t iend( min( row - column, (~rhs).size() ) );
461 
462  for( size_t i=0UL; i<iend; ++i ) {
463  if( !isDefault( (~rhs)[i] ) )
464  return false;
465  }
466 
467  return true;
468 }
470 //*************************************************************************************************
471 
472 
473 //*************************************************************************************************
489 template< typename MT // Type of the adapted matrix
490  , bool SO // Storage order of the adapted matrix
491  , bool DF // Density flag
492  , typename VT > // Type of the right-hand side sparse vector
493 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs,
494  const SparseVector<VT,false>& rhs, size_t row, size_t column )
495 {
497 
498  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
499  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
500  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
501 
502  UNUSED_PARAMETER( lhs );
503 
504  using RhsIterator = typename VT::ConstIterator;
505 
506  const RhsIterator last( (~rhs).end() );
507  RhsIterator element( (~rhs).lowerBound( ( column < row )?( 0UL ):( column - row + 1UL ) ) );
508 
509  for( ; element!=last; ++element ) {
510  if( !isDefault( element->value() ) )
511  return false;
512  }
513 
514  return true;
515 }
517 //*************************************************************************************************
518 
519 
520 //*************************************************************************************************
536 template< typename MT // Type of the adapted matrix
537  , bool SO // Storage order of the adapted matrix
538  , bool DF // Density flag
539  , typename VT > // Type of the right-hand side sparse vector
540 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs,
541  const SparseVector<VT,true>& rhs, size_t row, size_t column )
542 {
544 
545  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
546  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
547  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
548 
549  UNUSED_PARAMETER( lhs );
550 
551  using RhsIterator = typename VT::ConstIterator;
552 
553  if( row <= column )
554  return true;
555 
556  const RhsIterator last( (~rhs).lowerBound( row - column ) );
557 
558  for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
559  if( !isDefault( element->value() ) )
560  return false;
561  }
562 
563  return true;
564 }
566 //*************************************************************************************************
567 
568 
569 //*************************************************************************************************
585 template< typename MT1 // Type of the adapted matrix
586  , bool SO // Storage order of the adapted matrix
587  , bool DF // Density flag
588  , typename MT2 > // Type of the right-hand side dense matrix
589 inline bool tryAssign( const UpperMatrix<MT1,SO,DF>& lhs,
590  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
591 {
593 
594  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
595  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
596  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
597  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
598 
599  UNUSED_PARAMETER( lhs );
600 
601  const size_t M( (~rhs).rows() );
602  const size_t N( (~rhs).columns() );
603 
604  if( column + 1UL >= row + M )
605  return true;
606 
607  const size_t ibegin( ( column < row )?( 0UL ):( column - row + 1UL ) );
608 
609  for( size_t i=ibegin; i<M; ++i )
610  {
611  const size_t jend( min( row + i - column, N ) );
612 
613  for( size_t j=0UL; j<jend; ++j ) {
614  if( !isDefault( (~rhs)(i,j) ) )
615  return false;
616  }
617  }
618 
619  return true;
620 }
622 //*************************************************************************************************
623 
624 
625 //*************************************************************************************************
641 template< typename MT1 // Type of the adapted matrix
642  , bool SO // Storage order of the adapted matrix
643  , bool DF // Density flag
644  , typename MT2 > // Type of the right-hand side dense matrix
645 inline bool tryAssign( const UpperMatrix<MT1,SO,DF>& lhs,
646  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
647 {
649 
650  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
651  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
652  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
653  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
654 
655  UNUSED_PARAMETER( lhs );
656 
657  const size_t M( (~rhs).rows() );
658  const size_t N( (~rhs).columns() );
659 
660  if( column + 1UL >= row + M )
661  return true;
662 
663  const size_t jend( min( row + M - column - 1UL, N ) );
664 
665  for( size_t j=0UL; j<jend; ++j )
666  {
667  const bool containsDiagonal( column + j >= row );
668  const size_t ibegin( ( containsDiagonal )?( column + j - row + 1UL ):( 0UL ) );
669 
670  for( size_t i=ibegin; i<M; ++i ) {
671  if( !isDefault( (~rhs)(i,j) ) )
672  return false;
673  }
674  }
675 
676  return true;
677 }
679 //*************************************************************************************************
680 
681 
682 //*************************************************************************************************
698 template< typename MT1 // Type of the adapted matrix
699  , bool SO // Storage order of the adapted matrix
700  , bool DF // Density flag
701  , typename MT2 > // Type of the right-hand side sparse matrix
702 inline bool tryAssign( const UpperMatrix<MT1,SO,DF>& lhs,
703  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
704 {
706 
707  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
708  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
709  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
710  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
711 
712  UNUSED_PARAMETER( lhs );
713 
714  using RhsIterator = typename MT2::ConstIterator;
715 
716  const size_t M( (~rhs).rows() );
717  const size_t N( (~rhs).columns() );
718 
719  if( column + 1UL >= row + M )
720  return true;
721 
722  const size_t ibegin( ( column < row )?( 0UL ):( column - row + 1UL ) );
723 
724  for( size_t i=ibegin; i<M; ++i )
725  {
726  const size_t index( row + i - column );
727  const RhsIterator last( (~rhs).lowerBound( i, min( index, N ) ) );
728 
729  for( RhsIterator element=(~rhs).begin(i); element!=last; ++element ) {
730  if( !isDefault( element->value() ) )
731  return false;
732  }
733  }
734 
735  return true;
736 }
738 //*************************************************************************************************
739 
740 
741 //*************************************************************************************************
757 template< typename MT1 // Type of the adapted matrix
758  , bool SO // Storage order of the adapted matrix
759  , bool DF // Density flag
760  , typename MT2 > // Type of the right-hand side sparse matrix
761 inline bool tryAssign( const UpperMatrix<MT1,SO,DF>& lhs,
762  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
763 {
765 
766  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
767  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
768  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
769  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
770 
771  UNUSED_PARAMETER( lhs );
772 
773  using RhsIterator = typename MT2::ConstIterator;
774 
775  const size_t M( (~rhs).rows() );
776  const size_t N( (~rhs).columns() );
777 
778  if( column + 1UL >= row + M )
779  return true;
780 
781  const size_t jend( min( row + M - column - 1UL, N ) );
782 
783  for( size_t j=0UL; j<jend; ++j )
784  {
785  const bool containsDiagonal( column + j >= row );
786  const size_t index( ( containsDiagonal )?( column + j - row + 1UL ):( 0UL ) );
787 
788  const RhsIterator last( (~rhs).end(j) );
789  RhsIterator element( (~rhs).lowerBound( index, j ) );
790 
791  for( ; element!=last; ++element ) {
792  if( !isDefault( element->value() ) )
793  return false;
794  }
795  }
796 
797  return true;
798 }
800 //*************************************************************************************************
801 
802 
803 //*************************************************************************************************
819 template< typename MT // Type of the adapted matrix
820  , bool SO // Storage order of the adapted matrix
821  , bool DF // Density flag
822  , typename VT // Type of the right-hand side vector
823  , bool TF > // Transpose flag of the right-hand side vector
824 inline bool tryAddAssign( const UpperMatrix<MT,SO,DF>& lhs,
825  const Vector<VT,TF>& rhs, size_t row, size_t column )
826 {
827  return tryAssign( lhs, ~rhs, row, column );
828 }
830 //*************************************************************************************************
831 
832 
833 //*************************************************************************************************
849 template< typename MT1 // Type of the adapted matrix
850  , bool SO1 // Storage order of the adapted matrix
851  , bool DF // Density flag
852  , typename MT2 // Type of the right-hand side matrix
853  , bool SO2 > // Storage order of the right-hand side matrix
854 inline bool tryAddAssign( const UpperMatrix<MT1,SO1,DF>& lhs,
855  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
856 {
857  return tryAssign( lhs, ~rhs, row, column );
858 }
860 //*************************************************************************************************
861 
862 
863 //*************************************************************************************************
879 template< typename MT // Type of the adapted matrix
880  , bool SO // Storage order of the adapted matrix
881  , bool DF // Density flag
882  , typename VT // Type of the right-hand side vector
883  , bool TF > // Transpose flag of the right-hand side vector
884 inline bool trySubAssign( const UpperMatrix<MT,SO,DF>& lhs,
885  const Vector<VT,TF>& rhs, size_t row, size_t column )
886 {
887  return tryAssign( lhs, ~rhs, row, column );
888 }
890 //*************************************************************************************************
891 
892 
893 //*************************************************************************************************
909 template< typename MT1 // Type of the adapted matrix
910  , bool SO1 // Storage order of the adapted matrix
911  , bool DF // Density flag
912  , typename MT2 // Type of the right-hand side matrix
913  , bool SO2 > // Storage order of the right-hand side matrix
914 inline bool trySubAssign( const UpperMatrix<MT1,SO1,DF>& lhs,
915  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
916 {
917  return tryAssign( lhs, ~rhs, row, column );
918 }
920 //*************************************************************************************************
921 
922 
923 //*************************************************************************************************
937 template< typename MT // Type of the adapted matrix
938  , bool SO // Storage order of the adapted matrix
939  , bool DF > // Density flag
940 inline MT& derestrict( UpperMatrix<MT,SO,DF>& m )
941 {
942  return m.matrix_;
943 }
945 //*************************************************************************************************
946 
947 
948 
949 
950 //=================================================================================================
951 //
952 // ROWS SPECIALIZATIONS
953 //
954 //=================================================================================================
955 
956 //*************************************************************************************************
958 template< typename MT, bool SO, bool DF >
959 struct Rows< UpperMatrix<MT,SO,DF> >
960  : public Rows<MT>
961 {};
963 //*************************************************************************************************
964 
965 
966 
967 
968 //=================================================================================================
969 //
970 // COLUMNS SPECIALIZATIONS
971 //
972 //=================================================================================================
973 
974 //*************************************************************************************************
976 template< typename MT, bool SO, bool DF >
977 struct Columns< UpperMatrix<MT,SO,DF> >
978  : public Columns<MT>
979 {};
981 //*************************************************************************************************
982 
983 
984 
985 
986 //=================================================================================================
987 //
988 // ISSQUARE SPECIALIZATIONS
989 //
990 //=================================================================================================
991 
992 //*************************************************************************************************
994 template< typename MT, bool SO, bool DF >
995 struct IsSquare< UpperMatrix<MT,SO,DF> >
996  : public TrueType
997 {};
999 //*************************************************************************************************
1000 
1001 
1002 
1003 
1004 //=================================================================================================
1005 //
1006 // ISUPPER SPECIALIZATIONS
1007 //
1008 //=================================================================================================
1009 
1010 //*************************************************************************************************
1012 template< typename MT, bool SO, bool DF >
1013 struct IsUpper< UpperMatrix<MT,SO,DF> >
1014  : public TrueType
1015 {};
1017 //*************************************************************************************************
1018 
1019 
1020 
1021 
1022 //=================================================================================================
1023 //
1024 // ISADAPTOR SPECIALIZATIONS
1025 //
1026 //=================================================================================================
1027 
1028 //*************************************************************************************************
1030 template< typename MT, bool SO, bool DF >
1031 struct IsAdaptor< UpperMatrix<MT,SO,DF> >
1032  : public TrueType
1033 {};
1035 //*************************************************************************************************
1036 
1037 
1038 
1039 
1040 //=================================================================================================
1041 //
1042 // ISRESTRICTED SPECIALIZATIONS
1043 //
1044 //=================================================================================================
1045 
1046 //*************************************************************************************************
1048 template< typename MT, bool SO, bool DF >
1049 struct IsRestricted< UpperMatrix<MT,SO,DF> >
1050  : public TrueType
1051 {};
1053 //*************************************************************************************************
1054 
1055 
1056 
1057 
1058 //=================================================================================================
1059 //
1060 // HASCONSTDATAACCESS SPECIALIZATIONS
1061 //
1062 //=================================================================================================
1063 
1064 //*************************************************************************************************
1066 template< typename MT, bool SO >
1067 struct HasConstDataAccess< UpperMatrix<MT,SO,true> >
1068  : public TrueType
1069 {};
1071 //*************************************************************************************************
1072 
1073 
1074 
1075 
1076 //=================================================================================================
1077 //
1078 // ISALIGNED SPECIALIZATIONS
1079 //
1080 //=================================================================================================
1081 
1082 //*************************************************************************************************
1084 template< typename MT, bool SO, bool DF >
1085 struct IsAligned< UpperMatrix<MT,SO,DF> >
1086  : public BoolConstant< IsAligned<MT>::value >
1087 {};
1089 //*************************************************************************************************
1090 
1091 
1092 
1093 
1094 //=================================================================================================
1095 //
1096 // ISPADDED SPECIALIZATIONS
1097 //
1098 //=================================================================================================
1099 
1100 //*************************************************************************************************
1102 template< typename MT, bool SO, bool DF >
1103 struct IsPadded< UpperMatrix<MT,SO,DF> >
1104  : public BoolConstant< IsPadded<MT>::value >
1105 {};
1107 //*************************************************************************************************
1108 
1109 
1110 
1111 
1112 //=================================================================================================
1113 //
1114 // ISRESIZABLE SPECIALIZATIONS
1115 //
1116 //=================================================================================================
1117 
1118 //*************************************************************************************************
1120 template< typename MT, bool SO, bool DF >
1121 struct IsResizable< UpperMatrix<MT,SO,DF> >
1122  : public BoolConstant< IsResizable<MT>::value >
1123 {};
1125 //*************************************************************************************************
1126 
1127 
1128 
1129 
1130 //=================================================================================================
1131 //
1132 // ISSHRINKABLE SPECIALIZATIONS
1133 //
1134 //=================================================================================================
1135 
1136 //*************************************************************************************************
1138 template< typename MT, bool SO, bool DF >
1139 struct IsShrinkable< UpperMatrix<MT,SO,DF> >
1140  : public BoolConstant< IsShrinkable<MT>::value >
1141 {};
1143 //*************************************************************************************************
1144 
1145 
1146 
1147 
1148 //=================================================================================================
1149 //
1150 // REMOVEADAPTOR SPECIALIZATIONS
1151 //
1152 //=================================================================================================
1153 
1154 //*************************************************************************************************
1156 template< typename MT, bool SO, bool DF >
1157 struct RemoveAdaptor< UpperMatrix<MT,SO,DF> >
1158 {
1159  using Type = MT;
1160 };
1162 //*************************************************************************************************
1163 
1164 
1165 
1166 
1167 //=================================================================================================
1168 //
1169 // ADDTRAIT SPECIALIZATIONS
1170 //
1171 //=================================================================================================
1172 
1173 //*************************************************************************************************
1175 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1176 struct AddTrait< UpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1177 {
1179 };
1180 
1181 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1182 struct AddTrait< StaticMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1183 {
1184  using Type = AddTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1185 };
1186 
1187 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1188 struct AddTrait< UpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1189 {
1191 };
1192 
1193 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1194 struct AddTrait< HybridMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1195 {
1196  using Type = AddTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1197 };
1198 
1199 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1200 struct AddTrait< UpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1201 {
1202  using Type = AddTrait_< MT, DynamicMatrix<T,SO2> >;
1203 };
1204 
1205 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1206 struct AddTrait< DynamicMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1207 {
1208  using Type = AddTrait_< DynamicMatrix<T,SO1>, MT >;
1209 };
1210 
1211 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1212 struct AddTrait< UpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1213 {
1215 };
1216 
1217 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1218 struct AddTrait< CustomMatrix<T,AF,PF,SO1>, UpperMatrix<MT,SO2,DF> >
1219 {
1220  using Type = AddTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1221 };
1222 
1223 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1224 struct AddTrait< UpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1225 {
1227 };
1228 
1229 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1230 struct AddTrait< CompressedMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1231 {
1232  using Type = AddTrait_< CompressedMatrix<T,SO1>, MT >;
1233 };
1234 
1235 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1236 struct AddTrait< UpperMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1237 {
1239 };
1240 
1241 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1242 struct AddTrait< IdentityMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1243 {
1244  using Type = UpperMatrix< AddTrait_< IdentityMatrix<T,SO1>, MT > >;
1245 };
1246 
1247 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1248 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1249 {
1250  using Type = AddTrait_<MT1,MT2>;
1251 };
1252 
1253 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1254 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UpperMatrix<MT2,SO2,DF2> >
1255 {
1256  using Type = AddTrait_<MT1,MT2>;
1257 };
1258 
1259 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1260 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1261 {
1262  using Type = AddTrait_<MT1,MT2>;
1263 };
1264 
1265 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1266 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1267 {
1268  using Type = AddTrait_<MT1,MT2>;
1269 };
1270 
1271 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1272 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1273 {
1274  using Type = AddTrait_<MT1,MT2>;
1275 };
1276 
1277 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1278 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1279 {
1280  using Type = AddTrait_<MT1,MT2>;
1281 };
1282 
1283 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1284 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1285 {
1286  using Type = AddTrait_<MT1,MT2>;
1287 };
1288 
1289 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1290 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1291 {
1292  using Type = AddTrait_<MT1,MT2>;
1293 };
1294 
1295 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1296 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1297 {
1298  using Type = AddTrait_<MT1,MT2>;
1299 };
1300 
1301 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1302 struct AddTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1303 {
1304  using Type = AddTrait_<MT1,MT2>;
1305 };
1306 
1307 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1308 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1309 {
1310  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
1311 };
1313 //*************************************************************************************************
1314 
1315 
1316 
1317 
1318 //=================================================================================================
1319 //
1320 // SUBTRAIT SPECIALIZATIONS
1321 //
1322 //=================================================================================================
1323 
1324 //*************************************************************************************************
1326 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1327 struct SubTrait< UpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1328 {
1330 };
1331 
1332 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1333 struct SubTrait< StaticMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1334 {
1335  using Type = SubTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1336 };
1337 
1338 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1339 struct SubTrait< UpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1340 {
1342 };
1343 
1344 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1345 struct SubTrait< HybridMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1346 {
1347  using Type = SubTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1348 };
1349 
1350 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1351 struct SubTrait< UpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1352 {
1353  using Type = SubTrait_< MT, DynamicMatrix<T,SO2> >;
1354 };
1355 
1356 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1357 struct SubTrait< DynamicMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1358 {
1359  using Type = SubTrait_< DynamicMatrix<T,SO1>, MT >;
1360 };
1361 
1362 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1363 struct SubTrait< UpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1364 {
1366 };
1367 
1368 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1369 struct SubTrait< CustomMatrix<T,AF,PF,SO1>, UpperMatrix<MT,SO2,DF> >
1370 {
1371  using Type = SubTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1372 };
1373 
1374 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1375 struct SubTrait< UpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1376 {
1378 };
1379 
1380 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1381 struct SubTrait< CompressedMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1382 {
1383  using Type = SubTrait_< CompressedMatrix<T,SO1>, MT >;
1384 };
1385 
1386 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1387 struct SubTrait< UpperMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1388 {
1389  using Type = SubTrait_< MT, IdentityMatrix<T,SO2> >;
1390 };
1391 
1392 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1393 struct SubTrait< IdentityMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1394 {
1395  using Type = SubTrait_< IdentityMatrix<T,SO1>, MT >;
1396 };
1397 
1398 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1399 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1400 {
1401  using Type = SubTrait_<MT1,MT2>;
1402 };
1403 
1404 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1405 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UpperMatrix<MT2,SO2,DF2> >
1406 {
1407  using Type = SubTrait_<MT1,MT2>;
1408 };
1409 
1410 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1411 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1412 {
1413  using Type = SubTrait_<MT1,MT2>;
1414 };
1415 
1416 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1417 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1418 {
1419  using Type = SubTrait_<MT1,MT2>;
1420 };
1421 
1422 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1423 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1424 {
1425  using Type = SubTrait_<MT1,MT2>;
1426 };
1427 
1428 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1429 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1430 {
1431  using Type = SubTrait_<MT1,MT2>;
1432 };
1433 
1434 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1435 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1436 {
1437  using Type = SubTrait_<MT1,MT2>;
1438 };
1439 
1440 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1441 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1442 {
1443  using Type = SubTrait_<MT1,MT2>;
1444 };
1445 
1446 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1447 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1448 {
1449  using Type = SubTrait_<MT1,MT2>;
1450 };
1451 
1452 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1453 struct SubTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1454 {
1455  using Type = SubTrait_<MT1,MT2>;
1456 };
1457 
1458 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1459 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1460 {
1461  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
1462 };
1464 //*************************************************************************************************
1465 
1466 
1467 
1468 
1469 //=================================================================================================
1470 //
1471 // SCHURTRAIT SPECIALIZATIONS
1472 //
1473 //=================================================================================================
1474 
1475 //*************************************************************************************************
1477 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1478 struct SchurTrait< UpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1479 {
1481 };
1482 
1483 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1484 struct SchurTrait< StaticMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1485 {
1487 };
1488 
1489 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1490 struct SchurTrait< UpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1491 {
1493 };
1494 
1495 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1496 struct SchurTrait< HybridMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1497 {
1499 };
1500 
1501 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1502 struct SchurTrait< UpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1503 {
1505 };
1506 
1507 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1508 struct SchurTrait< DynamicMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1509 {
1511 };
1512 
1513 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1514 struct SchurTrait< UpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1515 {
1517 };
1518 
1519 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1520 struct SchurTrait< CustomMatrix<T,AF,PF,SO1>, UpperMatrix<MT,SO2,DF> >
1521 {
1523 };
1524 
1525 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1526 struct SchurTrait< UpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1527 {
1529 };
1530 
1531 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1532 struct SchurTrait< CompressedMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1533 {
1535 };
1536 
1537 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1538 struct SchurTrait< UpperMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1539 {
1541 };
1542 
1543 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1544 struct SchurTrait< IdentityMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1545 {
1547 };
1548 
1549 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1550 struct SchurTrait< UpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1551 {
1552  using Type = UpperMatrix< SchurTrait_<MT1,MT2> >;
1553 };
1554 
1555 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1556 struct SchurTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UpperMatrix<MT2,SO2,DF2> >
1557 {
1558  using Type = UpperMatrix< SchurTrait_<MT1,MT2> >;
1559 };
1560 
1561 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1562 struct SchurTrait< UpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1563 {
1564  using Type = UpperMatrix< SchurTrait_<MT1,MT2> >;
1565 };
1566 
1567 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1568 struct SchurTrait< HermitianMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1569 {
1570  using Type = UpperMatrix< SchurTrait_<MT1,MT2> >;
1571 };
1572 
1573 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1574 struct SchurTrait< UpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1575 {
1576  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1577 };
1578 
1579 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1580 struct SchurTrait< LowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1581 {
1582  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1583 };
1584 
1585 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1586 struct SchurTrait< UpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1587 {
1588  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1589 };
1590 
1591 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1592 struct SchurTrait< UniLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1593 {
1594  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1595 };
1596 
1597 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1598 struct SchurTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1599 {
1600  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1601 };
1602 
1603 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1604 struct SchurTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1605 {
1606  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1607 };
1608 
1609 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1610 struct SchurTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1611 {
1612  using Type = UpperMatrix< SchurTrait_<MT1,MT2> >;
1613 };
1615 //*************************************************************************************************
1616 
1617 
1618 
1619 
1620 //=================================================================================================
1621 //
1622 // MULTTRAIT SPECIALIZATIONS
1623 //
1624 //=================================================================================================
1625 
1626 //*************************************************************************************************
1628 template< typename MT, bool SO, bool DF, typename T >
1629 struct MultTrait< UpperMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
1630 {
1631  using Type = UpperMatrix< MultTrait_<MT,T> >;
1632 };
1633 
1634 template< typename T, typename MT, bool SO, bool DF >
1635 struct MultTrait< T, UpperMatrix<MT,SO,DF>, EnableIf_< IsNumeric<T> > >
1636 {
1637  using Type = UpperMatrix< MultTrait_<T,MT> >;
1638 };
1639 
1640 template< typename MT, bool SO, bool DF, typename T, size_t N >
1641 struct MultTrait< UpperMatrix<MT,SO,DF>, StaticVector<T,N,false> >
1642 {
1644 };
1645 
1646 template< typename T, size_t N, typename MT, bool SO, bool DF >
1647 struct MultTrait< StaticVector<T,N,true>, UpperMatrix<MT,SO,DF> >
1648 {
1649  using Type = MultTrait_< StaticVector<T,N,true>, MT >;
1650 };
1651 
1652 template< typename MT, bool SO, bool DF, typename T, size_t N >
1653 struct MultTrait< UpperMatrix<MT,SO,DF>, HybridVector<T,N,false> >
1654 {
1656 };
1657 
1658 template< typename T, size_t N, typename MT, bool SO, bool DF >
1659 struct MultTrait< HybridVector<T,N,true>, UpperMatrix<MT,SO,DF> >
1660 {
1661  using Type = MultTrait_< HybridVector<T,N,true>, MT >;
1662 };
1663 
1664 template< typename MT, bool SO, bool DF, typename T >
1665 struct MultTrait< UpperMatrix<MT,SO,DF>, DynamicVector<T,false> >
1666 {
1668 };
1669 
1670 template< typename T, typename MT, bool SO, bool DF >
1671 struct MultTrait< DynamicVector<T,true>, UpperMatrix<MT,SO,DF> >
1672 {
1673  using Type = MultTrait_< DynamicVector<T,true>, MT >;
1674 };
1675 
1676 template< typename MT, bool SO, bool DF, typename T, bool AF, bool PF >
1677 struct MultTrait< UpperMatrix<MT,SO,DF>, CustomVector<T,AF,PF,false> >
1678 {
1680 };
1681 
1682 template< typename T, bool AF, bool PF, typename MT, bool SO, bool DF >
1683 struct MultTrait< CustomVector<T,AF,PF,true>, UpperMatrix<MT,SO,DF> >
1684 {
1685  using Type = MultTrait_< CustomVector<T,AF,PF,true>, MT >;
1686 };
1687 
1688 template< typename MT, bool SO, bool DF, typename T >
1689 struct MultTrait< UpperMatrix<MT,SO,DF>, CompressedVector<T,false> >
1690 {
1692 };
1693 
1694 template< typename T, typename MT, bool SO, bool DF >
1695 struct MultTrait< CompressedVector<T,true>, UpperMatrix<MT,SO,DF> >
1696 {
1697  using Type = MultTrait_< CompressedVector<T,true>, MT >;
1698 };
1699 
1700 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1701 struct MultTrait< UpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1702 {
1704 };
1705 
1706 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1707 struct MultTrait< StaticMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1708 {
1709  using Type = MultTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1710 };
1711 
1712 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1713 struct MultTrait< UpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1714 {
1716 };
1717 
1718 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1719 struct MultTrait< HybridMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1720 {
1721  using Type = MultTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1722 };
1723 
1724 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1725 struct MultTrait< UpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1726 {
1727  using Type = MultTrait_< MT, DynamicMatrix<T,SO2> >;
1728 };
1729 
1730 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1731 struct MultTrait< DynamicMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1732 {
1733  using Type = MultTrait_< DynamicMatrix<T,SO1>, MT >;
1734 };
1735 
1736 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1737 struct MultTrait< UpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1738 {
1740 };
1741 
1742 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1743 struct MultTrait< CustomMatrix<T,AF,PF,SO1>, UpperMatrix<MT,SO2,DF> >
1744 {
1745  using Type = MultTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1746 };
1747 
1748 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1749 struct MultTrait< UpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1750 {
1752 };
1753 
1754 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1755 struct MultTrait< CompressedMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1756 {
1757  using Type = MultTrait_< CompressedMatrix<T,SO1>, MT >;
1758 };
1759 
1760 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1761 struct MultTrait< UpperMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1762 {
1764 };
1765 
1766 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1767 struct MultTrait< IdentityMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1768 {
1770 };
1771 
1772 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1773 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1774 {
1775  using Type = MultTrait_<MT1,MT2>;
1776 };
1777 
1778 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1779 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UpperMatrix<MT2,SO2,DF2> >
1780 {
1781  using Type = MultTrait_<MT1,MT2>;
1782 };
1783 
1784 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1785 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1786 {
1787  using Type = MultTrait_<MT1,MT2>;
1788 };
1789 
1790 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1791 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1792 {
1793  using Type = MultTrait_<MT1,MT2>;
1794 };
1795 
1796 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1797 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1798 {
1799  using Type = MultTrait_<MT1,MT2>;
1800 };
1801 
1802 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1803 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1804 {
1805  using Type = MultTrait_<MT1,MT2>;
1806 };
1807 
1808 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1809 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1810 {
1811  using Type = MultTrait_<MT1,MT2>;
1812 };
1813 
1814 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1815 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1816 {
1817  using Type = MultTrait_<MT1,MT2>;
1818 };
1819 
1820 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1821 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1822 {
1823  using Type = MultTrait_<MT1,MT2>;
1824 };
1825 
1826 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1827 struct MultTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1828 {
1829  using Type = MultTrait_<MT1,MT2>;
1830 };
1831 
1832 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1833 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1834 {
1835  using Type = UpperMatrix< MultTrait_<MT1,MT2> >;
1836 };
1838 //*************************************************************************************************
1839 
1840 
1841 
1842 
1843 //=================================================================================================
1844 //
1845 // DIVTRAIT SPECIALIZATIONS
1846 //
1847 //=================================================================================================
1848 
1849 //*************************************************************************************************
1851 template< typename MT, bool SO, bool DF, typename T >
1852 struct DivTrait< UpperMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
1853 {
1854  using Type = UpperMatrix< DivTrait_<MT,T> >;
1855 };
1857 //*************************************************************************************************
1858 
1859 
1860 
1861 
1862 //=================================================================================================
1863 //
1864 // UNARYMAPTRAIT SPECIALIZATIONS
1865 //
1866 //=================================================================================================
1867 
1868 //*************************************************************************************************
1870 template< typename MT, bool SO, bool DF >
1871 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Abs >
1872 {
1873  using Type = UpperMatrix< UnaryMapTrait_<MT,Abs> >;
1874 };
1875 
1876 template< typename MT, bool SO, bool DF >
1877 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Floor >
1878 {
1880 };
1881 
1882 template< typename MT, bool SO, bool DF >
1883 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Ceil >
1884 {
1885  using Type = UpperMatrix< UnaryMapTrait_<MT,Ceil> >;
1886 };
1887 
1888 template< typename MT, bool SO, bool DF >
1889 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Trunc >
1890 {
1892 };
1893 
1894 template< typename MT, bool SO, bool DF >
1895 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Round >
1896 {
1898 };
1899 
1900 template< typename MT, bool SO, bool DF >
1901 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Conj >
1902 {
1903  using Type = UpperMatrix< UnaryMapTrait_<MT,Conj> >;
1904 };
1905 
1906 template< typename MT, bool SO, bool DF >
1907 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Real >
1908 {
1909  using Type = UpperMatrix< UnaryMapTrait_<MT,Real> >;
1910 };
1911 
1912 template< typename MT, bool SO, bool DF >
1913 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Imag >
1914 {
1915  using Type = UpperMatrix< UnaryMapTrait_<MT,Imag> >;
1916 };
1917 
1918 template< typename MT, bool SO, bool DF >
1919 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Sqrt >
1920 {
1921  using Type = UpperMatrix< UnaryMapTrait_<MT,Sqrt> >;
1922 };
1923 
1924 template< typename MT, bool SO, bool DF >
1925 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Cbrt >
1926 {
1927  using Type = UpperMatrix< UnaryMapTrait_<MT,Cbrt> >;
1928 };
1929 
1930 template< typename MT, bool SO, bool DF >
1931 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Sin >
1932 {
1933  using Type = UpperMatrix< UnaryMapTrait_<MT,Sin> >;
1934 };
1935 
1936 template< typename MT, bool SO, bool DF >
1937 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Asin >
1938 {
1939  using Type = UpperMatrix< UnaryMapTrait_<MT,Asin> >;
1940 };
1941 
1942 template< typename MT, bool SO, bool DF >
1943 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Sinh >
1944 {
1945  using Type = UpperMatrix< UnaryMapTrait_<MT,Sinh> >;
1946 };
1947 
1948 template< typename MT, bool SO, bool DF >
1949 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Asinh >
1950 {
1952 };
1953 
1954 template< typename MT, bool SO, bool DF >
1955 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Tan >
1956 {
1957  using Type = UpperMatrix< UnaryMapTrait_<MT,Tan> >;
1958 };
1959 
1960 template< typename MT, bool SO, bool DF >
1961 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Atan >
1962 {
1963  using Type = UpperMatrix< UnaryMapTrait_<MT,Atan> >;
1964 };
1965 
1966 template< typename MT, bool SO, bool DF >
1967 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Tanh >
1968 {
1969  using Type = UpperMatrix< UnaryMapTrait_<MT,Tanh> >;
1970 };
1971 
1972 template< typename MT, bool SO, bool DF >
1973 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Atanh >
1974 {
1976 };
1977 
1978 template< typename MT, bool SO, bool DF >
1979 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Erf >
1980 {
1981  using Type = UpperMatrix< UnaryMapTrait_<MT,Erf> >;
1982 };
1984 //*************************************************************************************************
1985 
1986 
1987 
1988 
1989 //=================================================================================================
1990 //
1991 // BINARYMAPTRAIT SPECIALIZATIONS
1992 //
1993 //=================================================================================================
1994 
1995 //*************************************************************************************************
1997 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1998 struct BinaryMapTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2>, Min >
1999 {
2001 };
2002 
2003 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2004 struct BinaryMapTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2>, Max >
2005 {
2007 };
2009 //*************************************************************************************************
2010 
2011 
2012 
2013 
2014 //=================================================================================================
2015 //
2016 // DECLSYMTRAIT SPECIALIZATIONS
2017 //
2018 //=================================================================================================
2019 
2020 //*************************************************************************************************
2022 template< typename MT, bool SO, bool DF >
2023 struct DeclSymTrait< UpperMatrix<MT,SO,DF> >
2024 {
2025  using Type = DiagonalMatrix<MT>;
2026 };
2028 //*************************************************************************************************
2029 
2030 
2031 
2032 
2033 //=================================================================================================
2034 //
2035 // DECLHERMTRAIT SPECIALIZATIONS
2036 //
2037 //=================================================================================================
2038 
2039 //*************************************************************************************************
2041 template< typename MT, bool SO, bool DF >
2042 struct DeclHermTrait< UpperMatrix<MT,SO,DF> >
2043 {
2044  using Type = HermitianMatrix<MT>;
2045 };
2047 //*************************************************************************************************
2048 
2049 
2050 
2051 
2052 //=================================================================================================
2053 //
2054 // DECLLOWTRAIT SPECIALIZATIONS
2055 //
2056 //=================================================================================================
2057 
2058 //*************************************************************************************************
2060 template< typename MT, bool SO, bool DF >
2061 struct DeclLowTrait< UpperMatrix<MT,SO,DF> >
2062 {
2063  using Type = DiagonalMatrix<MT>;
2064 };
2066 //*************************************************************************************************
2067 
2068 
2069 
2070 
2071 //=================================================================================================
2072 //
2073 // DECLUPPTRAIT SPECIALIZATIONS
2074 //
2075 //=================================================================================================
2076 
2077 //*************************************************************************************************
2079 template< typename MT, bool SO, bool DF >
2080 struct DeclUppTrait< UpperMatrix<MT,SO,DF> >
2081 {
2082  using Type = UpperMatrix<MT,SO,DF>;
2083 };
2085 //*************************************************************************************************
2086 
2087 
2088 
2089 
2090 //=================================================================================================
2091 //
2092 // DECLDIAGTRAIT SPECIALIZATIONS
2093 //
2094 //=================================================================================================
2095 
2096 //*************************************************************************************************
2098 template< typename MT, bool SO, bool DF >
2099 struct DeclDiagTrait< UpperMatrix<MT,SO,DF> >
2100 {
2101  using Type = DiagonalMatrix<MT>;
2102 };
2104 //*************************************************************************************************
2105 
2106 
2107 
2108 
2109 //=================================================================================================
2110 //
2111 // HIGHTYPE SPECIALIZATIONS
2112 //
2113 //=================================================================================================
2114 
2115 //*************************************************************************************************
2117 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2118 struct HighType< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2119 {
2121 };
2123 //*************************************************************************************************
2124 
2125 
2126 
2127 
2128 //=================================================================================================
2129 //
2130 // LOWTYPE SPECIALIZATIONS
2131 //
2132 //=================================================================================================
2133 
2134 //*************************************************************************************************
2136 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2137 struct LowType< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2138 {
2140 };
2142 //*************************************************************************************************
2143 
2144 
2145 
2146 
2147 //=================================================================================================
2148 //
2149 // SUBMATRIXTRAIT SPECIALIZATIONS
2150 //
2151 //=================================================================================================
2152 
2153 //*************************************************************************************************
2155 template< typename MT, bool SO, bool DF >
2156 struct SubmatrixTrait< UpperMatrix<MT,SO,DF> >
2157 {
2158  using Type = SubmatrixTrait_<MT>;
2159 };
2161 //*************************************************************************************************
2162 
2163 
2164 
2165 
2166 //=================================================================================================
2167 //
2168 // ROWTRAIT SPECIALIZATIONS
2169 //
2170 //=================================================================================================
2171 
2172 //*************************************************************************************************
2174 template< typename MT, bool SO, bool DF >
2175 struct RowTrait< UpperMatrix<MT,SO,DF> >
2176 {
2177  using Type = RowTrait_<MT>;
2178 };
2180 //*************************************************************************************************
2181 
2182 
2183 
2184 
2185 //=================================================================================================
2186 //
2187 // COLUMNTRAIT SPECIALIZATIONS
2188 //
2189 //=================================================================================================
2190 
2191 //*************************************************************************************************
2193 template< typename MT, bool SO, bool DF >
2194 struct ColumnTrait< UpperMatrix<MT,SO,DF> >
2195 {
2196  using Type = ColumnTrait_<MT>;
2197 };
2199 //*************************************************************************************************
2200 
2201 } // namespace blaze
2202 
2203 #endif
Header file for auxiliary alias declarations.
Headerfile for the generic min algorithm.
Header file for the decldiag trait.
Header file for the Schur product trait.
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
Header file for the Rows type trait.
Header file for the UNUSED_PARAMETER function template.
Header file for the subtraction trait.
Flag for the inversion of a diagonal matrix.
Definition: InversionFlag.h:115
Flag for the inversion of a general matrix (same as byLU).
Definition: InversionFlag.h:108
Header file for the row trait.
Header file for the declherm trait.
Base template for the SubmatrixTrait class.
Definition: SubmatrixTrait.h:128
Flag for the inversion of a upper unitriangular matrix.
Definition: InversionFlag.h:114
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:127
Flag for the inversion of a lower unitriangular matrix.
Definition: InversionFlag.h:112
typename RowTrait< MT >::Type RowTrait_
Auxiliary alias declaration for the RowTrait type trait.The RowTrait_ alias declaration provides a co...
Definition: RowTrait.h:162
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
Base template for the DeclUppTrait class.
Definition: DeclUppTrait.h:133
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Header file for the dense matrix inversion flags.
Base template for the SchurTrait class.
Definition: SchurTrait.h:124
UpperMatrix specialization for dense matrices.
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:198
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:560
UpperMatrix specialization for sparse matrices.
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1762
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower or upper unitriangular matrix ty...
Definition: UniTriangular.h:81
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:250
Column< MT > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:124
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
Constraint on the data type.
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:78
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is an identity matrix.
Definition: DenseMatrix.h:1686
Constraint on the data type.
Compile time check for data types with restricted data access.This type trait tests whether the given...
Definition: IsRestricted.h:82
Header file for the IsSquare type trait.
Row< MT > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:124
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:772
Base template for the RowTrait class.
Definition: RowTrait.h:127
Flag for the inversion of a upper triangular matrix.
Definition: InversionFlag.h:113
Constraint on the data type.
Header file for the LowType type trait.
Base template for the HighType type trait.
Definition: HighType.h:133
Header file for the multiplication trait.
Header file for the unary map trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Flag for the LU-based matrix inversion.
Definition: InversionFlag.h:103
Header file for the IsShrinkable type trait.
Header file for all forward declarations of the math module.
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
Header file for the decllow trait.
void lu(const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO1 > &L, DenseMatrix< MT3, SO1 > &U, Matrix< MT4, SO2 > &P)
LU decomposition of the given dense matrix.
Definition: LU.h:219
Header file for the Columns type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3087
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Compile time check for square matrices.This type trait tests whether or not the given template parame...
Definition: IsSquare.h:88
Header file for the IsAligned type trait.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:340
Base template for the DeclSymTrait class.
Definition: DeclSymTrait.h:134
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type...
Definition: Upper.h:81
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:548
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:264
Header file for the RemoveAdaptor type trait.
Constraint on the data type.
Matrix adapter for upper triangular matrices.
Definition: BaseTemplate.h:553
Compile time check for adaptors.This type trait tests whether the given template parameter is an adap...
Definition: IsAdaptor.h:88
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:580
Header file for the IsPadded type trait.
Header file for the IsAdaptor type trait.
Compile time check for shrinkable data types.This type trait tests whether the given data type is a s...
Definition: IsShrinkable.h:75
Constraint on the data type.
Header file for the IsNumeric type trait.
Base template for the LowType type trait.
Definition: LowType.h:133
Header file for the HasConstDataAccess type trait.
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:75
Header file for the declupp trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
Header file for the binary map trait.
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:139
Base template for the DeclHermTrait class.
Definition: DeclHermTrait.h:134
Base template for the MultTrait class.
Definition: MultTrait.h:139
Header file for the addition trait.
Header file for the division trait.
Header file for the submatrix trait.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
Header file for the declsym trait.
Matrix adapter for Hermitian matrices.
Definition: BaseTemplate.h:614
Header file for the column trait.
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:270
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:101
#define BLAZE_CONSTRAINT_MUST_BE_BLAS_COMPATIBLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a BLAS compatible data type (i...
Definition: BLASCompatible.h:61
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
typename SubmatrixTrait< MT >::Type SubmatrixTrait_
Auxiliary alias declaration for the SubmatrixTrait type trait.The SubmatrixTrait_ alias declaration p...
Definition: SubmatrixTrait.h:163
Base template for the DivTrait class.
Definition: DivTrait.h:139
typename ColumnTrait< MT >::Type ColumnTrait_
Auxiliary alias declaration for the ColumnTrait type trait.The ColumnTrait_ alias declaration provide...
Definition: ColumnTrait.h:162
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:324
Base template for the DeclLowTrait class.
Definition: DeclLowTrait.h:133
Removal of top level adaptor types.In case the given type is an adaptor type (SymmetricMatrix, LowerMatrix, UpperMatrix, ...), the RemoveAdaptor type trait removes the adaptor and extracts the contained general matrix type. Else the given type is returned as is. Note that cv-qualifiers are preserved.
Definition: RemoveAdaptor.h:76
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:177
typename SubTrait< T1, T2 >::Type SubTrait_
Auxiliary alias declaration for the SubTrait class template.The SubTrait_ alias declaration provides ...
Definition: SubTrait.h:250
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
Header file for the isDivisor shim.
Header file for the IntegralConstant class template.
Compile time evaluation of the number of columns of a matrix.The Columns type trait evaluates the num...
Definition: Columns.h:75
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:252
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:75
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:600
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
Base template for the SubTrait class.
Definition: SubTrait.h:139
Matrix adapter for diagonal matrices.
Definition: BaseTemplate.h:560
Header file for the IsUpper type trait.
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.
Base template for the DeclDiagTrait class.
Definition: DeclDiagTrait.h:133
Base template for the BinaryMapTrait class.
Definition: BinaryMapTrait.h:119
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
Base template for the UnaryMapTrait class.
Definition: UnaryMapTrait.h:117
typename AddTrait< T1, T2 >::Type AddTrait_
Auxiliary alias declaration for the AddTrait class template.The AddTrait_ alias declaration provides ...
Definition: AddTrait.h:250
InversionFlag
Inversion flag.The InversionFlag type enumeration represents the different types of matrix inversion ...
Definition: InversionFlag.h:101
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.