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>
92 #include <blaze/util/Assert.h>
93 #include <blaze/util/EnableIf.h>
94 #include <blaze/util/TrueType.h>
96 #include <blaze/util/Unused.h>
97 
98 
99 namespace blaze {
100 
101 //=================================================================================================
102 //
103 // UPPERMATRIX OPERATORS
104 //
105 //=================================================================================================
106 
107 //*************************************************************************************************
110 template< typename MT, bool SO, bool DF >
111 inline void reset( UpperMatrix<MT,SO,DF>& m );
112 
113 template< typename MT, bool SO, bool DF >
114 inline void reset( UpperMatrix<MT,SO,DF>& m, size_t i );
115 
116 template< typename MT, bool SO, bool DF >
117 inline void clear( UpperMatrix<MT,SO,DF>& m );
118 
119 template< bool RF, typename MT, bool SO, bool DF >
120 inline bool isDefault( const UpperMatrix<MT,SO,DF>& m );
121 
122 template< typename MT, bool SO, bool DF >
123 inline bool isIntact( const UpperMatrix<MT,SO,DF>& m );
124 
125 template< typename MT, bool SO, bool DF >
126 inline void swap( UpperMatrix<MT,SO,DF>& a, UpperMatrix<MT,SO,DF>& b ) noexcept;
128 //*************************************************************************************************
129 
130 
131 //*************************************************************************************************
138 template< typename MT // Type of the adapted matrix
139  , bool SO // Storage order of the adapted matrix
140  , bool DF > // Density flag
141 inline void reset( UpperMatrix<MT,SO,DF>& m )
142 {
143  m.reset();
144 }
145 //*************************************************************************************************
146 
147 
148 //*************************************************************************************************
161 template< typename MT // Type of the adapted matrix
162  , bool SO // Storage order of the adapted matrix
163  , bool DF > // Density flag
164 inline void reset( UpperMatrix<MT,SO,DF>& m, size_t i )
165 {
166  m.reset( i );
167 }
168 //*************************************************************************************************
169 
170 
171 //*************************************************************************************************
178 template< typename MT // Type of the adapted matrix
179  , bool SO // Storage order of the adapted matrix
180  , bool DF > // Density flag
181 inline void clear( UpperMatrix<MT,SO,DF>& m )
182 {
183  m.clear();
184 }
185 //*************************************************************************************************
186 
187 
188 //*************************************************************************************************
216 template< bool RF // Relaxation flag
217  , typename MT // Type of the adapted matrix
218  , bool SO // Storage order of the adapted matrix
219  , bool DF > // Density flag
220 inline bool isDefault( const UpperMatrix<MT,SO,DF>& m )
221 {
222  return isDefault<RF>( m.matrix_ );
223 }
224 //*************************************************************************************************
225 
226 
227 //*************************************************************************************************
248 template< typename MT // Type of the adapted matrix
249  , bool SO // Storage order of the adapted matrix
250  , bool DF > // Density flag
251 inline bool isIntact( const UpperMatrix<MT,SO,DF>& m )
252 {
253  return m.isIntact();
254 }
255 //*************************************************************************************************
256 
257 
258 //*************************************************************************************************
266 template< typename MT // Type of the adapted matrix
267  , bool SO // Storage order of the adapted matrix
268  , bool DF > // Density flag
269 inline void swap( UpperMatrix<MT,SO,DF>& a, UpperMatrix<MT,SO,DF>& b ) noexcept
270 {
271  a.swap( b );
272 }
273 //*************************************************************************************************
274 
275 
276 //*************************************************************************************************
299 template< InversionFlag IF // Inversion algorithm
300  , typename MT // Type of the dense matrix
301  , bool SO > // Storage order of the dense matrix
302 inline void invert( UpperMatrix<MT,SO,true>& m )
303 {
305 
306  if( IF == asUniLower ) {
307  BLAZE_INTERNAL_ASSERT( isIdentity( m ), "Violation of preconditions detected" );
308  return;
309  }
310 
311  constexpr InversionFlag flag( ( IF == byLU || IF == asGeneral || IF == asUpper )
312  ? ( asUpper )
313  : ( ( IF == asUniUpper )
314  ?( asUniUpper )
315  :( asDiagonal ) ) );
316 
317  invert<flag>( derestrict( m ) );
318 
319  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
320 }
322 //*************************************************************************************************
323 
324 
325 //*************************************************************************************************
344 template< typename MT1, bool SO1, typename MT2, typename MT3, typename MT4, bool SO2 >
345 inline void lu( const UpperMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
347 {
349 
354 
359 
360  using ET2 = ElementType_<MT2>;
361  using ET4 = ElementType_<MT4>;
362 
363  const size_t n( (~A).rows() );
364 
365  decltype(auto) L2( derestrict( ~L ) );
366 
367  (~U) = A;
368 
369  resize( ~L, n, n );
370  reset( L2 );
371 
372  resize( ~P, n, n );
373  reset( ~P );
374 
375  for( size_t i=0UL; i<n; ++i ) {
376  L2(i,i) = ET2(1);
377  (~P)(i,i) = ET4(1);
378  }
379 }
381 //*************************************************************************************************
382 
383 
384 //*************************************************************************************************
400 template< typename MT // Type of the adapted matrix
401  , bool SO // Storage order of the adapted matrix
402  , bool DF // Density flag
403  , typename ET > // Type of the element
404 inline bool trySet( const UpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
405 {
406  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
407  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
408 
409  UNUSED_PARAMETER( mat );
410 
411  return ( i <= j || isDefault( value ) );
412 }
414 //*************************************************************************************************
415 
416 
417 //*************************************************************************************************
433 template< typename MT // Type of the adapted matrix
434  , bool SO // Storage order of the adapted matrix
435  , bool DF // Density flag
436  , typename ET > // Type of the element
437 inline bool tryAdd( const UpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
438 {
439  return trySet( mat, i, j, value );
440 }
442 //*************************************************************************************************
443 
444 
445 //*************************************************************************************************
461 template< typename MT // Type of the adapted matrix
462  , bool SO // Storage order of the adapted matrix
463  , bool DF // Density flag
464  , typename ET > // Type of the element
465 inline bool trySub( const UpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
466 {
467  return trySet( mat, i, j, value );
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 dense vector
493 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs,
494  const DenseVector<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( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
501 
502  UNUSED_PARAMETER( lhs );
503 
504  const size_t ibegin( ( column < row )?( 0UL ):( column - row + 1UL ) );
505 
506  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
507  if( !isDefault( (~rhs)[i] ) )
508  return false;
509  }
510 
511  return true;
512 }
514 //*************************************************************************************************
515 
516 
517 //*************************************************************************************************
533 template< typename MT // Type of the adapted matrix
534  , bool SO // Storage order of the adapted matrix
535  , bool DF // Density flag
536  , typename VT > // Type of the right-hand side dense vector
537 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs,
538  const DenseVector<VT,true>& rhs, size_t row, size_t column )
539 {
541 
542  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
543  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
544  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
545 
546  UNUSED_PARAMETER( lhs );
547 
548  if( row <= column )
549  return true;
550 
551  const size_t iend( min( row - column, (~rhs).size() ) );
552 
553  for( size_t i=0UL; i<iend; ++i ) {
554  if( !isDefault( (~rhs)[i] ) )
555  return false;
556  }
557 
558  return true;
559 }
561 //*************************************************************************************************
562 
563 
564 //*************************************************************************************************
582 template< typename MT // Type of the adapted matrix
583  , bool SO // Storage order of the adapted matrix
584  , bool DF // Density flag
585  , typename VT // Type of the right-hand side dense vector
586  , bool TF > // Transpose flag of the right-hand side dense vector
587 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
588  ptrdiff_t band, size_t row, size_t column )
589 {
591 
592  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
593  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
594  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
595  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
596 
597  UNUSED_PARAMETER( lhs, row, column );
598 
599  if( band < 0L ) {
600  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
601  if( !isDefault( (~rhs)[i] ) )
602  return false;
603  }
604  }
605 
606  return true;
607 }
609 //*************************************************************************************************
610 
611 
612 //*************************************************************************************************
628 template< typename MT // Type of the adapted matrix
629  , bool SO // Storage order of the adapted matrix
630  , bool DF // Density flag
631  , typename VT > // Type of the right-hand side sparse vector
632 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs,
633  const SparseVector<VT,false>& rhs, size_t row, size_t column )
634 {
636 
637  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
638  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
639  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
640 
641  UNUSED_PARAMETER( lhs );
642 
643  using RhsIterator = typename VT::ConstIterator;
644 
645  const RhsIterator last( (~rhs).end() );
646  RhsIterator element( (~rhs).lowerBound( ( column < row )?( 0UL ):( column - row + 1UL ) ) );
647 
648  for( ; element!=last; ++element ) {
649  if( !isDefault( element->value() ) )
650  return false;
651  }
652 
653  return true;
654 }
656 //*************************************************************************************************
657 
658 
659 //*************************************************************************************************
675 template< typename MT // Type of the adapted matrix
676  , bool SO // Storage order of the adapted matrix
677  , bool DF // Density flag
678  , typename VT > // Type of the right-hand side sparse vector
679 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs,
680  const SparseVector<VT,true>& rhs, size_t row, size_t column )
681 {
683 
684  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
685  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
686  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
687 
688  UNUSED_PARAMETER( lhs );
689 
690  using RhsIterator = typename VT::ConstIterator;
691 
692  if( row <= column )
693  return true;
694 
695  const RhsIterator last( (~rhs).lowerBound( row - column ) );
696 
697  for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
698  if( !isDefault( element->value() ) )
699  return false;
700  }
701 
702  return true;
703 }
705 //*************************************************************************************************
706 
707 
708 //*************************************************************************************************
726 template< typename MT // Type of the adapted matrix
727  , bool SO // Storage order of the adapted matrix
728  , bool DF // Density flag
729  , typename VT // Type of the right-hand side sparse vector
730  , bool TF > // Transpose flag of the right-hand side sparse vector
731 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
732  ptrdiff_t band, size_t row, size_t column )
733 {
735 
736  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
737  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
738  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
739  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
740 
741  UNUSED_PARAMETER( lhs, row, column );
742 
743  if( band < 0L ) {
744  for( const auto& element : ~rhs ) {
745  if( !isDefault( element.value() ) )
746  return false;
747  }
748  }
749 
750  return true;
751 }
753 //*************************************************************************************************
754 
755 
756 //*************************************************************************************************
772 template< typename MT1 // Type of the adapted matrix
773  , bool SO // Storage order of the adapted matrix
774  , bool DF // Density flag
775  , typename MT2 > // Type of the right-hand side dense matrix
776 inline bool tryAssign( const UpperMatrix<MT1,SO,DF>& lhs,
777  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
778 {
780 
781  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
782  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
783  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
784  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
785 
786  UNUSED_PARAMETER( lhs );
787 
788  const size_t M( (~rhs).rows() );
789  const size_t N( (~rhs).columns() );
790 
791  if( column + 1UL >= row + M )
792  return true;
793 
794  const size_t ibegin( ( column < row )?( 0UL ):( column - row + 1UL ) );
795 
796  for( size_t i=ibegin; i<M; ++i )
797  {
798  const size_t jend( min( row + i - column, N ) );
799 
800  for( size_t j=0UL; j<jend; ++j ) {
801  if( !isDefault( (~rhs)(i,j) ) )
802  return false;
803  }
804  }
805 
806  return true;
807 }
809 //*************************************************************************************************
810 
811 
812 //*************************************************************************************************
828 template< typename MT1 // Type of the adapted matrix
829  , bool SO // Storage order of the adapted matrix
830  , bool DF // Density flag
831  , typename MT2 > // Type of the right-hand side dense matrix
832 inline bool tryAssign( const UpperMatrix<MT1,SO,DF>& lhs,
833  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
834 {
836 
837  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
838  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
839  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
840  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
841 
842  UNUSED_PARAMETER( lhs );
843 
844  const size_t M( (~rhs).rows() );
845  const size_t N( (~rhs).columns() );
846 
847  if( column + 1UL >= row + M )
848  return true;
849 
850  const size_t jend( min( row + M - column - 1UL, N ) );
851 
852  for( size_t j=0UL; j<jend; ++j )
853  {
854  const bool containsDiagonal( column + j >= row );
855  const size_t ibegin( ( containsDiagonal )?( column + j - row + 1UL ):( 0UL ) );
856 
857  for( size_t i=ibegin; i<M; ++i ) {
858  if( !isDefault( (~rhs)(i,j) ) )
859  return false;
860  }
861  }
862 
863  return true;
864 }
866 //*************************************************************************************************
867 
868 
869 //*************************************************************************************************
885 template< typename MT1 // Type of the adapted matrix
886  , bool SO // Storage order of the adapted matrix
887  , bool DF // Density flag
888  , typename MT2 > // Type of the right-hand side sparse matrix
889 inline bool tryAssign( const UpperMatrix<MT1,SO,DF>& lhs,
890  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
891 {
893 
894  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
895  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
896  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
897  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
898 
899  UNUSED_PARAMETER( lhs );
900 
901  using RhsIterator = typename MT2::ConstIterator;
902 
903  const size_t M( (~rhs).rows() );
904  const size_t N( (~rhs).columns() );
905 
906  if( column + 1UL >= row + M )
907  return true;
908 
909  const size_t ibegin( ( column < row )?( 0UL ):( column - row + 1UL ) );
910 
911  for( size_t i=ibegin; i<M; ++i )
912  {
913  const size_t index( row + i - column );
914  const RhsIterator last( (~rhs).lowerBound( i, min( index, N ) ) );
915 
916  for( RhsIterator element=(~rhs).begin(i); element!=last; ++element ) {
917  if( !isDefault( element->value() ) )
918  return false;
919  }
920  }
921 
922  return true;
923 }
925 //*************************************************************************************************
926 
927 
928 //*************************************************************************************************
944 template< typename MT1 // Type of the adapted matrix
945  , bool SO // Storage order of the adapted matrix
946  , bool DF // Density flag
947  , typename MT2 > // Type of the right-hand side sparse matrix
948 inline bool tryAssign( const UpperMatrix<MT1,SO,DF>& lhs,
949  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
950 {
952 
953  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
954  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
955  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
956  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
957 
958  UNUSED_PARAMETER( lhs );
959 
960  using RhsIterator = typename MT2::ConstIterator;
961 
962  const size_t M( (~rhs).rows() );
963  const size_t N( (~rhs).columns() );
964 
965  if( column + 1UL >= row + M )
966  return true;
967 
968  const size_t jend( min( row + M - column - 1UL, N ) );
969 
970  for( size_t j=0UL; j<jend; ++j )
971  {
972  const bool containsDiagonal( column + j >= row );
973  const size_t index( ( containsDiagonal )?( column + j - row + 1UL ):( 0UL ) );
974 
975  const RhsIterator last( (~rhs).end(j) );
976  RhsIterator element( (~rhs).lowerBound( index, j ) );
977 
978  for( ; element!=last; ++element ) {
979  if( !isDefault( element->value() ) )
980  return false;
981  }
982  }
983 
984  return true;
985 }
987 //*************************************************************************************************
988 
989 
990 //*************************************************************************************************
1006 template< typename MT // Type of the adapted matrix
1007  , bool SO // Storage order of the adapted matrix
1008  , bool DF // Density flag
1009  , typename VT // Type of the right-hand side vector
1010  , bool TF > // Transpose flag of the right-hand side vector
1011 inline bool tryAddAssign( const UpperMatrix<MT,SO,DF>& lhs,
1012  const Vector<VT,TF>& rhs, size_t row, size_t column )
1013 {
1014  return tryAssign( lhs, ~rhs, row, column );
1015 }
1017 //*************************************************************************************************
1018 
1019 
1020 //*************************************************************************************************
1038 template< typename MT // Type of the adapted matrix
1039  , bool SO // Storage order of the adapted matrix
1040  , bool DF // Density flag
1041  , typename VT // Type of the right-hand side vector
1042  , bool TF > // Transpose flag of the right-hand side vector
1043 inline bool tryAddAssign( const UpperMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
1044  ptrdiff_t band, size_t row, size_t column )
1045 {
1046  return tryAssign( lhs, ~rhs, band, row, column );
1047 }
1049 //*************************************************************************************************
1050 
1051 
1052 //*************************************************************************************************
1068 template< typename MT1 // Type of the adapted matrix
1069  , bool SO1 // Storage order of the adapted matrix
1070  , bool DF // Density flag
1071  , typename MT2 // Type of the right-hand side matrix
1072  , bool SO2 > // Storage order of the right-hand side matrix
1073 inline bool tryAddAssign( const UpperMatrix<MT1,SO1,DF>& lhs,
1074  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1075 {
1076  return tryAssign( lhs, ~rhs, row, column );
1077 }
1079 //*************************************************************************************************
1080 
1081 
1082 //*************************************************************************************************
1098 template< typename MT // Type of the adapted matrix
1099  , bool SO // Storage order of the adapted matrix
1100  , bool DF // Density flag
1101  , typename VT // Type of the right-hand side vector
1102  , bool TF > // Transpose flag of the right-hand side vector
1103 inline bool trySubAssign( const UpperMatrix<MT,SO,DF>& lhs,
1104  const Vector<VT,TF>& rhs, size_t row, size_t column )
1105 {
1106  return tryAssign( lhs, ~rhs, row, column );
1107 }
1109 //*************************************************************************************************
1110 
1111 
1112 //*************************************************************************************************
1130 template< typename MT // Type of the adapted matrix
1131  , bool SO // Storage order of the adapted matrix
1132  , bool DF // Density flag
1133  , typename VT // Type of the right-hand side vector
1134  , bool TF > // Transpose flag of the right-hand side vector
1135 inline bool trySubAssign( const UpperMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
1136  ptrdiff_t band, size_t row, size_t column )
1137 {
1138  return tryAssign( lhs, ~rhs, band, row, column );
1139 }
1141 //*************************************************************************************************
1142 
1143 
1144 //*************************************************************************************************
1160 template< typename MT1 // Type of the adapted matrix
1161  , bool SO1 // Storage order of the adapted matrix
1162  , bool DF // Density flag
1163  , typename MT2 // Type of the right-hand side matrix
1164  , bool SO2 > // Storage order of the right-hand side matrix
1165 inline bool trySubAssign( const UpperMatrix<MT1,SO1,DF>& lhs,
1166  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1167 {
1168  return tryAssign( lhs, ~rhs, row, column );
1169 }
1171 //*************************************************************************************************
1172 
1173 
1174 //*************************************************************************************************
1188 template< typename MT // Type of the adapted matrix
1189  , bool SO // Storage order of the adapted matrix
1190  , bool DF > // Density flag
1191 inline MT& derestrict( UpperMatrix<MT,SO,DF>& m )
1192 {
1193  return m.matrix_;
1194 }
1196 //*************************************************************************************************
1197 
1198 
1199 
1200 
1201 //=================================================================================================
1202 //
1203 // SIZE SPECIALIZATIONS
1204 //
1205 //=================================================================================================
1206 
1207 //*************************************************************************************************
1209 template< typename MT, bool SO, bool DF >
1210 struct Size< UpperMatrix<MT,SO,DF>, 0UL >
1211  : public Size<MT,0UL>
1212 {};
1213 
1214 template< typename MT, bool SO, bool DF >
1215 struct Size< UpperMatrix<MT,SO,DF>, 1UL >
1216  : public Size<MT,1UL>
1217 {};
1219 //*************************************************************************************************
1220 
1221 
1222 
1223 
1224 //=================================================================================================
1225 //
1226 // ISSQUARE SPECIALIZATIONS
1227 //
1228 //=================================================================================================
1229 
1230 //*************************************************************************************************
1232 template< typename MT, bool SO, bool DF >
1233 struct IsSquare< UpperMatrix<MT,SO,DF> >
1234  : public TrueType
1235 {};
1237 //*************************************************************************************************
1238 
1239 
1240 
1241 
1242 //=================================================================================================
1243 //
1244 // ISUPPER SPECIALIZATIONS
1245 //
1246 //=================================================================================================
1247 
1248 //*************************************************************************************************
1250 template< typename MT, bool SO, bool DF >
1251 struct IsUpper< UpperMatrix<MT,SO,DF> >
1252  : public TrueType
1253 {};
1255 //*************************************************************************************************
1256 
1257 
1258 
1259 
1260 //=================================================================================================
1261 //
1262 // ISADAPTOR SPECIALIZATIONS
1263 //
1264 //=================================================================================================
1265 
1266 //*************************************************************************************************
1268 template< typename MT, bool SO, bool DF >
1269 struct IsAdaptor< UpperMatrix<MT,SO,DF> >
1270  : public TrueType
1271 {};
1273 //*************************************************************************************************
1274 
1275 
1276 
1277 
1278 //=================================================================================================
1279 //
1280 // ISRESTRICTED SPECIALIZATIONS
1281 //
1282 //=================================================================================================
1283 
1284 //*************************************************************************************************
1286 template< typename MT, bool SO, bool DF >
1287 struct IsRestricted< UpperMatrix<MT,SO,DF> >
1288  : public TrueType
1289 {};
1291 //*************************************************************************************************
1292 
1293 
1294 
1295 
1296 //=================================================================================================
1297 //
1298 // HASCONSTDATAACCESS SPECIALIZATIONS
1299 //
1300 //=================================================================================================
1301 
1302 //*************************************************************************************************
1304 template< typename MT, bool SO >
1305 struct HasConstDataAccess< UpperMatrix<MT,SO,true> >
1306  : public TrueType
1307 {};
1309 //*************************************************************************************************
1310 
1311 
1312 
1313 
1314 //=================================================================================================
1315 //
1316 // ISALIGNED SPECIALIZATIONS
1317 //
1318 //=================================================================================================
1319 
1320 //*************************************************************************************************
1322 template< typename MT, bool SO, bool DF >
1323 struct IsAligned< UpperMatrix<MT,SO,DF> >
1324  : public IsAligned<MT>
1325 {};
1327 //*************************************************************************************************
1328 
1329 
1330 
1331 
1332 //=================================================================================================
1333 //
1334 // ISCONTIGUOUS SPECIALIZATIONS
1335 //
1336 //=================================================================================================
1337 
1338 //*************************************************************************************************
1340 template< typename MT, bool SO, bool DF >
1341 struct IsContiguous< UpperMatrix<MT,SO,DF> >
1342  : public IsContiguous<MT>
1343 {};
1345 //*************************************************************************************************
1346 
1347 
1348 
1349 
1350 //=================================================================================================
1351 //
1352 // ISPADDED SPECIALIZATIONS
1353 //
1354 //=================================================================================================
1355 
1356 //*************************************************************************************************
1358 template< typename MT, bool SO, bool DF >
1359 struct IsPadded< UpperMatrix<MT,SO,DF> >
1360  : public IsPadded<MT>
1361 {};
1363 //*************************************************************************************************
1364 
1365 
1366 
1367 
1368 //=================================================================================================
1369 //
1370 // ISRESIZABLE SPECIALIZATIONS
1371 //
1372 //=================================================================================================
1373 
1374 //*************************************************************************************************
1376 template< typename MT, bool SO, bool DF >
1377 struct IsResizable< UpperMatrix<MT,SO,DF> >
1378  : public IsResizable<MT>
1379 {};
1381 //*************************************************************************************************
1382 
1383 
1384 
1385 
1386 //=================================================================================================
1387 //
1388 // ISSHRINKABLE SPECIALIZATIONS
1389 //
1390 //=================================================================================================
1391 
1392 //*************************************************************************************************
1394 template< typename MT, bool SO, bool DF >
1395 struct IsShrinkable< UpperMatrix<MT,SO,DF> >
1396  : public IsShrinkable<MT>
1397 {};
1399 //*************************************************************************************************
1400 
1401 
1402 
1403 
1404 //=================================================================================================
1405 //
1406 // REMOVEADAPTOR SPECIALIZATIONS
1407 //
1408 //=================================================================================================
1409 
1410 //*************************************************************************************************
1412 template< typename MT, bool SO, bool DF >
1413 struct RemoveAdaptor< UpperMatrix<MT,SO,DF> >
1414 {
1415  using Type = MT;
1416 };
1418 //*************************************************************************************************
1419 
1420 
1421 
1422 
1423 //=================================================================================================
1424 //
1425 // ADDTRAIT SPECIALIZATIONS
1426 //
1427 //=================================================================================================
1428 
1429 //*************************************************************************************************
1431 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1432 struct AddTrait< UpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1433 {
1435 };
1436 
1437 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1438 struct AddTrait< StaticMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1439 {
1440  using Type = AddTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1441 };
1442 
1443 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1444 struct AddTrait< UpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1445 {
1447 };
1448 
1449 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1450 struct AddTrait< HybridMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1451 {
1452  using Type = AddTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1453 };
1454 
1455 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1456 struct AddTrait< UpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1457 {
1458  using Type = AddTrait_< MT, DynamicMatrix<T,SO2> >;
1459 };
1460 
1461 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1462 struct AddTrait< DynamicMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1463 {
1464  using Type = AddTrait_< DynamicMatrix<T,SO1>, MT >;
1465 };
1466 
1467 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1468 struct AddTrait< UpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1469 {
1471 };
1472 
1473 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1474 struct AddTrait< CustomMatrix<T,AF,PF,SO1>, UpperMatrix<MT,SO2,DF> >
1475 {
1476  using Type = AddTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1477 };
1478 
1479 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1480 struct AddTrait< UpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1481 {
1483 };
1484 
1485 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1486 struct AddTrait< CompressedMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1487 {
1488  using Type = AddTrait_< CompressedMatrix<T,SO1>, MT >;
1489 };
1490 
1491 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1492 struct AddTrait< UpperMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1493 {
1495 };
1496 
1497 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1498 struct AddTrait< IdentityMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1499 {
1500  using Type = UpperMatrix< AddTrait_< IdentityMatrix<T,SO1>, MT > >;
1501 };
1502 
1503 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1504 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1505 {
1506  using Type = AddTrait_<MT1,MT2>;
1507 };
1508 
1509 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1510 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UpperMatrix<MT2,SO2,DF2> >
1511 {
1512  using Type = AddTrait_<MT1,MT2>;
1513 };
1514 
1515 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1516 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1517 {
1518  using Type = AddTrait_<MT1,MT2>;
1519 };
1520 
1521 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1522 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1523 {
1524  using Type = AddTrait_<MT1,MT2>;
1525 };
1526 
1527 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1528 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1529 {
1530  using Type = AddTrait_<MT1,MT2>;
1531 };
1532 
1533 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1534 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1535 {
1536  using Type = AddTrait_<MT1,MT2>;
1537 };
1538 
1539 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1540 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1541 {
1542  using Type = AddTrait_<MT1,MT2>;
1543 };
1544 
1545 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1546 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1547 {
1548  using Type = AddTrait_<MT1,MT2>;
1549 };
1550 
1551 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1552 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1553 {
1554  using Type = AddTrait_<MT1,MT2>;
1555 };
1556 
1557 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1558 struct AddTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1559 {
1560  using Type = AddTrait_<MT1,MT2>;
1561 };
1562 
1563 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1564 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1565 {
1566  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
1567 };
1569 //*************************************************************************************************
1570 
1571 
1572 
1573 
1574 //=================================================================================================
1575 //
1576 // SUBTRAIT SPECIALIZATIONS
1577 //
1578 //=================================================================================================
1579 
1580 //*************************************************************************************************
1582 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1583 struct SubTrait< UpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1584 {
1586 };
1587 
1588 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1589 struct SubTrait< StaticMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1590 {
1591  using Type = SubTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1592 };
1593 
1594 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1595 struct SubTrait< UpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1596 {
1598 };
1599 
1600 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1601 struct SubTrait< HybridMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1602 {
1603  using Type = SubTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1604 };
1605 
1606 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1607 struct SubTrait< UpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1608 {
1609  using Type = SubTrait_< MT, DynamicMatrix<T,SO2> >;
1610 };
1611 
1612 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1613 struct SubTrait< DynamicMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1614 {
1615  using Type = SubTrait_< DynamicMatrix<T,SO1>, MT >;
1616 };
1617 
1618 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1619 struct SubTrait< UpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1620 {
1622 };
1623 
1624 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1625 struct SubTrait< CustomMatrix<T,AF,PF,SO1>, UpperMatrix<MT,SO2,DF> >
1626 {
1627  using Type = SubTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1628 };
1629 
1630 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1631 struct SubTrait< UpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1632 {
1634 };
1635 
1636 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1637 struct SubTrait< CompressedMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1638 {
1639  using Type = SubTrait_< CompressedMatrix<T,SO1>, MT >;
1640 };
1641 
1642 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1643 struct SubTrait< UpperMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1644 {
1645  using Type = SubTrait_< MT, IdentityMatrix<T,SO2> >;
1646 };
1647 
1648 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1649 struct SubTrait< IdentityMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1650 {
1651  using Type = SubTrait_< IdentityMatrix<T,SO1>, MT >;
1652 };
1653 
1654 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1655 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1656 {
1657  using Type = SubTrait_<MT1,MT2>;
1658 };
1659 
1660 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1661 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UpperMatrix<MT2,SO2,DF2> >
1662 {
1663  using Type = SubTrait_<MT1,MT2>;
1664 };
1665 
1666 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1667 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1668 {
1669  using Type = SubTrait_<MT1,MT2>;
1670 };
1671 
1672 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1673 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1674 {
1675  using Type = SubTrait_<MT1,MT2>;
1676 };
1677 
1678 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1679 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1680 {
1681  using Type = SubTrait_<MT1,MT2>;
1682 };
1683 
1684 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1685 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1686 {
1687  using Type = SubTrait_<MT1,MT2>;
1688 };
1689 
1690 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1691 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1692 {
1693  using Type = SubTrait_<MT1,MT2>;
1694 };
1695 
1696 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1697 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1698 {
1699  using Type = SubTrait_<MT1,MT2>;
1700 };
1701 
1702 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1703 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1704 {
1705  using Type = SubTrait_<MT1,MT2>;
1706 };
1707 
1708 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1709 struct SubTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1710 {
1711  using Type = SubTrait_<MT1,MT2>;
1712 };
1713 
1714 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1715 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1716 {
1717  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
1718 };
1720 //*************************************************************************************************
1721 
1722 
1723 
1724 
1725 //=================================================================================================
1726 //
1727 // SCHURTRAIT SPECIALIZATIONS
1728 //
1729 //=================================================================================================
1730 
1731 //*************************************************************************************************
1733 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1734 struct SchurTrait< UpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1735 {
1737 };
1738 
1739 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1740 struct SchurTrait< StaticMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1741 {
1743 };
1744 
1745 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1746 struct SchurTrait< UpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1747 {
1749 };
1750 
1751 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1752 struct SchurTrait< HybridMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1753 {
1755 };
1756 
1757 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1758 struct SchurTrait< UpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1759 {
1761 };
1762 
1763 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1764 struct SchurTrait< DynamicMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1765 {
1767 };
1768 
1769 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1770 struct SchurTrait< UpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1771 {
1773 };
1774 
1775 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1776 struct SchurTrait< CustomMatrix<T,AF,PF,SO1>, UpperMatrix<MT,SO2,DF> >
1777 {
1779 };
1780 
1781 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1782 struct SchurTrait< UpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1783 {
1785 };
1786 
1787 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1788 struct SchurTrait< CompressedMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1789 {
1791 };
1792 
1793 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1794 struct SchurTrait< UpperMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1795 {
1797 };
1798 
1799 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1800 struct SchurTrait< IdentityMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1801 {
1803 };
1804 
1805 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1806 struct SchurTrait< UpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1807 {
1808  using Type = UpperMatrix< SchurTrait_<MT1,MT2> >;
1809 };
1810 
1811 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1812 struct SchurTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UpperMatrix<MT2,SO2,DF2> >
1813 {
1814  using Type = UpperMatrix< SchurTrait_<MT1,MT2> >;
1815 };
1816 
1817 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1818 struct SchurTrait< UpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1819 {
1820  using Type = UpperMatrix< SchurTrait_<MT1,MT2> >;
1821 };
1822 
1823 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1824 struct SchurTrait< HermitianMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1825 {
1826  using Type = UpperMatrix< SchurTrait_<MT1,MT2> >;
1827 };
1828 
1829 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1830 struct SchurTrait< UpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1831 {
1832  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1833 };
1834 
1835 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1836 struct SchurTrait< LowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1837 {
1838  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1839 };
1840 
1841 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1842 struct SchurTrait< UpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1843 {
1844  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1845 };
1846 
1847 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1848 struct SchurTrait< UniLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1849 {
1850  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1851 };
1852 
1853 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1854 struct SchurTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1855 {
1856  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1857 };
1858 
1859 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1860 struct SchurTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1861 {
1862  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1863 };
1864 
1865 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1866 struct SchurTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1867 {
1868  using Type = UpperMatrix< SchurTrait_<MT1,MT2> >;
1869 };
1871 //*************************************************************************************************
1872 
1873 
1874 
1875 
1876 //=================================================================================================
1877 //
1878 // MULTTRAIT SPECIALIZATIONS
1879 //
1880 //=================================================================================================
1881 
1882 //*************************************************************************************************
1884 template< typename MT, bool SO, bool DF, typename T >
1885 struct MultTrait< UpperMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
1886 {
1887  using Type = UpperMatrix< MultTrait_<MT,T> >;
1888 };
1889 
1890 template< typename T, typename MT, bool SO, bool DF >
1891 struct MultTrait< T, UpperMatrix<MT,SO,DF>, EnableIf_< IsNumeric<T> > >
1892 {
1893  using Type = UpperMatrix< MultTrait_<T,MT> >;
1894 };
1895 
1896 template< typename MT, bool SO, bool DF, typename T, size_t N >
1897 struct MultTrait< UpperMatrix<MT,SO,DF>, StaticVector<T,N,false> >
1898 {
1900 };
1901 
1902 template< typename T, size_t N, typename MT, bool SO, bool DF >
1903 struct MultTrait< StaticVector<T,N,true>, UpperMatrix<MT,SO,DF> >
1904 {
1905  using Type = MultTrait_< StaticVector<T,N,true>, MT >;
1906 };
1907 
1908 template< typename MT, bool SO, bool DF, typename T, size_t N >
1909 struct MultTrait< UpperMatrix<MT,SO,DF>, HybridVector<T,N,false> >
1910 {
1912 };
1913 
1914 template< typename T, size_t N, typename MT, bool SO, bool DF >
1915 struct MultTrait< HybridVector<T,N,true>, UpperMatrix<MT,SO,DF> >
1916 {
1917  using Type = MultTrait_< HybridVector<T,N,true>, MT >;
1918 };
1919 
1920 template< typename MT, bool SO, bool DF, typename T >
1921 struct MultTrait< UpperMatrix<MT,SO,DF>, DynamicVector<T,false> >
1922 {
1924 };
1925 
1926 template< typename T, typename MT, bool SO, bool DF >
1927 struct MultTrait< DynamicVector<T,true>, UpperMatrix<MT,SO,DF> >
1928 {
1929  using Type = MultTrait_< DynamicVector<T,true>, MT >;
1930 };
1931 
1932 template< typename MT, bool SO, bool DF, typename T, bool AF, bool PF >
1933 struct MultTrait< UpperMatrix<MT,SO,DF>, CustomVector<T,AF,PF,false> >
1934 {
1936 };
1937 
1938 template< typename T, bool AF, bool PF, typename MT, bool SO, bool DF >
1939 struct MultTrait< CustomVector<T,AF,PF,true>, UpperMatrix<MT,SO,DF> >
1940 {
1941  using Type = MultTrait_< CustomVector<T,AF,PF,true>, MT >;
1942 };
1943 
1944 template< typename MT, bool SO, bool DF, typename T >
1945 struct MultTrait< UpperMatrix<MT,SO,DF>, CompressedVector<T,false> >
1946 {
1948 };
1949 
1950 template< typename T, typename MT, bool SO, bool DF >
1951 struct MultTrait< CompressedVector<T,true>, UpperMatrix<MT,SO,DF> >
1952 {
1953  using Type = MultTrait_< CompressedVector<T,true>, MT >;
1954 };
1955 
1956 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1957 struct MultTrait< UpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1958 {
1960 };
1961 
1962 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1963 struct MultTrait< StaticMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1964 {
1965  using Type = MultTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1966 };
1967 
1968 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1969 struct MultTrait< UpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1970 {
1972 };
1973 
1974 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1975 struct MultTrait< HybridMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1976 {
1977  using Type = MultTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1978 };
1979 
1980 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1981 struct MultTrait< UpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1982 {
1983  using Type = MultTrait_< MT, DynamicMatrix<T,SO2> >;
1984 };
1985 
1986 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1987 struct MultTrait< DynamicMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1988 {
1989  using Type = MultTrait_< DynamicMatrix<T,SO1>, MT >;
1990 };
1991 
1992 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1993 struct MultTrait< UpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1994 {
1996 };
1997 
1998 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1999 struct MultTrait< CustomMatrix<T,AF,PF,SO1>, UpperMatrix<MT,SO2,DF> >
2000 {
2001  using Type = MultTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
2002 };
2003 
2004 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2005 struct MultTrait< UpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
2006 {
2008 };
2009 
2010 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2011 struct MultTrait< CompressedMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
2012 {
2013  using Type = MultTrait_< CompressedMatrix<T,SO1>, MT >;
2014 };
2015 
2016 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2017 struct MultTrait< UpperMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
2018 {
2020 };
2021 
2022 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2023 struct MultTrait< IdentityMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
2024 {
2026 };
2027 
2028 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
2029 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
2030 {
2031  using Type = MultTrait_<MT1,MT2>;
2032 };
2033 
2034 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
2035 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UpperMatrix<MT2,SO2,DF2> >
2036 {
2037  using Type = MultTrait_<MT1,MT2>;
2038 };
2039 
2040 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2041 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
2042 {
2043  using Type = MultTrait_<MT1,MT2>;
2044 };
2045 
2046 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2047 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2048 {
2049  using Type = MultTrait_<MT1,MT2>;
2050 };
2051 
2052 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2053 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
2054 {
2055  using Type = MultTrait_<MT1,MT2>;
2056 };
2057 
2058 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2059 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2060 {
2061  using Type = MultTrait_<MT1,MT2>;
2062 };
2063 
2064 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2065 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2066 {
2067  using Type = MultTrait_<MT1,MT2>;
2068 };
2069 
2070 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2071 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2072 {
2073  using Type = MultTrait_<MT1,MT2>;
2074 };
2075 
2076 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2077 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
2078 {
2079  using Type = MultTrait_<MT1,MT2>;
2080 };
2081 
2082 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2083 struct MultTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2084 {
2085  using Type = MultTrait_<MT1,MT2>;
2086 };
2087 
2088 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2089 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2090 {
2091  using Type = UpperMatrix< MultTrait_<MT1,MT2> >;
2092 };
2094 //*************************************************************************************************
2095 
2096 
2097 
2098 
2099 //=================================================================================================
2100 //
2101 // DIVTRAIT SPECIALIZATIONS
2102 //
2103 //=================================================================================================
2104 
2105 //*************************************************************************************************
2107 template< typename MT, bool SO, bool DF, typename T >
2108 struct DivTrait< UpperMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
2109 {
2110  using Type = UpperMatrix< DivTrait_<MT,T> >;
2111 };
2113 //*************************************************************************************************
2114 
2115 
2116 
2117 
2118 //=================================================================================================
2119 //
2120 // UNARYMAPTRAIT SPECIALIZATIONS
2121 //
2122 //=================================================================================================
2123 
2124 //*************************************************************************************************
2126 template< typename MT, bool SO, bool DF >
2127 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Abs >
2128 {
2129  using Type = UpperMatrix< UnaryMapTrait_<MT,Abs> >;
2130 };
2131 
2132 template< typename MT, bool SO, bool DF >
2133 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Floor >
2134 {
2136 };
2137 
2138 template< typename MT, bool SO, bool DF >
2139 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Ceil >
2140 {
2141  using Type = UpperMatrix< UnaryMapTrait_<MT,Ceil> >;
2142 };
2143 
2144 template< typename MT, bool SO, bool DF >
2145 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Trunc >
2146 {
2148 };
2149 
2150 template< typename MT, bool SO, bool DF >
2151 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Round >
2152 {
2154 };
2155 
2156 template< typename MT, bool SO, bool DF >
2157 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Conj >
2158 {
2159  using Type = UpperMatrix< UnaryMapTrait_<MT,Conj> >;
2160 };
2161 
2162 template< typename MT, bool SO, bool DF >
2163 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Real >
2164 {
2165  using Type = UpperMatrix< UnaryMapTrait_<MT,Real> >;
2166 };
2167 
2168 template< typename MT, bool SO, bool DF >
2169 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Imag >
2170 {
2171  using Type = UpperMatrix< UnaryMapTrait_<MT,Imag> >;
2172 };
2173 
2174 template< typename MT, bool SO, bool DF >
2175 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Sqrt >
2176 {
2177  using Type = UpperMatrix< UnaryMapTrait_<MT,Sqrt> >;
2178 };
2179 
2180 template< typename MT, bool SO, bool DF >
2181 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Cbrt >
2182 {
2183  using Type = UpperMatrix< UnaryMapTrait_<MT,Cbrt> >;
2184 };
2185 
2186 template< typename MT, bool SO, bool DF >
2187 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Sin >
2188 {
2189  using Type = UpperMatrix< UnaryMapTrait_<MT,Sin> >;
2190 };
2191 
2192 template< typename MT, bool SO, bool DF >
2193 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Asin >
2194 {
2195  using Type = UpperMatrix< UnaryMapTrait_<MT,Asin> >;
2196 };
2197 
2198 template< typename MT, bool SO, bool DF >
2199 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Sinh >
2200 {
2201  using Type = UpperMatrix< UnaryMapTrait_<MT,Sinh> >;
2202 };
2203 
2204 template< typename MT, bool SO, bool DF >
2205 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Asinh >
2206 {
2208 };
2209 
2210 template< typename MT, bool SO, bool DF >
2211 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Tan >
2212 {
2213  using Type = UpperMatrix< UnaryMapTrait_<MT,Tan> >;
2214 };
2215 
2216 template< typename MT, bool SO, bool DF >
2217 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Atan >
2218 {
2219  using Type = UpperMatrix< UnaryMapTrait_<MT,Atan> >;
2220 };
2221 
2222 template< typename MT, bool SO, bool DF >
2223 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Tanh >
2224 {
2225  using Type = UpperMatrix< UnaryMapTrait_<MT,Tanh> >;
2226 };
2227 
2228 template< typename MT, bool SO, bool DF >
2229 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Atanh >
2230 {
2232 };
2233 
2234 template< typename MT, bool SO, bool DF >
2235 struct UnaryMapTrait< UpperMatrix<MT,SO,DF>, Erf >
2236 {
2237  using Type = UpperMatrix< UnaryMapTrait_<MT,Erf> >;
2238 };
2240 //*************************************************************************************************
2241 
2242 
2243 
2244 
2245 //=================================================================================================
2246 //
2247 // BINARYMAPTRAIT SPECIALIZATIONS
2248 //
2249 //=================================================================================================
2250 
2251 //*************************************************************************************************
2253 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2254 struct BinaryMapTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2>, Min >
2255 {
2257 };
2258 
2259 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2260 struct BinaryMapTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2>, Max >
2261 {
2263 };
2265 //*************************************************************************************************
2266 
2267 
2268 
2269 
2270 //=================================================================================================
2271 //
2272 // DECLSYMTRAIT SPECIALIZATIONS
2273 //
2274 //=================================================================================================
2275 
2276 //*************************************************************************************************
2278 template< typename MT, bool SO, bool DF >
2279 struct DeclSymTrait< UpperMatrix<MT,SO,DF> >
2280 {
2281  using Type = DiagonalMatrix<MT>;
2282 };
2284 //*************************************************************************************************
2285 
2286 
2287 
2288 
2289 //=================================================================================================
2290 //
2291 // DECLHERMTRAIT SPECIALIZATIONS
2292 //
2293 //=================================================================================================
2294 
2295 //*************************************************************************************************
2297 template< typename MT, bool SO, bool DF >
2298 struct DeclHermTrait< UpperMatrix<MT,SO,DF> >
2299 {
2300  using Type = HermitianMatrix<MT>;
2301 };
2303 //*************************************************************************************************
2304 
2305 
2306 
2307 
2308 //=================================================================================================
2309 //
2310 // DECLLOWTRAIT SPECIALIZATIONS
2311 //
2312 //=================================================================================================
2313 
2314 //*************************************************************************************************
2316 template< typename MT, bool SO, bool DF >
2317 struct DeclLowTrait< UpperMatrix<MT,SO,DF> >
2318 {
2319  using Type = DiagonalMatrix<MT>;
2320 };
2322 //*************************************************************************************************
2323 
2324 
2325 
2326 
2327 //=================================================================================================
2328 //
2329 // DECLUPPTRAIT SPECIALIZATIONS
2330 //
2331 //=================================================================================================
2332 
2333 //*************************************************************************************************
2335 template< typename MT, bool SO, bool DF >
2336 struct DeclUppTrait< UpperMatrix<MT,SO,DF> >
2337 {
2338  using Type = UpperMatrix<MT,SO,DF>;
2339 };
2341 //*************************************************************************************************
2342 
2343 
2344 
2345 
2346 //=================================================================================================
2347 //
2348 // DECLDIAGTRAIT SPECIALIZATIONS
2349 //
2350 //=================================================================================================
2351 
2352 //*************************************************************************************************
2354 template< typename MT, bool SO, bool DF >
2355 struct DeclDiagTrait< UpperMatrix<MT,SO,DF> >
2356 {
2357  using Type = DiagonalMatrix<MT>;
2358 };
2360 //*************************************************************************************************
2361 
2362 
2363 
2364 
2365 //=================================================================================================
2366 //
2367 // HIGHTYPE SPECIALIZATIONS
2368 //
2369 //=================================================================================================
2370 
2371 //*************************************************************************************************
2373 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2374 struct HighType< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2375 {
2377 };
2379 //*************************************************************************************************
2380 
2381 
2382 
2383 
2384 //=================================================================================================
2385 //
2386 // LOWTYPE SPECIALIZATIONS
2387 //
2388 //=================================================================================================
2389 
2390 //*************************************************************************************************
2392 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2393 struct LowType< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2394 {
2396 };
2398 //*************************************************************************************************
2399 
2400 
2401 
2402 
2403 //=================================================================================================
2404 //
2405 // SUBMATRIXTRAIT SPECIALIZATIONS
2406 //
2407 //=================================================================================================
2408 
2409 //*************************************************************************************************
2411 template< typename MT, bool SO, bool DF, size_t... CSAs >
2412 struct SubmatrixTrait< UpperMatrix<MT,SO,DF>, CSAs... >
2413 {
2414  using Type = SubmatrixTrait_<MT,CSAs...>;
2415 };
2417 //*************************************************************************************************
2418 
2419 
2420 
2421 
2422 //=================================================================================================
2423 //
2424 // ROWTRAIT SPECIALIZATIONS
2425 //
2426 //=================================================================================================
2427 
2428 //*************************************************************************************************
2430 template< typename MT, bool SO, bool DF, size_t... CRAs >
2431 struct RowTrait< UpperMatrix<MT,SO,DF>, CRAs... >
2432 {
2433  using Type = RowTrait_<MT,CRAs...>;
2434 };
2436 //*************************************************************************************************
2437 
2438 
2439 
2440 
2441 //=================================================================================================
2442 //
2443 // ROWSTRAIT SPECIALIZATIONS
2444 //
2445 //=================================================================================================
2446 
2447 //*************************************************************************************************
2449 template< typename MT, bool SO, bool DF, size_t... CRAs >
2450 struct RowsTrait< UpperMatrix<MT,SO,DF>, CRAs... >
2451 {
2452  using Type = RowsTrait_<MT,CRAs...>;
2453 };
2455 //*************************************************************************************************
2456 
2457 
2458 
2459 
2460 //=================================================================================================
2461 //
2462 // COLUMNTRAIT SPECIALIZATIONS
2463 //
2464 //=================================================================================================
2465 
2466 //*************************************************************************************************
2468 template< typename MT, bool SO, bool DF, size_t... CCAs >
2469 struct ColumnTrait< UpperMatrix<MT,SO,DF>, CCAs... >
2470 {
2471  using Type = ColumnTrait_<MT,CCAs...>;
2472 };
2474 //*************************************************************************************************
2475 
2476 
2477 
2478 
2479 //=================================================================================================
2480 //
2481 // COLUMNSTRAIT SPECIALIZATIONS
2482 //
2483 //=================================================================================================
2484 
2485 //*************************************************************************************************
2487 template< typename MT, bool SO, bool DF, size_t... CCAs >
2488 struct ColumnsTrait< UpperMatrix<MT,SO,DF>, CCAs... >
2489 {
2490  using Type = ColumnsTrait_<MT,CCAs...>;
2491 };
2493 //*************************************************************************************************
2494 
2495 
2496 
2497 
2498 //=================================================================================================
2499 //
2500 // BANDTRAIT SPECIALIZATIONS
2501 //
2502 //=================================================================================================
2503 
2504 //*************************************************************************************************
2506 template< typename MT, bool SO, bool DF, ptrdiff_t... CBAs >
2507 struct BandTrait< UpperMatrix<MT,SO,DF>, CBAs... >
2508 {
2509  using Type = BandTrait_<MT,CBAs...>;
2510 };
2512 //*************************************************************************************************
2513 
2514 } // namespace blaze
2515 
2516 #endif
Pointer difference type of the Blaze library.
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:131
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 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:109
Flag for the inversion of a upper unitriangular matrix.
Definition: InversionFlag.h:114
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:108
Flag for the inversion of a lower unitriangular matrix.
Definition: InversionFlag.h:112
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:113
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:112
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:364
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
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:1903
#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:291
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:87
typename SubmatrixTrait< MT, CSAs... >::Type SubmatrixTrait_
Auxiliary alias declaration for the SubmatrixTrait type trait.The SubmatrixTrait_ alias declaration p...
Definition: SubmatrixTrait.h:145
Constraint on the data type.
typename RowTrait< MT, CRAs... >::Type RowTrait_
Auxiliary alias declaration for the RowTrait type trait.The RowTrait_ alias declaration provides a co...
Definition: RowTrait.h:145
Base template for the RowsTrait class.
Definition: RowsTrait.h:109
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
Header file for the band trait.
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is an identity matrix.
Definition: DenseMatrix.h:1827
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.
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:109
Flag for the inversion of a upper triangular matrix.
Definition: InversionFlag.h:113
Compile time check for the memory layout of data types.This type trait tests whether the given data t...
Definition: IsContiguous.h:86
Constraint on the data type.
typename ColumnTrait< MT, CCAs... >::Type ColumnTrait_
Auxiliary alias declaration for the ColumnTrait type trait.The ColumnTrait_ alias declaration provide...
Definition: ColumnTrait.h:144
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.
typename ColumnsTrait< MT, CCAs... >::Type ColumnsTrait_
Auxiliary alias declaration for the ColumnsTrait type trait.The ColumnsTrait_ alias declaration provi...
Definition: ColumnsTrait.h:145
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Flag for the LU-based matrix inversion.
Definition: InversionFlag.h:103
Header file for the IsShrinkable type trait.
Header file for all forward declarations of the math module.
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:221
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
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:76
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:506
Base template for the DeclSymTrait class.
Definition: DeclSymTrait.h:113
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:714
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:430
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
typename BandTrait< MT, CBAs... >::Type BandTrait_
Auxiliary alias declaration for the BandTrait type trait.The BandTrait_ alias declaration provides a ...
Definition: BandTrait.h:145
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:608
Header file for the IsPadded type trait.
Header file for the IsAdaptor type trait.
decltype(auto) band(Matrix< MT, SO > &matrix, RBAs... args)
Creating a view on a specific band of the given matrix.
Definition: Band.h:134
typename RowsTrait< MT, CRAs... >::Type RowsTrait_
Auxiliary alias declaration for the RowsTrait type trait.The RowsTrait_ alias declaration provides a ...
Definition: RowsTrait.h:145
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:119
Base template for the DeclHermTrait class.
Definition: DeclHermTrait.h:113
Base template for the MultTrait class.
Definition: MultTrait.h:119
Header file for the addition trait.
Header file for the division trait.
Header file for the submatrix trait.
Constraint on the data type.
Header file for the IsContiguous type trait.
Header file for the columns trait.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:131
#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:611
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:272
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
Base template for the DivTrait class.
Definition: DivTrait.h:120
Header file for the rows 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:490
Base template for the DeclLowTrait class.
Definition: DeclLowTrait.h:113
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 template for the ColumnsTrait class.
Definition: ColumnsTrait.h:109
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:291
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
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.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
#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:119
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:113
Base template for the BinaryMapTrait class.
Definition: BinaryMapTrait.h:97
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
Base template for the UnaryMapTrait class.
Definition: UnaryMapTrait.h:95
Header file for the Size type trait.
typename AddTrait< T1, T2 >::Type AddTrait_
Auxiliary alias declaration for the AddTrait class template.The AddTrait_ alias declaration provides ...
Definition: AddTrait.h:291
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.
Base template for the BandTrait class.
Definition: BandTrait.h:109