UniUpperMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
54 #include <blaze/math/Forward.h>
57 #include <blaze/math/shims/IsOne.h>
91 #include <blaze/util/Assert.h>
92 #include <blaze/util/EnableIf.h>
93 #include <blaze/util/TrueType.h>
95 #include <blaze/util/Unused.h>
96 
97 
98 namespace blaze {
99 
100 //=================================================================================================
101 //
102 // UNIUPPERMATRIX OPERATORS
103 //
104 //=================================================================================================
105 
106 //*************************************************************************************************
109 template< typename MT, bool SO, bool DF >
110 inline void reset( UniUpperMatrix<MT,SO,DF>& m );
111 
112 template< typename MT, bool SO, bool DF >
113 inline void reset( UniUpperMatrix<MT,SO,DF>& m, size_t i );
114 
115 template< typename MT, bool SO, bool DF >
116 inline void clear( UniUpperMatrix<MT,SO,DF>& m );
117 
118 template< bool RF, typename MT, bool SO, bool DF >
119 inline bool isDefault( const UniUpperMatrix<MT,SO,DF>& m );
120 
121 template< typename MT, bool SO, bool DF >
122 inline bool isIntact( const UniUpperMatrix<MT,SO,DF>& m );
123 
124 template< typename MT, bool SO, bool DF >
125 inline void swap( UniUpperMatrix<MT,SO,DF>& a, UniUpperMatrix<MT,SO,DF>& b ) noexcept;
127 //*************************************************************************************************
128 
129 
130 //*************************************************************************************************
137 template< typename MT // Type of the adapted matrix
138  , bool SO // Storage order of the adapted matrix
139  , bool DF > // Density flag
141 {
142  m.reset();
143 }
144 //*************************************************************************************************
145 
146 
147 //*************************************************************************************************
160 template< typename MT // Type of the adapted matrix
161  , bool SO // Storage order of the adapted matrix
162  , bool DF > // Density flag
163 inline void reset( UniUpperMatrix<MT,SO,DF>& m, size_t i )
164 {
165  m.reset( i );
166 }
167 //*************************************************************************************************
168 
169 
170 //*************************************************************************************************
177 template< typename MT // Type of the adapted matrix
178  , bool SO // Storage order of the adapted matrix
179  , bool DF > // Density flag
181 {
182  m.clear();
183 }
184 //*************************************************************************************************
185 
186 
187 //*************************************************************************************************
197 template< bool RF // Relaxation flag
198  , typename MT // Type of the adapted matrix
199  , bool SO // Storage order of the adapted matrix
200  , bool DF > // Density flag
201 inline bool isDefault_backend( const UniUpperMatrix<MT,SO,DF>& m, TrueType )
202 {
203  return ( m.rows() == 0UL );
204 }
206 //*************************************************************************************************
207 
208 
209 //*************************************************************************************************
219 template< bool RF // Relaxation flag
220  , typename MT // Type of the adapted matrix
221  , bool SO // Storage order of the adapted matrix
222  , bool DF > // Density flag
223 inline bool isDefault_backend( const UniUpperMatrix<MT,SO,DF>& m, FalseType )
224 {
225  return isIdentity<RF>( m );
226 }
228 //*************************************************************************************************
229 
230 
231 //*************************************************************************************************
258 template< bool RF // Relaxation flag
259  , typename MT // Type of the adapted matrix
260  , bool SO // Storage order of the adapted matrix
261  , bool DF > // Density flag
262 inline bool isDefault( const UniUpperMatrix<MT,SO,DF>& m )
263 {
264  return isDefault_backend<RF>( m, typename IsResizable<MT>::Type() );
265 }
266 //*************************************************************************************************
267 
268 
269 //*************************************************************************************************
290 template< typename MT // Type of the adapted matrix
291  , bool SO // Storage order of the adapted matrix
292  , bool DF > // Density flag
293 inline bool isIntact( const UniUpperMatrix<MT,SO,DF>& m )
294 {
295  return m.isIntact();
296 }
297 //*************************************************************************************************
298 
299 
300 //*************************************************************************************************
308 template< typename MT // Type of the adapted matrix
309  , bool SO // Storage order of the adapted matrix
310  , bool DF > // Density flag
312 {
313  a.swap( b );
314 }
315 //*************************************************************************************************
316 
317 
318 //*************************************************************************************************
341 template< InversionFlag IF // Inversion algorithm
342  , typename MT // Type of the dense matrix
343  , bool SO > // Storage order of the dense matrix
344 inline void invert( UniUpperMatrix<MT,SO,true>& m )
345 {
347 
348  if( IF == asLower || IF == asUniLower ) {
349  BLAZE_INTERNAL_ASSERT( isIdentity( m ), "Violation of preconditions detected" );
350  return;
351  }
352 
353  constexpr InversionFlag flag( ( IF == byLU || IF == asGeneral || IF == asUpper || IF == asUniUpper)
354  ? ( asUniUpper )
355  : ( asDiagonal ) );
356 
357  invert<flag>( derestrict( m ) );
358 
359  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
360 }
362 //*************************************************************************************************
363 
364 
365 //*************************************************************************************************
384 template< typename MT1, bool SO1, typename MT2, typename MT3, typename MT4, bool SO2 >
385 inline void lu( const UniUpperMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
387 {
389 
394 
399 
400  using ET2 = ElementType_<MT2>;
401  using ET4 = ElementType_<MT4>;
402 
403  const size_t n( (~A).rows() );
404 
405  decltype(auto) L2( derestrict( ~L ) );
406 
407  (~U) = A;
408 
409  resize( ~L, n, n );
410  reset( L2 );
411 
412  resize( ~P, n, n );
413  reset( ~P );
414 
415  for( size_t i=0UL; i<n; ++i ) {
416  L2(i,i) = ET2(1);
417  (~P)(i,i) = ET4(1);
418  }
419 }
421 //*************************************************************************************************
422 
423 
424 //*************************************************************************************************
440 template< typename MT // Type of the adapted matrix
441  , bool SO // Storage order of the adapted matrix
442  , bool DF // Density flag
443  , typename ET > // Type of the element
444 inline bool trySet( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
445 {
446  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
447  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
448 
449  UNUSED_PARAMETER( mat );
450 
451  if( i < j )
452  return true;
453  else if( i == j )
454  return isOne( value );
455  else
456  return isDefault( value );
457 }
459 //*************************************************************************************************
460 
461 
462 //*************************************************************************************************
478 template< typename MT // Type of the adapted matrix
479  , bool SO // Storage order of the adapted matrix
480  , bool DF // Density flag
481  , typename ET > // Type of the element
482 inline bool tryAdd( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
483 {
484  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
485  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
486 
487  UNUSED_PARAMETER( mat );
488 
489  if( i < j )
490  return true;
491  else
492  return isDefault( value );
493 }
495 //*************************************************************************************************
496 
497 
498 //*************************************************************************************************
514 template< typename MT // Type of the adapted matrix
515  , bool SO // Storage order of the adapted matrix
516  , bool DF // Density flag
517  , typename ET > // Type of the element
518 inline bool trySub( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
519 {
520  return tryAdd( mat, i, j, value );
521 }
523 //*************************************************************************************************
524 
525 
526 //*************************************************************************************************
542 template< typename MT // Type of the adapted matrix
543  , bool SO // Storage order of the adapted matrix
544  , bool DF // Density flag
545  , typename ET > // Type of the element
546 inline bool tryMult( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
547 {
548  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
549  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
550 
551  UNUSED_PARAMETER( mat );
552 
553  return ( i != j || isOne( value ) );
554 }
556 //*************************************************************************************************
557 
558 
559 //*************************************************************************************************
577 template< typename MT // Type of the adapted matrix
578  , bool SO // Storage order of the adapted matrix
579  , bool DF // Density flag
580  , typename ET > // Type of the element
582  tryMult( const UniUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
583 {
584  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
585  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
586  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
587  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
588 
589  UNUSED_PARAMETER( mat );
590 
591  return ( row >= column + n ) || ( column >= row + m ) || isOne( value );
592 }
594 //*************************************************************************************************
595 
596 
597 //*************************************************************************************************
613 template< typename MT // Type of the adapted matrix
614  , bool SO // Storage order of the adapted matrix
615  , bool DF // Density flag
616  , typename ET > // Type of the element
617 inline bool tryDiv( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
618 {
619  return tryMult( mat, i, j, value );
620 }
622 //*************************************************************************************************
623 
624 
625 //*************************************************************************************************
643 template< typename MT // Type of the adapted matrix
644  , bool SO // Storage order of the adapted matrix
645  , bool DF // Density flag
646  , typename ET > // Type of the element
648  tryDiv( const UniUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
649 {
650  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
651  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
652  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
653  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
654 
655  UNUSED_PARAMETER( mat );
656 
657  return ( row >= column + n ) || ( column >= row + m ) || isOne( value );
658 }
660 //*************************************************************************************************
661 
662 
663 //*************************************************************************************************
679 template< typename MT // Type of the adapted matrix
680  , bool SO // Storage order of the adapted matrix
681  , bool DF // Density flag
682  , typename VT > // Type of the right-hand side dense vector
683 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
684  const DenseVector<VT,false>& rhs, size_t row, size_t column )
685 {
687 
688  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
689  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
690  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
691 
692  UNUSED_PARAMETER( lhs );
693 
694  if( column >= row + (~rhs).size() )
695  return true;
696 
697  const bool containsDiagonal( column >= row );
698  const size_t ibegin( ( !containsDiagonal )?( 0UL ):( column - row + 1UL ) );
699 
700  if( containsDiagonal && !isOne( (~rhs)[column-row] ) )
701  return false;
702 
703  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
704  if( !isDefault( (~rhs)[i] ) )
705  return false;
706  }
707 
708  return true;
709 }
711 //*************************************************************************************************
712 
713 
714 //*************************************************************************************************
730 template< typename MT // Type of the adapted matrix
731  , bool SO // Storage order of the adapted matrix
732  , bool DF // Density flag
733  , typename VT > // Type of the right-hand side dense vector
734 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
735  const DenseVector<VT,true>& rhs, size_t row, size_t column )
736 {
738 
739  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
740  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
741  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
742 
743  UNUSED_PARAMETER( lhs );
744 
745  if( row < column )
746  return true;
747 
748  const bool containsDiagonal( row < column + (~rhs).size() );
749  const size_t iend( min( row - column, (~rhs).size() ) );
750 
751  for( size_t i=0UL; i<iend; ++i ) {
752  if( !isDefault( (~rhs)[i] ) )
753  return false;
754  }
755 
756  if( containsDiagonal && !isOne( (~rhs)[iend] ) )
757  return false;
758 
759  return true;
760 }
762 //*************************************************************************************************
763 
764 
765 //*************************************************************************************************
783 template< typename MT // Type of the adapted matrix
784  , bool SO // Storage order of the adapted matrix
785  , bool DF // Density flag
786  , typename VT // Type of the right-hand side dense vector
787  , bool TF > // Transpose flag of the right-hand side dense vector
788 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
789  ptrdiff_t band, size_t row, size_t column )
790 {
792 
793  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
794  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
795  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
796  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
797 
798  UNUSED_PARAMETER( lhs, row, column );
799 
800  if( band == 0L ) {
801  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
802  if( !isOne( (~rhs)[i] ) )
803  return false;
804  }
805  }
806  else if( band < 0L ) {
807  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
808  if( !isDefault( (~rhs)[i] ) )
809  return false;
810  }
811  }
812 
813  return true;
814 }
816 //*************************************************************************************************
817 
818 
819 //*************************************************************************************************
835 template< typename MT // Type of the adapted matrix
836  , bool SO // Storage order of the adapted matrix
837  , bool DF // Density flag
838  , typename VT > // Type of the right-hand side sparse vector
839 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
840  const SparseVector<VT,false>& rhs, size_t row, size_t column )
841 {
843 
844  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
845  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
846  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
847 
848  UNUSED_PARAMETER( lhs );
849 
850  using RhsIterator = typename VT::ConstIterator;
851 
852  if( column >= row + (~rhs).size() )
853  return true;
854 
855  const bool containsDiagonal( column >= row );
856  const size_t index( ( containsDiagonal )?( column - row ):( 0UL ) );
857  const RhsIterator last( (~rhs).end() );
858  RhsIterator element( (~rhs).lowerBound( index ) );
859 
860  if( containsDiagonal ) {
861  if( element == last || element->index() != index || !isOne( element->value() ) )
862  return false;
863  ++element;
864  }
865 
866  for( ; element!=last; ++element ) {
867  if( !isDefault( element->value() ) )
868  return false;
869  }
870 
871  return true;
872 }
874 //*************************************************************************************************
875 
876 
877 //*************************************************************************************************
893 template< typename MT // Type of the adapted matrix
894  , bool SO // Storage order of the adapted matrix
895  , bool DF // Density flag
896  , typename VT > // Type of the right-hand side sparse vector
897 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
898  const SparseVector<VT,true>& rhs, size_t row, size_t column )
899 {
901 
902  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
903  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
904  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
905 
906  UNUSED_PARAMETER( lhs );
907 
908  using RhsIterator = typename VT::ConstIterator;
909 
910  if( row < column )
911  return true;
912 
913  const bool containsDiagonal( row < column + (~rhs).size() );
914  const size_t index( row - column );
915  const RhsIterator last( (~rhs).lowerBound( index ) );
916 
917  if( containsDiagonal ) {
918  if( last == (~rhs).end() || last->index() != index || !isOne( last->value() ) )
919  return false;
920  }
921 
922  for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
923  if( !isDefault( element->value() ) )
924  return false;
925  }
926 
927  return true;
928 }
930 //*************************************************************************************************
931 
932 
933 //*************************************************************************************************
951 template< typename MT // Type of the adapted matrix
952  , bool SO // Storage order of the adapted matrix
953  , bool DF // Density flag
954  , typename VT // Type of the right-hand side sparse vector
955  , bool TF > // Transpose flag of the right-hand side sparse vector
956 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
957  ptrdiff_t band, size_t row, size_t column )
958 {
960 
961  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
962  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
963  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
964  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
965 
966  UNUSED_PARAMETER( lhs, row, column );
967 
968  if( band == 0L ) {
969  if( (~rhs).nonZeros() != (~rhs).size() )
970  return false;
971  for( const auto& element : ~rhs ) {
972  if( !isOne( element.value() ) )
973  return false;
974  }
975  }
976  else if( band < 0L ) {
977  for( const auto& element : ~rhs ) {
978  if( !isDefault( element.value() ) )
979  return false;
980  }
981  }
982 
983  return true;
984 }
986 //*************************************************************************************************
987 
988 
989 //*************************************************************************************************
1005 template< typename MT1 // Type of the adapted matrix
1006  , bool SO // Storage order of the adapted matrix
1007  , bool DF // Density flag
1008  , typename MT2 > // Type of the right-hand side dense matrix
1009 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1010  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
1011 {
1013 
1014  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1015  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1016  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1017  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1018 
1019  UNUSED_PARAMETER( lhs );
1020 
1021  const size_t M( (~rhs).rows() );
1022  const size_t N( (~rhs).columns() );
1023 
1024  if( column >= row + M )
1025  return true;
1026 
1027  const size_t ibegin( ( column < row )?( 0UL ):( column - row ) );
1028 
1029  for( size_t i=ibegin; i<M; ++i )
1030  {
1031  const size_t jend( min( row + i - column, N ) );
1032 
1033  for( size_t j=0UL; j<jend; ++j ) {
1034  if( !isDefault( (~rhs)(i,j) ) )
1035  return false;
1036  }
1037 
1038  const bool containsDiagonal( row + i < column + N );
1039 
1040  if( containsDiagonal && !isOne( (~rhs)(i,jend) ) )
1041  return false;
1042  }
1043 
1044  return true;
1045 }
1047 //*************************************************************************************************
1048 
1049 
1050 //*************************************************************************************************
1066 template< typename MT1 // Type of the adapted matrix
1067  , bool SO // Storage order of the adapted matrix
1068  , bool DF // Density flag
1069  , typename MT2 > // Type of the right-hand side dense matrix
1070 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1071  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
1072 {
1074 
1075  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1076  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1077  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1078  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1079 
1080  UNUSED_PARAMETER( lhs );
1081 
1082  const size_t M( (~rhs).rows() );
1083  const size_t N( (~rhs).columns() );
1084 
1085  if( column >= row + M )
1086  return true;
1087 
1088  const size_t jend( min( row + M - column, N ) );
1089 
1090  for( size_t j=0UL; j<jend; ++j )
1091  {
1092  const bool containsDiagonal( column + j >= row );
1093 
1094  if( containsDiagonal && !isOne( (~rhs)(column+j-row,j) ) )
1095  return false;
1096 
1097  const size_t ibegin( ( containsDiagonal )?( column + j - row + 1UL ):( 0UL ) );
1098 
1099  for( size_t i=ibegin; i<M; ++i ) {
1100  if( !isDefault( (~rhs)(i,j) ) )
1101  return false;
1102  }
1103  }
1104 
1105  return true;
1106 }
1108 //*************************************************************************************************
1109 
1110 
1111 //*************************************************************************************************
1127 template< typename MT1 // Type of the adapted matrix
1128  , bool SO // Storage order of the adapted matrix
1129  , bool DF // Density flag
1130  , typename MT2 > // Type of the right-hand side sparse matrix
1131 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1132  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
1133 {
1135 
1136  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1137  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1138  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1139  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1140 
1141  UNUSED_PARAMETER( lhs );
1142 
1143  using RhsIterator = typename MT2::ConstIterator;
1144 
1145  const size_t M( (~rhs).rows() );
1146  const size_t N( (~rhs).columns() );
1147 
1148  if( column >= row + M )
1149  return true;
1150 
1151  const size_t ibegin( ( column < row )?( 0UL ):( column - row ) );
1152 
1153  for( size_t i=ibegin; i<M; ++i )
1154  {
1155  const bool containsDiagonal( row + i < column + N );
1156 
1157  const size_t index( row + i - column );
1158  const RhsIterator last( (~rhs).lowerBound( i, min( index, N ) ) );
1159 
1160  if( containsDiagonal ) {
1161  if( last == (~rhs).end(i) || ( last->index() != index ) || !isOne( last->value() ) )
1162  return false;
1163  }
1164 
1165  for( RhsIterator element=(~rhs).begin(i); element!=last; ++element ) {
1166  if( !isDefault( element->value() ) )
1167  return false;
1168  }
1169  }
1170 
1171  return true;
1172 }
1174 //*************************************************************************************************
1175 
1176 
1177 //*************************************************************************************************
1193 template< typename MT1 // Type of the adapted matrix
1194  , bool SO // Storage order of the adapted matrix
1195  , bool DF // Density flag
1196  , typename MT2 > // Type of the right-hand side sparse matrix
1197 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1198  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
1199 {
1201 
1202  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1203  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1204  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1205  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1206 
1207  UNUSED_PARAMETER( lhs );
1208 
1209  using RhsIterator = typename MT2::ConstIterator;
1210 
1211  const size_t M( (~rhs).rows() );
1212  const size_t N( (~rhs).columns() );
1213 
1214  if( column >= row + M )
1215  return true;
1216 
1217  const size_t jend( min( row + M - column, N ) );
1218 
1219  for( size_t j=0UL; j<jend; ++j )
1220  {
1221  const bool containsDiagonal( column + j >= row );
1222  const size_t index( ( containsDiagonal )?( column + j - row ):( 0UL ) );
1223 
1224  const RhsIterator last( (~rhs).end(j) );
1225  RhsIterator element( (~rhs).lowerBound( index, j ) );
1226 
1227  if( containsDiagonal ) {
1228  if( element == last || ( element->index() != index ) || !isOne( element->value() ) )
1229  return false;
1230  ++element;
1231  }
1232 
1233  for( ; element!=last; ++element ) {
1234  if( !isDefault( element->value() ) )
1235  return false;
1236  }
1237  }
1238 
1239  return true;
1240 }
1242 //*************************************************************************************************
1243 
1244 
1245 //*************************************************************************************************
1262 template< typename MT // Type of the adapted matrix
1263  , bool SO // Storage order of the adapted matrix
1264  , bool DF // Density flag
1265  , typename VT > // Type of the right-hand side dense vector
1266 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1267  const DenseVector<VT,false>& rhs, size_t row, size_t column )
1268 {
1270 
1271  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1272  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1273  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1274 
1275  UNUSED_PARAMETER( lhs );
1276 
1277  const size_t ibegin( ( column <= row )?( 0UL ):( column - row ) );
1278 
1279  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
1280  if( !isDefault( (~rhs)[i] ) )
1281  return false;
1282  }
1283 
1284  return true;
1285 }
1287 //*************************************************************************************************
1288 
1289 
1290 //*************************************************************************************************
1307 template< typename MT // Type of the adapted matrix
1308  , bool SO // Storage order of the adapted matrix
1309  , bool DF // Density flag
1310  , typename VT > // Type of the right-hand side dense vector
1311 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1312  const DenseVector<VT,true>& rhs, size_t row, size_t column )
1313 {
1315 
1316  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1317  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1318  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1319 
1320  UNUSED_PARAMETER( lhs );
1321 
1322  if( row < column )
1323  return true;
1324 
1325  const size_t iend( min( row - column + 1UL, (~rhs).size() ) );
1326 
1327  for( size_t i=0UL; i<iend; ++i ) {
1328  if( !isDefault( (~rhs)[i] ) )
1329  return false;
1330  }
1331 
1332  return true;
1333 }
1335 //*************************************************************************************************
1336 
1337 
1338 //*************************************************************************************************
1355 template< typename MT // Type of the adapted matrix
1356  , bool SO // Storage order of the adapted matrix
1357  , bool DF // Density flag
1358  , typename VT // Type of the right-hand side dense vector
1359  , bool TF > // Transpose flag of the right-hand side dense vector
1360 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
1361  ptrdiff_t band, size_t row, size_t column )
1362 {
1364 
1365  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1366  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1367  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1368  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1369 
1370  UNUSED_PARAMETER( lhs, row, column );
1371 
1372  if( band <= 0L ) {
1373  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
1374  if( !isDefault( (~rhs)[i] ) )
1375  return false;
1376  }
1377  }
1378 
1379  return true;
1380 }
1382 //*************************************************************************************************
1383 
1384 
1385 //*************************************************************************************************
1402 template< typename MT // Type of the adapted matrix
1403  , bool SO // Storage order of the adapted matrix
1404  , bool DF // Density flag
1405  , typename VT > // Type of the right-hand side sparse vector
1406 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1407  const SparseVector<VT,false>& rhs, size_t row, size_t column )
1408 {
1410 
1411  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1412  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1413  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1414 
1415  UNUSED_PARAMETER( lhs );
1416 
1417  using RhsIterator = typename VT::ConstIterator;
1418 
1419  const RhsIterator last( (~rhs).end() );
1420  RhsIterator element( (~rhs).lowerBound( ( column <= row )?( 0UL ):( column - row ) ) );
1421 
1422  for( ; element!=last; ++element ) {
1423  if( !isDefault( element->value() ) )
1424  return false;
1425  }
1426 
1427  return true;
1428 }
1430 //*************************************************************************************************
1431 
1432 
1433 //*************************************************************************************************
1450 template< typename MT // Type of the adapted matrix
1451  , bool SO // Storage order of the adapted matrix
1452  , bool DF // Density flag
1453  , typename VT > // Type of the right-hand side sparse vector
1454 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1455  const SparseVector<VT,true>& rhs, size_t row, size_t column )
1456 {
1458 
1459  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1460  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1461  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1462 
1463  UNUSED_PARAMETER( lhs );
1464 
1465  using RhsIterator = typename VT::ConstIterator;
1466 
1467  if( row < column )
1468  return true;
1469 
1470  const RhsIterator last( (~rhs).lowerBound( row - column + 1UL ) );
1471 
1472  for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
1473  if( !isDefault( element->value() ) )
1474  return false;
1475  }
1476 
1477  return true;
1478 }
1480 //*************************************************************************************************
1481 
1482 
1483 //*************************************************************************************************
1500 template< typename MT // Type of the adapted matrix
1501  , bool SO // Storage order of the adapted matrix
1502  , bool DF // Density flag
1503  , typename VT // Type of the right-hand side sparse vector
1504  , bool TF > // Transpose flag of the right-hand side sparse vector
1505 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
1506  ptrdiff_t band, size_t row, size_t column )
1507 {
1509 
1510  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1511  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1512  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1513  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1514 
1515  UNUSED_PARAMETER( lhs, row, column );
1516 
1517  if( band <= 0L ) {
1518  for( const auto& element : ~rhs ) {
1519  if( !isDefault( element.value() ) )
1520  return false;
1521  }
1522  }
1523 
1524  return true;
1525 }
1527 //*************************************************************************************************
1528 
1529 
1530 //*************************************************************************************************
1547 template< typename MT1 // Type of the adapted matrix
1548  , bool SO // Storage order of the adapted matrix
1549  , bool DF // Density flag
1550  , typename MT2 > // Type of the right-hand side dense matrix
1551 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1552  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
1553 {
1555 
1556  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1557  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1558  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1559  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1560 
1561  UNUSED_PARAMETER( lhs );
1562 
1563  const size_t M( (~rhs).rows() );
1564  const size_t N( (~rhs).columns() );
1565 
1566  if( column >= row + M )
1567  return true;
1568 
1569  const size_t ibegin( ( column <= row )?( 0UL ):( column - row ) );
1570 
1571  for( size_t i=ibegin; i<M; ++i )
1572  {
1573  const size_t jend( min( row + i - column + 1UL, N ) );
1574 
1575  for( size_t j=0UL; j<jend; ++j ) {
1576  if( !isDefault( (~rhs)(i,j) ) )
1577  return false;
1578  }
1579  }
1580 
1581  return true;
1582 }
1584 //*************************************************************************************************
1585 
1586 
1587 //*************************************************************************************************
1604 template< typename MT1 // Type of the adapted matrix
1605  , bool SO // Storage order of the adapted matrix
1606  , bool DF // Density flag
1607  , typename MT2 > // Type of the right-hand side dense matrix
1608 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1609  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
1610 {
1612 
1613  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1614  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1615  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1616  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1617 
1618  UNUSED_PARAMETER( lhs );
1619 
1620  const size_t M( (~rhs).rows() );
1621  const size_t N( (~rhs).columns() );
1622 
1623  if( column >= row + M )
1624  return true;
1625 
1626  const size_t jend( min( row + M - column, N ) );
1627 
1628  for( size_t j=0UL; j<jend; ++j )
1629  {
1630  const bool containsDiagonal( column + j >= row );
1631  const size_t ibegin( ( containsDiagonal )?( column + j - row ):( 0UL ) );
1632 
1633  for( size_t i=ibegin; i<M; ++i ) {
1634  if( !isDefault( (~rhs)(i,j) ) )
1635  return false;
1636  }
1637  }
1638 
1639  return true;
1640 }
1642 //*************************************************************************************************
1643 
1644 
1645 //*************************************************************************************************
1662 template< typename MT1 // Type of the adapted matrix
1663  , bool SO // Storage order of the adapted matrix
1664  , bool DF // Density flag
1665  , typename MT2 > // Type of the right-hand side sparse matrix
1666 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1667  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
1668 {
1670 
1671  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1672  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1673  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1674  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1675 
1676  UNUSED_PARAMETER( lhs );
1677 
1678  using RhsIterator = typename MT2::ConstIterator;
1679 
1680  const size_t M( (~rhs).rows() );
1681  const size_t N( (~rhs).columns() );
1682 
1683  if( column >= row + M )
1684  return true;
1685 
1686  const size_t ibegin( ( column < row )?( 0UL ):( column - row ) );
1687 
1688  for( size_t i=ibegin; i<M; ++i )
1689  {
1690  const size_t index( row + i - column + 1UL );
1691  const RhsIterator last( (~rhs).lowerBound( i, min( index, N ) ) );
1692 
1693  for( RhsIterator element=(~rhs).begin(i); element!=last; ++element ) {
1694  if( !isDefault( element->value() ) )
1695  return false;
1696  }
1697  }
1698 
1699  return true;
1700 }
1702 //*************************************************************************************************
1703 
1704 
1705 //*************************************************************************************************
1722 template< typename MT1 // Type of the adapted matrix
1723  , bool SO // Storage order of the adapted matrix
1724  , bool DF // Density flag
1725  , typename MT2 > // Type of the right-hand side sparse matrix
1726 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1727  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
1728 {
1730 
1731  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1732  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1733  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1734  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1735 
1736  UNUSED_PARAMETER( lhs );
1737 
1738  using RhsIterator = typename MT2::ConstIterator;
1739 
1740  const size_t M( (~rhs).rows() );
1741  const size_t N( (~rhs).columns() );
1742 
1743  if( column >= row + M )
1744  return true;
1745 
1746  const size_t jend( min( row + M - column, N ) );
1747 
1748  for( size_t j=0UL; j<jend; ++j )
1749  {
1750  const bool containsDiagonal( column + j >= row );
1751  const size_t index( ( containsDiagonal )?( column + j - row ):( 0UL ) );
1752 
1753  const RhsIterator last( (~rhs).end(j) );
1754  RhsIterator element( (~rhs).lowerBound( index, j ) );
1755 
1756  for( ; element!=last; ++element ) {
1757  if( !isDefault( element->value() ) )
1758  return false;
1759  }
1760  }
1761 
1762  return true;
1763 }
1765 //*************************************************************************************************
1766 
1767 
1768 //*************************************************************************************************
1785 template< typename MT // Type of the adapted matrix
1786  , bool SO // Storage order of the adapted matrix
1787  , bool DF // Density flag
1788  , typename VT // Type of the right-hand side vector
1789  , bool TF > // Transpose flag of the right-hand side vector
1790 inline bool trySubAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1791  const Vector<VT,TF>& rhs, size_t row, size_t column )
1792 {
1793  return tryAddAssign( lhs, ~rhs, row, column );
1794 }
1796 //*************************************************************************************************
1797 
1798 
1799 //*************************************************************************************************
1817 template< typename MT // Type of the adapted matrix
1818  , bool SO // Storage order of the adapted matrix
1819  , bool DF // Density flag
1820  , typename VT // Type of the right-hand side vector
1821  , bool TF > // Transpose flag of the right-hand side vector
1822 inline bool trySubAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
1823  ptrdiff_t band, size_t row, size_t column )
1824 {
1825  return tryAddAssign( lhs, ~rhs, band, row, column );
1826 }
1828 //*************************************************************************************************
1829 
1830 
1831 //*************************************************************************************************
1848 template< typename MT1 // Type of the adapted matrix
1849  , bool SO1 // Storage order of the adapted matrix
1850  , bool DF // Density flag
1851  , typename MT2 // Type of the right-hand side matrix
1852  , bool SO2 > // Storage order of the right-hand side matrix
1853 inline bool trySubAssign( const UniUpperMatrix<MT1,SO1,DF>& lhs,
1854  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1855 {
1856  return tryAddAssign( lhs, ~rhs, row, column );
1857 }
1859 //*************************************************************************************************
1860 
1861 
1862 //*************************************************************************************************
1879 template< typename MT // Type of the adapted matrix
1880  , bool SO // Storage order of the adapted matrix
1881  , bool DF // Density flag
1882  , typename VT > // Type of the right-hand side vector
1883 inline bool tryMultAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1884  const Vector<VT,false>& rhs, size_t row, size_t column )
1885 {
1887 
1888  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1889  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1890  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1891 
1892  UNUSED_PARAMETER( lhs );
1893 
1894  return ( column < row || (~rhs).size() <= column - row || isOne( (~rhs)[column-row] ) );
1895 }
1897 //*************************************************************************************************
1898 
1899 
1900 //*************************************************************************************************
1917 template< typename MT // Type of the adapted matrix
1918  , bool SO // Storage order of the adapted matrix
1919  , bool DF // Density flag
1920  , typename VT > // Type of the right-hand side vector
1921 inline bool tryMultAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1922  const Vector<VT,true>& rhs, size_t row, size_t column )
1923 {
1925 
1926  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1927  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1928  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1929 
1930  UNUSED_PARAMETER( lhs );
1931 
1932  return ( row < column || (~rhs).size() <= row - column || isOne( (~rhs)[row-column] ) );
1933 }
1935 //*************************************************************************************************
1936 
1937 
1938 //*************************************************************************************************
1955 template< typename MT // Type of the adapted matrix
1956  , bool SO // Storage order of the adapted matrix
1957  , bool DF // Density flag
1958  , typename VT // Type of the right-hand side dense vector
1959  , bool TF > // Transpose flag of the right-hand side dense vector
1960 inline bool tryMultAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
1961  ptrdiff_t band, size_t row, size_t column )
1962 {
1964 
1965  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1966  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1967  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1968  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1969 
1970  UNUSED_PARAMETER( lhs, row, column );
1971 
1972  if( band == 0L ) {
1973  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
1974  if( !isOne( (~rhs)[i] ) )
1975  return false;
1976  }
1977  }
1978 
1979  return true;
1980 }
1982 //*************************************************************************************************
1983 
1984 
1985 //*************************************************************************************************
2002 template< typename MT // Type of the adapted matrix
2003  , bool SO // Storage order of the adapted matrix
2004  , bool DF // Density flag
2005  , typename VT // Type of the right-hand side sparse vector
2006  , bool TF > // Transpose flag of the right-hand side sparse vector
2007 inline bool tryMultAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
2008  ptrdiff_t band, size_t row, size_t column )
2009 {
2011 
2012  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2013  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2014  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2015  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2016 
2017  UNUSED_PARAMETER( lhs, row, column );
2018 
2019  if( band == 0L ) {
2020  if( (~rhs).nonZeros() != (~rhs).size() )
2021  return false;
2022  for( const auto& element : ~rhs ) {
2023  if( !isOne( element.value() ) )
2024  return false;
2025  }
2026  }
2027 
2028  return true;
2029 }
2031 //*************************************************************************************************
2032 
2033 
2034 //*************************************************************************************************
2051 template< typename MT1 // Type of the adapted matrix
2052  , bool SO1 // Storage order of the adapted matrix
2053  , bool DF // Density flag
2054  , typename MT2 // Type of the right-hand side matrix
2055  , bool SO2 > // Storage order of the right-hand side matrix
2056 inline bool trySchurAssign( const UniUpperMatrix<MT1,SO1,DF>& lhs,
2057  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
2058 {
2060 
2061  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2062  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2063  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
2064  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
2065 
2066  UNUSED_PARAMETER( lhs );
2067 
2068  const size_t M( (~rhs).rows() );
2069  const size_t N( (~rhs).columns() );
2070 
2071  if( ( row >= column + N ) || ( column >= row + M ) )
2072  return true;
2073 
2074  size_t i( row < column ? column - row : 0UL );
2075  size_t j( column < row ? row - column : 0UL );
2076 
2077  for( ; i<M && j<N; ++i, ++j )
2078  {
2079  if( !isOne( (~rhs)(i,j) ) )
2080  return false;
2081  }
2082 
2083  return true;
2084 }
2086 //*************************************************************************************************
2087 
2088 
2089 //*************************************************************************************************
2105 template< typename MT // Type of the adapted matrix
2106  , bool SO // Storage order of the adapted matrix
2107  , bool DF // Density flag
2108  , typename VT // Type of the right-hand side vector
2109  , bool TF > // Transpose flag of the right-hand side vector
2110 inline bool tryDivAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
2111  const Vector<VT,TF>& rhs, size_t row, size_t column )
2112 {
2113  return tryMultAssign( lhs, ~rhs, row, column );
2114 }
2116 //*************************************************************************************************
2117 
2118 
2119 //*************************************************************************************************
2136 template< typename MT // Type of the adapted matrix
2137  , bool SO // Storage order of the adapted matrix
2138  , bool DF // Density flag
2139  , typename VT // Type of the right-hand side vector
2140  , bool TF > // Transpose flag of the right-hand side vector
2141 inline bool tryDivAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
2142  ptrdiff_t band, size_t row, size_t column )
2143 {
2144  return tryMultAssign( lhs, rhs, band, row, column );
2145 }
2147 //*************************************************************************************************
2148 
2149 
2150 //*************************************************************************************************
2164 template< typename MT // Type of the adapted matrix
2165  , bool SO // Storage order of the adapted matrix
2166  , bool DF > // Density flag
2167 inline MT& derestrict( UniUpperMatrix<MT,SO,DF>& m )
2168 {
2169  return m.matrix_;
2170 }
2172 //*************************************************************************************************
2173 
2174 
2175 
2176 
2177 //=================================================================================================
2178 //
2179 // SIZE SPECIALIZATIONS
2180 //
2181 //=================================================================================================
2182 
2183 //*************************************************************************************************
2185 template< typename MT, bool SO, bool DF >
2186 struct Size< UniUpperMatrix<MT,SO,DF>, 0UL >
2187  : public Size<MT,0UL>
2188 {};
2189 
2190 template< typename MT, bool SO, bool DF >
2191 struct Size< UniUpperMatrix<MT,SO,DF>, 1UL >
2192  : public Size<MT,1UL>
2193 {};
2195 //*************************************************************************************************
2196 
2197 
2198 
2199 
2200 //=================================================================================================
2201 //
2202 // ISSQUARE SPECIALIZATIONS
2203 //
2204 //=================================================================================================
2205 
2206 //*************************************************************************************************
2208 template< typename MT, bool SO, bool DF >
2209 struct IsSquare< UniUpperMatrix<MT,SO,DF> >
2210  : public TrueType
2211 {};
2213 //*************************************************************************************************
2214 
2215 
2216 
2217 
2218 //=================================================================================================
2219 //
2220 // ISUNIUPPER SPECIALIZATIONS
2221 //
2222 //=================================================================================================
2223 
2224 //*************************************************************************************************
2226 template< typename MT, bool SO, bool DF >
2227 struct IsUniUpper< UniUpperMatrix<MT,SO,DF> >
2228  : public TrueType
2229 {};
2231 //*************************************************************************************************
2232 
2233 
2234 
2235 
2236 //=================================================================================================
2237 //
2238 // ISADAPTOR SPECIALIZATIONS
2239 //
2240 //=================================================================================================
2241 
2242 //*************************************************************************************************
2244 template< typename MT, bool SO, bool DF >
2245 struct IsAdaptor< UniUpperMatrix<MT,SO,DF> >
2246  : public TrueType
2247 {};
2249 //*************************************************************************************************
2250 
2251 
2252 
2253 
2254 //=================================================================================================
2255 //
2256 // ISRESTRICTED SPECIALIZATIONS
2257 //
2258 //=================================================================================================
2259 
2260 //*************************************************************************************************
2262 template< typename MT, bool SO, bool DF >
2263 struct IsRestricted< UniUpperMatrix<MT,SO,DF> >
2264  : public TrueType
2265 {};
2267 //*************************************************************************************************
2268 
2269 
2270 
2271 
2272 //=================================================================================================
2273 //
2274 // HASCONSTDATAACCESS SPECIALIZATIONS
2275 //
2276 //=================================================================================================
2277 
2278 //*************************************************************************************************
2280 template< typename MT, bool SO >
2281 struct HasConstDataAccess< UniUpperMatrix<MT,SO,true> >
2282  : public TrueType
2283 {};
2285 //*************************************************************************************************
2286 
2287 
2288 
2289 
2290 //=================================================================================================
2291 //
2292 // ISALIGNED SPECIALIZATIONS
2293 //
2294 //=================================================================================================
2295 
2296 //*************************************************************************************************
2298 template< typename MT, bool SO, bool DF >
2299 struct IsAligned< UniUpperMatrix<MT,SO,DF> >
2300  : public IsAligned<MT>
2301 {};
2303 //*************************************************************************************************
2304 
2305 
2306 
2307 
2308 //=================================================================================================
2309 //
2310 // ISCONTIGUOUS SPECIALIZATIONS
2311 //
2312 //=================================================================================================
2313 
2314 //*************************************************************************************************
2316 template< typename MT, bool SO, bool DF >
2317 struct IsContiguous< UniUpperMatrix<MT,SO,DF> >
2318  : public IsContiguous<MT>
2319 {};
2321 //*************************************************************************************************
2322 
2323 
2324 
2325 
2326 //=================================================================================================
2327 //
2328 // ISPADDED SPECIALIZATIONS
2329 //
2330 //=================================================================================================
2331 
2332 //*************************************************************************************************
2334 template< typename MT, bool SO, bool DF >
2335 struct IsPadded< UniUpperMatrix<MT,SO,DF> >
2336  : public IsPadded<MT>
2337 {};
2339 //*************************************************************************************************
2340 
2341 
2342 
2343 
2344 //=================================================================================================
2345 //
2346 // ISRESIZABLE SPECIALIZATIONS
2347 //
2348 //=================================================================================================
2349 
2350 //*************************************************************************************************
2352 template< typename MT, bool SO, bool DF >
2353 struct IsResizable< UniUpperMatrix<MT,SO,DF> >
2354  : public IsResizable<MT>
2355 {};
2357 //*************************************************************************************************
2358 
2359 
2360 
2361 
2362 //=================================================================================================
2363 //
2364 // ISSHRINKABLE SPECIALIZATIONS
2365 //
2366 //=================================================================================================
2367 
2368 //*************************************************************************************************
2370 template< typename MT, bool SO, bool DF >
2371 struct IsShrinkable< UniUpperMatrix<MT,SO,DF> >
2372  : public IsShrinkable<MT>
2373 {};
2375 //*************************************************************************************************
2376 
2377 
2378 
2379 
2380 //=================================================================================================
2381 //
2382 // REMOVEADAPTOR SPECIALIZATIONS
2383 //
2384 //=================================================================================================
2385 
2386 //*************************************************************************************************
2388 template< typename MT, bool SO, bool DF >
2389 struct RemoveAdaptor< UniUpperMatrix<MT,SO,DF> >
2390 {
2391  using Type = MT;
2392 };
2394 //*************************************************************************************************
2395 
2396 
2397 
2398 
2399 //=================================================================================================
2400 //
2401 // ADDTRAIT SPECIALIZATIONS
2402 //
2403 //=================================================================================================
2404 
2405 //*************************************************************************************************
2407 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2408 struct AddTrait< UniUpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
2409 {
2411 };
2412 
2413 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2414 struct AddTrait< StaticMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
2415 {
2416  using Type = AddTrait_< StaticMatrix<T,M,N,SO1>, MT >;
2417 };
2418 
2419 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2420 struct AddTrait< UniUpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
2421 {
2423 };
2424 
2425 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2426 struct AddTrait< HybridMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
2427 {
2428  using Type = AddTrait_< HybridMatrix<T,M,N,SO1>, MT >;
2429 };
2430 
2431 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2432 struct AddTrait< UniUpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
2433 {
2434  using Type = AddTrait_< MT, DynamicMatrix<T,SO2> >;
2435 };
2436 
2437 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2438 struct AddTrait< DynamicMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
2439 {
2440  using Type = AddTrait_< DynamicMatrix<T,SO1>, MT >;
2441 };
2442 
2443 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
2444 struct AddTrait< UniUpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
2445 {
2447 };
2448 
2449 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
2450 struct AddTrait< CustomMatrix<T,AF,PF,SO1>, UniUpperMatrix<MT,SO2,DF> >
2451 {
2452  using Type = AddTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
2453 };
2454 
2455 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2456 struct AddTrait< UniUpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
2457 {
2459 };
2460 
2461 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2462 struct AddTrait< CompressedMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
2463 {
2464  using Type = AddTrait_< CompressedMatrix<T,SO1>, MT >;
2465 };
2466 
2467 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2468 struct AddTrait< UniUpperMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
2469 {
2471 };
2472 
2473 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2474 struct AddTrait< IdentityMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
2475 {
2476  using Type = UpperMatrix< AddTrait_< IdentityMatrix<T,SO1>, MT > >;
2477 };
2478 
2479 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
2480 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
2481 {
2482  using Type = AddTrait_<MT1,MT2>;
2483 };
2484 
2485 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
2486 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UniUpperMatrix<MT2,SO2,DF2> >
2487 {
2488  using Type = AddTrait_<MT1,MT2>;
2489 };
2490 
2491 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2492 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
2493 {
2494  using Type = AddTrait_<MT1,MT2>;
2495 };
2496 
2497 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2498 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2499 {
2500  using Type = AddTrait_<MT1,MT2>;
2501 };
2502 
2503 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2504 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
2505 {
2506  using Type = AddTrait_<MT1,MT2>;
2507 };
2508 
2509 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2510 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2511 {
2512  using Type = AddTrait_<MT1,MT2>;
2513 };
2514 
2515 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2516 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2517 {
2518  using Type = AddTrait_<MT1,MT2>;
2519 };
2520 
2521 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2522 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2523 {
2524  using Type = AddTrait_<MT1,MT2>;
2525 };
2526 
2527 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2528 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
2529 {
2530  using Type = AddTrait_<MT1,MT2>;
2531 };
2532 
2533 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2534 struct AddTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2535 {
2536  using Type = AddTrait_<MT1,MT2>;
2537 };
2538 
2539 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2540 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2541 {
2542  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
2543 };
2544 
2545 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2546 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2547 {
2548  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
2549 };
2550 
2551 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2552 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2553 {
2554  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
2555 };
2557 //*************************************************************************************************
2558 
2559 
2560 
2561 
2562 //=================================================================================================
2563 //
2564 // SUBTRAIT SPECIALIZATIONS
2565 //
2566 //=================================================================================================
2567 
2568 //*************************************************************************************************
2570 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2571 struct SubTrait< UniUpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
2572 {
2574 };
2575 
2576 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2577 struct SubTrait< StaticMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
2578 {
2579  using Type = SubTrait_< StaticMatrix<T,M,N,SO1>, MT >;
2580 };
2581 
2582 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2583 struct SubTrait< UniUpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
2584 {
2586 };
2587 
2588 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2589 struct SubTrait< HybridMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
2590 {
2591  using Type = SubTrait_< HybridMatrix<T,M,N,SO1>, MT >;
2592 };
2593 
2594 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2595 struct SubTrait< UniUpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
2596 {
2597  using Type = SubTrait_< MT, DynamicMatrix<T,SO2> >;
2598 };
2599 
2600 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2601 struct SubTrait< DynamicMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
2602 {
2603  using Type = SubTrait_< DynamicMatrix<T,SO1>, MT >;
2604 };
2605 
2606 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
2607 struct SubTrait< UniUpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
2608 {
2610 };
2611 
2612 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
2613 struct SubTrait< CustomMatrix<T,AF,PF,SO1>, UniUpperMatrix<MT,SO2,DF> >
2614 {
2615  using Type = SubTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
2616 };
2617 
2618 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2619 struct SubTrait< UniUpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
2620 {
2622 };
2623 
2624 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2625 struct SubTrait< CompressedMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
2626 {
2627  using Type = SubTrait_< CompressedMatrix<T,SO1>, MT >;
2628 };
2629 
2630 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2631 struct SubTrait< UniUpperMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
2632 {
2634 };
2635 
2636 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2637 struct SubTrait< IdentityMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
2638 {
2640 };
2641 
2642 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
2643 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
2644 {
2645  using Type = SubTrait_<MT1,MT2>;
2646 };
2647 
2648 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
2649 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UniUpperMatrix<MT2,SO2,DF2> >
2650 {
2651  using Type = SubTrait_<MT1,MT2>;
2652 };
2653 
2654 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2655 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
2656 {
2657  using Type = SubTrait_<MT1,MT2>;
2658 };
2659 
2660 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2661 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2662 {
2663  using Type = SubTrait_<MT1,MT2>;
2664 };
2665 
2666 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2667 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
2668 {
2669  using Type = SubTrait_<MT1,MT2>;
2670 };
2671 
2672 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2673 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2674 {
2675  using Type = SubTrait_<MT1,MT2>;
2676 };
2677 
2678 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2679 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2680 {
2681  using Type = SubTrait_<MT1,MT2>;
2682 };
2683 
2684 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2685 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2686 {
2687  using Type = SubTrait_<MT1,MT2>;
2688 };
2689 
2690 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2691 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
2692 {
2693  using Type = SubTrait_<MT1,MT2>;
2694 };
2695 
2696 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2697 struct SubTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2698 {
2699  using Type = SubTrait_<MT1,MT2>;
2700 };
2701 
2702 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2703 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2704 {
2705  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
2706 };
2707 
2708 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2709 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2710 {
2711  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
2712 };
2713 
2714 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2715 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2716 {
2717  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
2718 };
2720 //*************************************************************************************************
2721 
2722 
2723 
2724 
2725 //=================================================================================================
2726 //
2727 // SCHURTRAIT SPECIALIZATIONS
2728 //
2729 //=================================================================================================
2730 
2731 //*************************************************************************************************
2733 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2734 struct SchurTrait< UniUpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
2735 {
2737 };
2738 
2739 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2740 struct SchurTrait< StaticMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
2741 {
2743 };
2744 
2745 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2746 struct SchurTrait< UniUpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
2747 {
2749 };
2750 
2751 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2752 struct SchurTrait< HybridMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
2753 {
2755 };
2756 
2757 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2758 struct SchurTrait< UniUpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
2759 {
2761 };
2762 
2763 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2764 struct SchurTrait< DynamicMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
2765 {
2767 };
2768 
2769 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
2770 struct SchurTrait< UniUpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
2771 {
2773 };
2774 
2775 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
2776 struct SchurTrait< CustomMatrix<T,AF,PF,SO1>, UniUpperMatrix<MT,SO2,DF> >
2777 {
2779 };
2780 
2781 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2782 struct SchurTrait< UniUpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
2783 {
2785 };
2786 
2787 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2788 struct SchurTrait< CompressedMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
2789 {
2791 };
2792 
2793 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2794 struct SchurTrait< UniUpperMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
2795 {
2796  using Type = IdentityMatrix< MultTrait_< ElementType_<MT>, T >, SO2 >;
2797 };
2798 
2799 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2800 struct SchurTrait< IdentityMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
2801 {
2803 };
2804 
2805 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
2806 struct SchurTrait< UniUpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
2807 {
2808  using Type = UpperMatrix< SchurTrait_<MT1,MT2> >;
2809 };
2810 
2811 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
2812 struct SchurTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UniUpperMatrix<MT2,SO2,DF2> >
2813 {
2814  using Type = UpperMatrix< SchurTrait_<MT1,MT2> >;
2815 };
2816 
2817 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2818 struct SchurTrait< UniUpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
2819 {
2820  using Type = UpperMatrix< SchurTrait_<MT1,MT2> >;
2821 };
2822 
2823 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2824 struct SchurTrait< HermitianMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2825 {
2826  using Type = UpperMatrix< SchurTrait_<MT1,MT2> >;
2827 };
2828 
2829 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2830 struct SchurTrait< UniUpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
2831 {
2832  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
2833 };
2834 
2835 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2836 struct SchurTrait< LowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2837 {
2838  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
2839 };
2840 
2841 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2842 struct SchurTrait< UniUpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2843 {
2845 };
2846 
2847 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2848 struct SchurTrait< UniLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2849 {
2851 };
2852 
2853 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2854 struct SchurTrait< UniUpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
2855 {
2856  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
2857 };
2858 
2859 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2860 struct SchurTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2861 {
2862  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
2863 };
2864 
2865 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2866 struct SchurTrait< UniUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2867 {
2868  using Type = UpperMatrix< SchurTrait_<MT1,MT2> >;
2869 };
2870 
2871 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2872 struct SchurTrait< UpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2873 {
2874  using Type = UpperMatrix< SchurTrait_<MT1,MT2> >;
2875 };
2876 
2877 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2878 struct SchurTrait< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2879 {
2880  using Type = UniUpperMatrix< SchurTrait_<MT1,MT2> >;
2881 };
2883 //*************************************************************************************************
2884 
2885 
2886 
2887 
2888 //=================================================================================================
2889 //
2890 // MULTTRAIT SPECIALIZATIONS
2891 //
2892 //=================================================================================================
2893 
2894 //*************************************************************************************************
2896 template< typename MT, bool SO, bool DF, typename T >
2897 struct MultTrait< UniUpperMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
2898 {
2899  using Type = UpperMatrix< MultTrait_<MT,T> >;
2900 };
2901 
2902 template< typename T, typename MT, bool SO, bool DF >
2903 struct MultTrait< T, UniUpperMatrix<MT,SO,DF>, EnableIf_< IsNumeric<T> > >
2904 {
2905  using Type = UpperMatrix< MultTrait_<T,MT> >;
2906 };
2907 
2908 template< typename MT, bool SO, bool DF, typename T, size_t N >
2909 struct MultTrait< UniUpperMatrix<MT,SO,DF>, StaticVector<T,N,false> >
2910 {
2912 };
2913 
2914 template< typename T, size_t N, typename MT, bool SO, bool DF >
2915 struct MultTrait< StaticVector<T,N,true>, UniUpperMatrix<MT,SO,DF> >
2916 {
2917  using Type = MultTrait_< StaticVector<T,N,true>, MT >;
2918 };
2919 
2920 template< typename MT, bool SO, bool DF, typename T, size_t N >
2921 struct MultTrait< UniUpperMatrix<MT,SO,DF>, HybridVector<T,N,false> >
2922 {
2924 };
2925 
2926 template< typename T, size_t N, typename MT, bool SO, bool DF >
2927 struct MultTrait< HybridVector<T,N,true>, UniUpperMatrix<MT,SO,DF> >
2928 {
2929  using Type = MultTrait_< HybridVector<T,N,true>, MT >;
2930 };
2931 
2932 template< typename MT, bool SO, bool DF, typename T >
2933 struct MultTrait< UniUpperMatrix<MT,SO,DF>, DynamicVector<T,false> >
2934 {
2936 };
2937 
2938 template< typename T, typename MT, bool SO, bool DF >
2939 struct MultTrait< DynamicVector<T,true>, UniUpperMatrix<MT,SO,DF> >
2940 {
2941  using Type = MultTrait_< DynamicVector<T,true>, MT >;
2942 };
2943 
2944 template< typename MT, bool SO, bool DF, typename T, bool AF, bool PF >
2945 struct MultTrait< UniUpperMatrix<MT,SO,DF>, CustomVector<T,AF,PF,false> >
2946 {
2948 };
2949 
2950 template< typename T, bool AF, bool PF, typename MT, bool SO, bool DF >
2951 struct MultTrait< CustomVector<T,AF,PF,true>, UniUpperMatrix<MT,SO,DF> >
2952 {
2953  using Type = MultTrait_< CustomVector<T,AF,PF,true>, MT >;
2954 };
2955 
2956 template< typename MT, bool SO, bool DF, typename T >
2957 struct MultTrait< UniUpperMatrix<MT,SO,DF>, CompressedVector<T,false> >
2958 {
2960 };
2961 
2962 template< typename T, typename MT, bool SO, bool DF >
2963 struct MultTrait< CompressedVector<T,true>, UniUpperMatrix<MT,SO,DF> >
2964 {
2965  using Type = MultTrait_< CompressedVector<T,true>, MT >;
2966 };
2967 
2968 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2969 struct MultTrait< UniUpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
2970 {
2972 };
2973 
2974 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2975 struct MultTrait< StaticMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
2976 {
2977  using Type = MultTrait_< StaticMatrix<T,M,N,SO1>, MT >;
2978 };
2979 
2980 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2981 struct MultTrait< UniUpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
2982 {
2984 };
2985 
2986 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2987 struct MultTrait< HybridMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
2988 {
2989  using Type = MultTrait_< HybridMatrix<T,M,N,SO1>, MT >;
2990 };
2991 
2992 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2993 struct MultTrait< UniUpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
2994 {
2995  using Type = MultTrait_< MT, DynamicMatrix<T,SO2> >;
2996 };
2997 
2998 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2999 struct MultTrait< DynamicMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
3000 {
3001  using Type = MultTrait_< DynamicMatrix<T,SO1>, MT >;
3002 };
3003 
3004 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
3005 struct MultTrait< UniUpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
3006 {
3008 };
3009 
3010 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
3011 struct MultTrait< CustomMatrix<T,AF,PF,SO1>, UniUpperMatrix<MT,SO2,DF> >
3012 {
3013  using Type = MultTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
3014 };
3015 
3016 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
3017 struct MultTrait< UniUpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
3018 {
3020 };
3021 
3022 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
3023 struct MultTrait< CompressedMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
3024 {
3025  using Type = MultTrait_< CompressedMatrix<T,SO1>, MT >;
3026 };
3027 
3028 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
3029 struct MultTrait< UniUpperMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
3030 {
3032 };
3033 
3034 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
3035 struct MultTrait< IdentityMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
3036 {
3038 };
3039 
3040 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
3041 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
3042 {
3043  using Type = MultTrait_<MT1,MT2>;
3044 };
3045 
3046 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
3047 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UniUpperMatrix<MT2,SO2,DF2> >
3048 {
3049  using Type = MultTrait_<MT1,MT2>;
3050 };
3051 
3052 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3053 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
3054 {
3055  using Type = MultTrait_<MT1,MT2>;
3056 };
3057 
3058 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3059 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
3060 {
3061  using Type = MultTrait_<MT1,MT2>;
3062 };
3063 
3064 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3065 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
3066 {
3067  using Type = MultTrait_<MT1,MT2>;
3068 };
3069 
3070 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3071 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
3072 {
3073  using Type = MultTrait_<MT1,MT2>;
3074 };
3075 
3076 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3077 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
3078 {
3079  using Type = MultTrait_<MT1,MT2>;
3080 };
3081 
3082 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3083 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
3084 {
3085  using Type = MultTrait_<MT1,MT2>;
3086 };
3087 
3088 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3089 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
3090 {
3091  using Type = MultTrait_<MT1,MT2>;
3092 };
3093 
3094 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3095 struct MultTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
3096 {
3097  using Type = MultTrait_<MT1,MT2>;
3098 };
3099 
3100 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3101 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
3102 {
3103  using Type = UpperMatrix< MultTrait_<MT1,MT2> >;
3104 };
3105 
3106 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3107 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
3108 {
3109  using Type = UpperMatrix< MultTrait_<MT1,MT2> >;
3110 };
3111 
3112 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3113 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
3114 {
3115  using Type = UniUpperMatrix< MultTrait_<MT1,MT2> >;
3116 };
3118 //*************************************************************************************************
3119 
3120 
3121 
3122 
3123 //=================================================================================================
3124 //
3125 // DIVTRAIT SPECIALIZATIONS
3126 //
3127 //=================================================================================================
3128 
3129 //*************************************************************************************************
3131 template< typename MT, bool SO, bool DF, typename T >
3132 struct DivTrait< UniUpperMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
3133 {
3134  using Type = UpperMatrix< DivTrait_<MT,T> >;
3135 };
3137 //*************************************************************************************************
3138 
3139 
3140 
3141 
3142 //=================================================================================================
3143 //
3144 // UNARYMAPTRAIT SPECIALIZATIONS
3145 //
3146 //=================================================================================================
3147 
3148 //*************************************************************************************************
3150 template< typename MT, bool SO, bool DF >
3151 struct UnaryMapTrait< UniUpperMatrix<MT,SO,DF>, Abs >
3152 {
3154 };
3155 
3156 template< typename MT, bool SO, bool DF >
3157 struct UnaryMapTrait< UniUpperMatrix<MT,SO,DF>, Floor >
3158 {
3160 };
3161 
3162 template< typename MT, bool SO, bool DF >
3163 struct UnaryMapTrait< UniUpperMatrix<MT,SO,DF>, Ceil >
3164 {
3166 };
3167 
3168 template< typename MT, bool SO, bool DF >
3169 struct UnaryMapTrait< UniUpperMatrix<MT,SO,DF>, Trunc >
3170 {
3172 };
3173 
3174 template< typename MT, bool SO, bool DF >
3175 struct UnaryMapTrait< UniUpperMatrix<MT,SO,DF>, Round >
3176 {
3178 };
3179 
3180 template< typename MT, bool SO, bool DF >
3181 struct UnaryMapTrait< UniUpperMatrix<MT,SO,DF>, Conj >
3182 {
3184 };
3185 
3186 template< typename MT, bool SO, bool DF >
3187 struct UnaryMapTrait< UniUpperMatrix<MT,SO,DF>, Real >
3188 {
3190 };
3191 
3192 template< typename MT, bool SO, bool DF >
3193 struct UnaryMapTrait< UniUpperMatrix<MT,SO,DF>, Sqrt >
3194 {
3196 };
3197 
3198 template< typename MT, bool SO, bool DF >
3199 struct UnaryMapTrait< UniUpperMatrix<MT,SO,DF>, Cbrt >
3200 {
3202 };
3203 
3204 template< typename MT, bool SO, bool DF, typename ET >
3205 struct UnaryMapTrait< UniUpperMatrix<MT,SO,DF>, UnaryPow<ET> >
3206 {
3208 };
3210 //*************************************************************************************************
3211 
3212 
3213 
3214 
3215 //=================================================================================================
3216 //
3217 // BINARYMAPTRAIT SPECIALIZATIONS
3218 //
3219 //=================================================================================================
3220 
3221 //*************************************************************************************************
3223 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3224 struct BinaryMapTrait< UniUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2>, Min >
3225 {
3227 };
3228 
3229 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3230 struct BinaryMapTrait< UniUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2>, Max >
3231 {
3233 };
3234 
3235 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3236 struct BinaryMapTrait< UpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2>, Min >
3237 {
3239 };
3240 
3241 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3242 struct BinaryMapTrait< UpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2>, Max >
3243 {
3245 };
3246 
3247 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3248 struct BinaryMapTrait< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2>, Min >
3249 {
3251 };
3252 
3253 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3254 struct BinaryMapTrait< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2>, Max >
3255 {
3257 };
3259 //*************************************************************************************************
3260 
3261 
3262 
3263 
3264 //=================================================================================================
3265 //
3266 // DECLSYMTRAIT SPECIALIZATIONS
3267 //
3268 //=================================================================================================
3269 
3270 //*************************************************************************************************
3272 template< typename MT, bool SO, bool DF >
3273 struct DeclSymTrait< UniUpperMatrix<MT,SO,DF> >
3274 {
3275  using Type = IdentityMatrix< ElementType_<MT>, SO >;
3276 };
3278 //*************************************************************************************************
3279 
3280 
3281 
3282 
3283 //=================================================================================================
3284 //
3285 // DECLHERMTRAIT SPECIALIZATIONS
3286 //
3287 //=================================================================================================
3288 
3289 //*************************************************************************************************
3291 template< typename MT, bool SO, bool DF >
3292 struct DeclHermTrait< UniUpperMatrix<MT,SO,DF> >
3293 {
3294  using Type = IdentityMatrix< ElementType_<MT>, SO >;
3295 };
3297 //*************************************************************************************************
3298 
3299 
3300 
3301 
3302 //=================================================================================================
3303 //
3304 // DECLLOWTRAIT SPECIALIZATIONS
3305 //
3306 //=================================================================================================
3307 
3308 //*************************************************************************************************
3310 template< typename MT, bool SO, bool DF >
3311 struct DeclLowTrait< UniUpperMatrix<MT,SO,DF> >
3312 {
3313  using Type = IdentityMatrix< ElementType_<MT>, SO >;
3314 };
3316 //*************************************************************************************************
3317 
3318 
3319 
3320 
3321 //=================================================================================================
3322 //
3323 // DECLUPPTRAIT SPECIALIZATIONS
3324 //
3325 //=================================================================================================
3326 
3327 //*************************************************************************************************
3329 template< typename MT, bool SO, bool DF >
3330 struct DeclUppTrait< UniUpperMatrix<MT,SO,DF> >
3331 {
3332  using Type = UniUpperMatrix<MT,SO,DF>;
3333 };
3335 //*************************************************************************************************
3336 
3337 
3338 
3339 
3340 //=================================================================================================
3341 //
3342 // DECLDIAGTRAIT SPECIALIZATIONS
3343 //
3344 //=================================================================================================
3345 
3346 //*************************************************************************************************
3348 template< typename MT, bool SO, bool DF >
3349 struct DeclDiagTrait< UniUpperMatrix<MT,SO,DF> >
3350 {
3351  using Type = IdentityMatrix< ElementType_<MT>, SO >;
3352 };
3354 //*************************************************************************************************
3355 
3356 
3357 
3358 
3359 //=================================================================================================
3360 //
3361 // HIGHTYPE SPECIALIZATIONS
3362 //
3363 //=================================================================================================
3364 
3365 //*************************************************************************************************
3367 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3368 struct HighType< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
3369 {
3371 };
3373 //*************************************************************************************************
3374 
3375 
3376 
3377 
3378 //=================================================================================================
3379 //
3380 // LOWTYPE SPECIALIZATIONS
3381 //
3382 //=================================================================================================
3383 
3384 //*************************************************************************************************
3386 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3387 struct LowType< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
3388 {
3390 };
3392 //*************************************************************************************************
3393 
3394 
3395 
3396 
3397 //=================================================================================================
3398 //
3399 // SUBMATRIXTRAIT SPECIALIZATIONS
3400 //
3401 //=================================================================================================
3402 
3403 //*************************************************************************************************
3405 template< typename MT, bool SO, bool DF, size_t... CSAs >
3406 struct SubmatrixTrait< UniUpperMatrix<MT,SO,DF>, CSAs... >
3407 {
3408  using Type = SubmatrixTrait_<MT,CSAs...>;
3409 };
3411 //*************************************************************************************************
3412 
3413 
3414 
3415 
3416 //=================================================================================================
3417 //
3418 // ROWTRAIT SPECIALIZATIONS
3419 //
3420 //=================================================================================================
3421 
3422 //*************************************************************************************************
3424 template< typename MT, bool SO, bool DF, size_t... CRAs >
3425 struct RowTrait< UniUpperMatrix<MT,SO,DF>, CRAs... >
3426 {
3427  using Type = RowTrait_<MT,CRAs...>;
3428 };
3430 //*************************************************************************************************
3431 
3432 
3433 
3434 
3435 //=================================================================================================
3436 //
3437 // ROWSTRAIT SPECIALIZATIONS
3438 //
3439 //=================================================================================================
3440 
3441 //*************************************************************************************************
3443 template< typename MT, bool SO, bool DF, size_t... CRAs >
3444 struct RowsTrait< UniUpperMatrix<MT,SO,DF>, CRAs... >
3445 {
3446  using Type = RowsTrait_<MT,CRAs...>;
3447 };
3449 //*************************************************************************************************
3450 
3451 
3452 
3453 
3454 //=================================================================================================
3455 //
3456 // COLUMNTRAIT SPECIALIZATIONS
3457 //
3458 //=================================================================================================
3459 
3460 //*************************************************************************************************
3462 template< typename MT, bool SO, bool DF, size_t... CCAs >
3463 struct ColumnTrait< UniUpperMatrix<MT,SO,DF>, CCAs... >
3464 {
3465  using Type = ColumnTrait_<MT,CCAs...>;
3466 };
3468 //*************************************************************************************************
3469 
3470 
3471 
3472 
3473 //=================================================================================================
3474 //
3475 // COLUMNSTRAIT SPECIALIZATIONS
3476 //
3477 //=================================================================================================
3478 
3479 //*************************************************************************************************
3481 template< typename MT, bool SO, bool DF, size_t... CCAs >
3482 struct ColumnsTrait< UniUpperMatrix<MT,SO,DF>, CCAs... >
3483 {
3484  using Type = ColumnsTrait_<MT,CCAs...>;
3485 };
3487 //*************************************************************************************************
3488 
3489 
3490 
3491 
3492 //=================================================================================================
3493 //
3494 // BANDTRAIT SPECIALIZATIONS
3495 //
3496 //=================================================================================================
3497 
3498 //*************************************************************************************************
3500 template< typename MT, bool SO, bool DF, ptrdiff_t... CBAs >
3501 struct BandTrait< UniUpperMatrix<MT,SO,DF>, CBAs... >
3502 {
3503  using Type = BandTrait_<MT,CBAs...>;
3504 };
3506 //*************************************************************************************************
3507 
3508 } // namespace blaze
3509 
3510 #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 IsUniUpper type trait.
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
UniUpperMatrix specialization for sparse 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
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
BLAZE_ALWAYS_INLINE size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:560
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
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
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
Efficient implementation of an identity matrix.The IdentityMatrix class template is the representati...
Definition: Forward.h:49
Header file for the LowType type trait.
Flag for the inversion of a lower triangular matrix.
Definition: InversionFlag.h:111
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
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Flag for the LU-based matrix inversion.
Definition: InversionFlag.h:103
Matrix adapter for strictly upper triangular matrices.
Definition: BaseTemplate.h:558
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
#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
Header file for the isOne shim.
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.
Matrix adapter for upper unitriangular matrices.
Definition: BaseTemplate.h:576
#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.
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:690
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
UniUpperMatrix specialization for dense matrices.
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
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
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 implementation of the base template of the UniUpperMatrix.
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