Blaze  3.6
StrictlyUpperMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_STRICTLYUPPERMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_STRICTLYUPPERMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
47 #include <blaze/math/Forward.h>
91 #include <blaze/util/Assert.h>
92 #include <blaze/util/EnableIf.h>
94 #include <blaze/util/MaybeUnused.h>
96 
97 
98 namespace blaze {
99 
100 //=================================================================================================
101 //
102 // STRICTLYUPPERMATRIX OPERATORS
103 //
104 //=================================================================================================
105 
106 //*************************************************************************************************
109 template< typename MT, bool SO, bool DF >
110 void reset( StrictlyUpperMatrix<MT,SO,DF>& m );
111 
112 template< typename MT, bool SO, bool DF >
113 void reset( StrictlyUpperMatrix<MT,SO,DF>& m, size_t i );
114 
115 template< typename MT, bool SO, bool DF >
116 void clear( StrictlyUpperMatrix<MT,SO,DF>& m );
117 
118 template< bool RF, typename MT, bool SO, bool DF >
119 bool isDefault( const StrictlyUpperMatrix<MT,SO,DF>& m );
120 
121 template< typename MT, bool SO, bool DF >
122 bool isIntact( const StrictlyUpperMatrix<MT,SO,DF>& m );
123 
124 template< typename MT, bool SO, bool DF >
125 void swap( StrictlyUpperMatrix<MT,SO,DF>& a, StrictlyUpperMatrix<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( StrictlyUpperMatrix<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 //*************************************************************************************************
198 template< bool RF // Relaxation flag
199  , typename MT // Type of the adapted matrix
200  , bool SO // Storage order of the adapted matrix
201  , bool DF > // Density flag
202 inline bool isDefault_backend( const StrictlyUpperMatrix<MT,SO,DF>& m, TrueType )
203 {
204  return ( m.rows() == 0UL );
205 }
207 //*************************************************************************************************
208 
209 
210 //*************************************************************************************************
221 template< bool RF // Relaxation flag
222  , typename MT // Type of the adapted matrix
223  , bool SO // Storage order of the adapted matrix
224  , bool DF > // Density flag
225 inline bool isDefault_backend( const StrictlyUpperMatrix<MT,SO,DF>& m, FalseType )
226 {
227  if( SO ) {
228  for( size_t j=1UL; j<m.columns(); ++j ) {
229  for( size_t i=0UL; i<j; ++i ) {
230  if( !isDefault<RF>( m(i,j) ) )
231  return false;
232  }
233  }
234  }
235  else {
236  for( size_t i=0UL; i<m.rows(); ++i ) {
237  for( size_t j=i+1UL; j<m.columns(); ++j ) {
238  if( !isDefault<RF>( m(i,j) ) )
239  return false;
240  }
241  }
242  }
243 
244  return true;
245 }
247 //*************************************************************************************************
248 
249 
250 //*************************************************************************************************
277 template< bool RF // Relaxation flag
278  , typename MT // Type of the adapted matrix
279  , bool SO // Storage order of the adapted matrix
280  , bool DF > // Density flag
282 {
283  return isDefault_backend<RF>( m, typename IsResizable<MT>::Type() );
284 }
285 //*************************************************************************************************
286 
287 
288 //*************************************************************************************************
309 template< typename MT // Type of the adapted matrix
310  , bool SO // Storage order of the adapted matrix
311  , bool DF > // Density flag
313 {
314  return m.isIntact();
315 }
316 //*************************************************************************************************
317 
318 
319 //*************************************************************************************************
327 template< typename MT // Type of the adapted matrix
328  , bool SO // Storage order of the adapted matrix
329  , bool DF > // Density flag
331 {
332  a.swap( b );
333 }
334 //*************************************************************************************************
335 
336 
337 //*************************************************************************************************
353 template< typename MT // Type of the adapted matrix
354  , bool SO // Storage order of the adapted matrix
355  , bool DF // Density flag
356  , typename ET > // Type of the element
357 inline bool trySet( const StrictlyUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
358 {
359  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
360  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
361 
362  MAYBE_UNUSED( mat );
363 
364  return ( i < j || isDefault( value ) );
365 }
367 //*************************************************************************************************
368 
369 
370 //*************************************************************************************************
388 template< typename MT // Type of the adapted matrix
389  , bool SO // Storage order of the adapted matrix
390  , bool DF // Density flag
391  , typename ET > // Type of the element
393  trySet( const StrictlyUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
394 {
395  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
396  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
397  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
398  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
399 
400  MAYBE_UNUSED( mat );
401 
402  return ( m == 0UL ) ||
403  ( n == 0UL ) ||
404  ( column >= row + m ) ||
405  isDefault( value );
406 }
408 //*************************************************************************************************
409 
410 
411 //*************************************************************************************************
427 template< typename MT // Type of the adapted matrix
428  , bool SO // Storage order of the adapted matrix
429  , bool DF // Density flag
430  , typename ET > // Type of the element
431 inline bool tryAdd( const StrictlyUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
432 {
433  return trySet( mat, i, j, value );
434 }
436 //*************************************************************************************************
437 
438 
439 //*************************************************************************************************
457 template< typename MT // Type of the adapted matrix
458  , bool SO // Storage order of the adapted matrix
459  , bool DF // Density flag
460  , typename ET > // Type of the element
462  tryAdd( const StrictlyUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
463 {
464  return trySet( mat, row, column, m, n, value );
465 }
467 //*************************************************************************************************
468 
469 
470 //*************************************************************************************************
487 template< typename MT // Type of the adapted matrix
488  , bool SO // Storage order of the adapted matrix
489  , bool DF // Density flag
490  , typename ET > // Type of the element
491 inline bool trySub( const StrictlyUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
492 {
493  return trySet( mat, i, j, value );
494 }
496 //*************************************************************************************************
497 
498 
499 //*************************************************************************************************
518 template< typename MT // Type of the adapted matrix
519  , bool SO // Storage order of the adapted matrix
520  , bool DF // Density flag
521  , typename ET > // Type of the element
523  trySub( const StrictlyUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
524 {
525  return trySet( mat, row, column, m, n, value );
526 }
528 //*************************************************************************************************
529 
530 
531 //*************************************************************************************************
547 template< typename MT // Type of the adapted matrix
548  , bool SO // Storage order of the adapted matrix
549  , bool DF // Density flag
550  , typename ET > // Type of the element
551 inline bool tryBitor( const StrictlyUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
552 {
553  return trySet( mat, i, j, value );
554 }
556 //*************************************************************************************************
557 
558 
559 //*************************************************************************************************
578 template< typename MT // Type of the adapted matrix
579  , bool SO // Storage order of the adapted matrix
580  , bool DF // Density flag
581  , typename ET > // Type of the element
583  tryBitor( const StrictlyUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
584 {
585  return trySet( mat, row, column, m, n, value );
586 }
588 //*************************************************************************************************
589 
590 
591 //*************************************************************************************************
607 template< typename MT // Type of the adapted matrix
608  , bool SO // Storage order of the adapted matrix
609  , bool DF // Density flag
610  , typename ET > // Type of the element
611 inline bool tryBitxor( const StrictlyUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
612 {
613  return tryAdd( mat, i, j, value );
614 }
616 //*************************************************************************************************
617 
618 
619 //*************************************************************************************************
638 template< typename MT // Type of the adapted matrix
639  , bool SO // Storage order of the adapted matrix
640  , bool DF // Density flag
641  , typename ET > // Type of the element
643  tryBitxor( const StrictlyUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
644 {
645  return tryAdd( mat, row, column, m, n, value );
646 }
648 //*************************************************************************************************
649 
650 
651 //*************************************************************************************************
668 template< typename MT // Type of the adapted matrix
669  , bool SO // Storage order of the adapted matrix
670  , bool DF // Density flag
671  , typename VT > // Type of the right-hand side dense vector
672 inline bool tryAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
673  const DenseVector<VT,false>& rhs, size_t row, size_t column )
674 {
676 
677  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
678  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
679  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
680 
681  MAYBE_UNUSED( lhs );
682 
683  const size_t ibegin( ( column <= row )?( 0UL ):( column - row ) );
684 
685  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
686  if( !isDefault( (~rhs)[i] ) )
687  return false;
688  }
689 
690  return true;
691 }
693 //*************************************************************************************************
694 
695 
696 //*************************************************************************************************
713 template< typename MT // Type of the adapted matrix
714  , bool SO // Storage order of the adapted matrix
715  , bool DF // Density flag
716  , typename VT > // Type of the right-hand side dense vector
717 inline bool tryAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
718  const DenseVector<VT,true>& rhs, size_t row, size_t column )
719 {
721 
722  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
723  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
724  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
725 
726  MAYBE_UNUSED( lhs );
727 
728  if( row < column )
729  return true;
730 
731  const size_t iend( min( row - column + 1UL, (~rhs).size() ) );
732 
733  for( size_t i=0UL; i<iend; ++i ) {
734  if( !isDefault( (~rhs)[i] ) )
735  return false;
736  }
737 
738  return true;
739 }
741 //*************************************************************************************************
742 
743 
744 //*************************************************************************************************
762 template< typename MT // Type of the adapted matrix
763  , bool SO // Storage order of the adapted matrix
764  , bool DF // Density flag
765  , typename VT // Type of the right-hand side dense vector
766  , bool TF > // Transpose flag of the right-hand side dense vector
767 inline bool tryAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
768  ptrdiff_t band, size_t row, size_t column )
769 {
771 
772  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
773  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
774  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
775  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
776 
777  MAYBE_UNUSED( lhs, row, column );
778 
779  if( band <= 0L ) {
780  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
781  if( !isDefault( (~rhs)[i] ) )
782  return false;
783  }
784  }
785 
786  return true;
787 }
789 //*************************************************************************************************
790 
791 
792 //*************************************************************************************************
809 template< typename MT // Type of the adapted matrix
810  , bool SO // Storage order of the adapted matrix
811  , bool DF // Density flag
812  , typename VT > // Type of the right-hand side sparse vector
813 inline bool tryAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
814  const SparseVector<VT,false>& rhs, size_t row, size_t column )
815 {
817 
818  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
819  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
820  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
821 
822  MAYBE_UNUSED( lhs );
823 
824  const auto last( (~rhs).end() );
825  auto element( (~rhs).lowerBound( ( column <= row )?( 0UL ):( column - row ) ) );
826 
827  for( ; element!=last; ++element ) {
828  if( !isDefault( element->value() ) )
829  return false;
830  }
831 
832  return true;
833 }
835 //*************************************************************************************************
836 
837 
838 //*************************************************************************************************
855 template< typename MT // Type of the adapted matrix
856  , bool SO // Storage order of the adapted matrix
857  , bool DF // Density flag
858  , typename VT > // Type of the right-hand side sparse vector
859 inline bool tryAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
860  const SparseVector<VT,true>& rhs, size_t row, size_t column )
861 {
863 
864  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
865  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
866  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
867 
868  MAYBE_UNUSED( lhs );
869 
870  if( row < column )
871  return true;
872 
873  const auto last( (~rhs).lowerBound( row - column + 1UL ) );
874 
875  for( auto element=(~rhs).begin(); element!=last; ++element ) {
876  if( !isDefault( element->value() ) )
877  return false;
878  }
879 
880  return true;
881 }
883 //*************************************************************************************************
884 
885 
886 //*************************************************************************************************
904 template< typename MT // Type of the adapted matrix
905  , bool SO // Storage order of the adapted matrix
906  , bool DF // Density flag
907  , typename VT // Type of the right-hand side sparse vector
908  , bool TF > // Transpose flag of the right-hand side sparse vector
909 inline bool tryAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
910  ptrdiff_t band, size_t row, size_t column )
911 {
913 
914  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
915  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
916  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
917  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
918 
919  MAYBE_UNUSED( lhs, row, column );
920 
921  if( band <= 0L ) {
922  for( const auto& element : ~rhs ) {
923  if( !isDefault( element.value() ) )
924  return false;
925  }
926  }
927 
928  return true;
929 }
931 //*************************************************************************************************
932 
933 
934 //*************************************************************************************************
951 template< typename MT1 // Type of the adapted matrix
952  , bool SO // Storage order of the adapted matrix
953  , bool DF // Density flag
954  , typename MT2 > // Type of the right-hand side dense matrix
955 inline bool tryAssign( const StrictlyUpperMatrix<MT1,SO,DF>& lhs,
956  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
957 {
959 
960  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
961  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
962  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
963  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
964 
965  MAYBE_UNUSED( lhs );
966 
967  const size_t M( (~rhs).rows() );
968  const size_t N( (~rhs).columns() );
969 
970  if( column >= row + M )
971  return true;
972 
973  const size_t ibegin( ( column <= row )?( 0UL ):( column - row ) );
974 
975  for( size_t i=ibegin; i<M; ++i )
976  {
977  const size_t jend( min( row + i - column + 1UL, N ) );
978 
979  for( size_t j=0UL; j<jend; ++j ) {
980  if( !isDefault( (~rhs)(i,j) ) )
981  return false;
982  }
983  }
984 
985  return true;
986 }
988 //*************************************************************************************************
989 
990 
991 //*************************************************************************************************
1008 template< typename MT1 // Type of the adapted matrix
1009  , bool SO // Storage order of the adapted matrix
1010  , bool DF // Density flag
1011  , typename MT2 > // Type of the right-hand side dense matrix
1012 inline bool tryAssign( const StrictlyUpperMatrix<MT1,SO,DF>& lhs,
1013  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
1014 {
1016 
1017  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1018  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1019  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1020  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1021 
1022  MAYBE_UNUSED( lhs );
1023 
1024  const size_t M( (~rhs).rows() );
1025  const size_t N( (~rhs).columns() );
1026 
1027  if( column >= row + M )
1028  return true;
1029 
1030  const size_t jend( min( row + M - column, N ) );
1031 
1032  for( size_t j=0UL; j<jend; ++j )
1033  {
1034  const bool containsDiagonal( column + j >= row );
1035  const size_t ibegin( ( containsDiagonal )?( column + j - row ):( 0UL ) );
1036 
1037  for( size_t i=ibegin; i<M; ++i ) {
1038  if( !isDefault( (~rhs)(i,j) ) )
1039  return false;
1040  }
1041  }
1042 
1043  return true;
1044 }
1046 //*************************************************************************************************
1047 
1048 
1049 //*************************************************************************************************
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 sparse matrix
1070 inline bool tryAssign( const StrictlyUpperMatrix<MT1,SO,DF>& lhs,
1071  const SparseMatrix<MT2,false>& 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  MAYBE_UNUSED( 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 ibegin( ( column < row )?( 0UL ):( column - row ) );
1089 
1090  for( size_t i=ibegin; i<M; ++i )
1091  {
1092  const size_t index( row + i - column + 1UL );
1093  const auto last( (~rhs).lowerBound( i, min( index, N ) ) );
1094 
1095  for( auto element=(~rhs).begin(i); element!=last; ++element ) {
1096  if( !isDefault( element->value() ) )
1097  return false;
1098  }
1099  }
1100 
1101  return true;
1102 }
1104 //*************************************************************************************************
1105 
1106 
1107 //*************************************************************************************************
1124 template< typename MT1 // Type of the adapted matrix
1125  , bool SO // Storage order of the adapted matrix
1126  , bool DF // Density flag
1127  , typename MT2 > // Type of the right-hand side sparse matrix
1128 inline bool tryAssign( const StrictlyUpperMatrix<MT1,SO,DF>& lhs,
1129  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
1130 {
1132 
1133  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1134  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1135  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1136  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1137 
1138  MAYBE_UNUSED( lhs );
1139 
1140  const size_t M( (~rhs).rows() );
1141  const size_t N( (~rhs).columns() );
1142 
1143  if( column >= row + M )
1144  return true;
1145 
1146  const size_t jend( min( row + M - column, N ) );
1147 
1148  for( size_t j=0UL; j<jend; ++j )
1149  {
1150  const bool containsDiagonal( column + j >= row );
1151  const size_t index( ( containsDiagonal )?( column + j - row ):( 0UL ) );
1152 
1153  const auto last( (~rhs).end(j) );
1154  auto element( (~rhs).lowerBound( index, j ) );
1155 
1156  for( ; element!=last; ++element ) {
1157  if( !isDefault( element->value() ) )
1158  return false;
1159  }
1160  }
1161 
1162  return true;
1163 }
1165 //*************************************************************************************************
1166 
1167 
1168 //*************************************************************************************************
1185 template< typename MT // Type of the adapted matrix
1186  , bool SO // Storage order of the adapted matrix
1187  , bool DF // Density flag
1188  , typename VT // Type of the right-hand side vector
1189  , bool TF > // Transpose flag of the right-hand side vector
1190 inline bool tryAddAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
1191  const Vector<VT,TF>& rhs, size_t row, size_t column )
1192 {
1193  return tryAssign( lhs, ~rhs, row, column );
1194 }
1196 //*************************************************************************************************
1197 
1198 
1199 //*************************************************************************************************
1217 template< typename MT // Type of the adapted matrix
1218  , bool SO // Storage order of the adapted matrix
1219  , bool DF // Density flag
1220  , typename VT // Type of the right-hand side vector
1221  , bool TF > // Transpose flag of the right-hand side vector
1222 inline bool tryAddAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
1223  ptrdiff_t band, size_t row, size_t column )
1224 {
1225  return tryAssign( lhs, ~rhs, band, row, column );
1226 }
1228 //*************************************************************************************************
1229 
1230 
1231 //*************************************************************************************************
1248 template< typename MT1 // Type of the adapted matrix
1249  , bool SO1 // Storage order of the adapted matrix
1250  , bool DF // Density flag
1251  , typename MT2 // Type of the right-hand side matrix
1252  , bool SO2 > // Storage order of the right-hand side matrix
1253 inline bool tryAddAssign( const StrictlyUpperMatrix<MT1,SO1,DF>& lhs,
1254  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1255 {
1256  return tryAssign( lhs, ~rhs, row, column );
1257 }
1259 //*************************************************************************************************
1260 
1261 
1262 //*************************************************************************************************
1279 template< typename MT // Type of the adapted matrix
1280  , bool SO // Storage order of the adapted matrix
1281  , bool DF // Density flag
1282  , typename VT // Type of the right-hand side vector
1283  , bool TF > // Transpose flag of the right-hand side vector
1284 inline bool trySubAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
1285  const Vector<VT,TF>& rhs, size_t row, size_t column )
1286 {
1287  return tryAssign( lhs, ~rhs, row, column );
1288 }
1290 //*************************************************************************************************
1291 
1292 
1293 //*************************************************************************************************
1311 template< typename MT // Type of the adapted matrix
1312  , bool SO // Storage order of the adapted matrix
1313  , bool DF // Density flag
1314  , typename VT // Type of the right-hand side vector
1315  , bool TF > // Transpose flag of the right-hand side vector
1316 inline bool trySubAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
1317  ptrdiff_t band, size_t row, size_t column )
1318 {
1319  return tryAssign( lhs, ~rhs, band, row, column );
1320 }
1322 //*************************************************************************************************
1323 
1324 
1325 //*************************************************************************************************
1342 template< typename MT1 // Type of the adapted matrix
1343  , bool SO1 // Storage order of the adapted matrix
1344  , bool DF // Density flag
1345  , typename MT2 // Type of the right-hand side matrix
1346  , bool SO2 > // Storage order of the right-hand side matrix
1347 inline bool trySubAssign( const StrictlyUpperMatrix<MT1,SO1,DF>& lhs,
1348  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1349 {
1350  return tryAssign( lhs, ~rhs, row, column );
1351 }
1353 //*************************************************************************************************
1354 
1355 
1356 //*************************************************************************************************
1373 template< typename MT // Type of the adapted matrix
1374  , bool SO // Storage order of the adapted matrix
1375  , bool DF // Density flag
1376  , typename VT // Type of the right-hand side vector
1377  , bool TF > // Transpose flag of the right-hand side vector
1378 inline bool tryBitorAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
1379  const Vector<VT,TF>& rhs, size_t row, size_t column )
1380 {
1381  return tryAssign( lhs, ~rhs, row, column );
1382 }
1384 //*************************************************************************************************
1385 
1386 
1387 //*************************************************************************************************
1404 template< typename MT // Type of the adapted matrix
1405  , bool SO // Storage order of the adapted matrix
1406  , bool DF // Density flag
1407  , typename VT // Type of the right-hand side vector
1408  , bool TF > // Transpose flag of the right-hand side vector
1409 inline bool tryBitorAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
1410  ptrdiff_t band, size_t row, size_t column )
1411 {
1412  return tryAssign( lhs, ~rhs, band, row, column );
1413 }
1415 //*************************************************************************************************
1416 
1417 
1418 //*************************************************************************************************
1435 template< typename MT1 // Type of the adapted matrix
1436  , bool SO1 // Storage order of the adapted matrix
1437  , bool DF // Density flag
1438  , typename MT2 // Type of the right-hand side matrix
1439  , bool SO2 > // Storage order of the right-hand side matrix
1440 inline bool tryBitorAssign( const StrictlyUpperMatrix<MT1,SO1,DF>& lhs,
1441  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1442 {
1443  return tryAssign( lhs, ~rhs, row, column );
1444 }
1446 //*************************************************************************************************
1447 
1448 
1449 //*************************************************************************************************
1466 template< typename MT // Type of the adapted matrix
1467  , bool SO // Storage order of the adapted matrix
1468  , bool DF // Density flag
1469  , typename VT // Type of the right-hand side vector
1470  , bool TF > // Transpose flag of the right-hand side vector
1471 inline bool tryBitxorAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
1472  const Vector<VT,TF>& rhs, size_t row, size_t column )
1473 {
1474  return tryAssign( lhs, ~rhs, row, column );
1475 }
1477 //*************************************************************************************************
1478 
1479 
1480 //*************************************************************************************************
1497 template< typename MT // Type of the adapted matrix
1498  , bool SO // Storage order of the adapted matrix
1499  , bool DF // Density flag
1500  , typename VT // Type of the right-hand side vector
1501  , bool TF > // Transpose flag of the right-hand side vector
1502 inline bool tryBitxorAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
1503  ptrdiff_t band, size_t row, size_t column )
1504 {
1505  return tryAssign( lhs, ~rhs, band, row, column );
1506 }
1508 //*************************************************************************************************
1509 
1510 
1511 //*************************************************************************************************
1528 template< typename MT1 // Type of the adapted matrix
1529  , bool SO1 // Storage order of the adapted matrix
1530  , bool DF // Density flag
1531  , typename MT2 // Type of the right-hand side matrix
1532  , bool SO2 > // Storage order of the right-hand side matrix
1533 inline bool tryBitxorAssign( const StrictlyUpperMatrix<MT1,SO1,DF>& lhs,
1534  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1535 {
1536  return tryAssign( lhs, ~rhs, row, column );
1537 }
1539 //*************************************************************************************************
1540 
1541 
1542 //*************************************************************************************************
1556 template< typename MT // Type of the adapted matrix
1557  , bool SO // Storage order of the adapted matrix
1558  , bool DF > // Density flag
1559 inline MT& derestrict( StrictlyUpperMatrix<MT,SO,DF>& m )
1560 {
1561  return m.matrix_;
1562 }
1564 //*************************************************************************************************
1565 
1566 
1567 
1568 
1569 //=================================================================================================
1570 //
1571 // SIZE SPECIALIZATIONS
1572 //
1573 //=================================================================================================
1574 
1575 //*************************************************************************************************
1577 template< typename MT, bool SO, bool DF >
1578 struct Size< StrictlyUpperMatrix<MT,SO,DF>, 0UL >
1579  : public Size<MT,0UL>
1580 {};
1581 
1582 template< typename MT, bool SO, bool DF >
1583 struct Size< StrictlyUpperMatrix<MT,SO,DF>, 1UL >
1584  : public Size<MT,1UL>
1585 {};
1587 //*************************************************************************************************
1588 
1589 
1590 
1591 
1592 //=================================================================================================
1593 //
1594 // MAXSIZE SPECIALIZATIONS
1595 //
1596 //=================================================================================================
1597 
1598 //*************************************************************************************************
1600 template< typename MT, bool SO, bool DF >
1601 struct MaxSize< StrictlyUpperMatrix<MT,SO,DF>, 0UL >
1602  : public MaxSize<MT,0UL>
1603 {};
1604 
1605 template< typename MT, bool SO, bool DF >
1606 struct MaxSize< StrictlyUpperMatrix<MT,SO,DF>, 1UL >
1607  : public MaxSize<MT,1UL>
1608 {};
1610 //*************************************************************************************************
1611 
1612 
1613 
1614 
1615 //=================================================================================================
1616 //
1617 // ISSQUARE SPECIALIZATIONS
1618 //
1619 //=================================================================================================
1620 
1621 //*************************************************************************************************
1623 template< typename MT, bool SO, bool DF >
1624 struct IsSquare< StrictlyUpperMatrix<MT,SO,DF> >
1625  : public TrueType
1626 {};
1628 //*************************************************************************************************
1629 
1630 
1631 
1632 
1633 //=================================================================================================
1634 //
1635 // ISUNIFORM SPECIALIZATIONS
1636 //
1637 //=================================================================================================
1638 
1639 //*************************************************************************************************
1641 template< typename MT, bool SO, bool DF >
1642 struct IsUniform< StrictlyUpperMatrix<MT,SO,DF> >
1643  : public IsUniform<MT>
1644 {};
1646 //*************************************************************************************************
1647 
1648 
1649 
1650 
1651 //=================================================================================================
1652 //
1653 // ISSYMMETRIC SPECIALIZATIONS
1654 //
1655 //=================================================================================================
1656 
1657 //*************************************************************************************************
1659 template< typename MT, bool SO, bool DF >
1660 struct IsSymmetric< StrictlyUpperMatrix<MT,SO,DF> >
1661  : public IsUniform<MT>
1662 {};
1664 //*************************************************************************************************
1665 
1666 
1667 
1668 
1669 //=================================================================================================
1670 //
1671 // ISHERMITIAN SPECIALIZATIONS
1672 //
1673 //=================================================================================================
1674 
1675 //*************************************************************************************************
1677 template< typename MT, bool SO, bool DF >
1678 struct IsHermitian< StrictlyUpperMatrix<MT,SO,DF> >
1679  : public IsUniform<MT>
1680 {};
1682 //*************************************************************************************************
1683 
1684 
1685 
1686 
1687 //=================================================================================================
1688 //
1689 // ISSTRICTLYLOWER SPECIALIZATIONS
1690 //
1691 //=================================================================================================
1692 
1693 //*************************************************************************************************
1695 template< typename MT, bool SO, bool DF >
1696 struct IsStrictlyLower< StrictlyUpperMatrix<MT,SO,DF> >
1697  : public IsUniform<MT>
1698 {};
1700 //*************************************************************************************************
1701 
1702 
1703 
1704 
1705 //=================================================================================================
1706 //
1707 // ISSTRICTLYUPPER SPECIALIZATIONS
1708 //
1709 //=================================================================================================
1710 
1711 //*************************************************************************************************
1713 template< typename MT, bool SO, bool DF >
1714 struct IsStrictlyUpper< StrictlyUpperMatrix<MT,SO,DF> >
1715  : public TrueType
1716 {};
1718 //*************************************************************************************************
1719 
1720 
1721 
1722 
1723 //=================================================================================================
1724 //
1725 // ISADAPTOR SPECIALIZATIONS
1726 //
1727 //=================================================================================================
1728 
1729 //*************************************************************************************************
1731 template< typename MT, bool SO, bool DF >
1732 struct IsAdaptor< StrictlyUpperMatrix<MT,SO,DF> >
1733  : public TrueType
1734 {};
1736 //*************************************************************************************************
1737 
1738 
1739 
1740 
1741 //=================================================================================================
1742 //
1743 // ISRESTRICTED SPECIALIZATIONS
1744 //
1745 //=================================================================================================
1746 
1747 //*************************************************************************************************
1749 template< typename MT, bool SO, bool DF >
1750 struct IsRestricted< StrictlyUpperMatrix<MT,SO,DF> >
1751  : public TrueType
1752 {};
1754 //*************************************************************************************************
1755 
1756 
1757 
1758 
1759 //=================================================================================================
1760 //
1761 // HASCONSTDATAACCESS SPECIALIZATIONS
1762 //
1763 //=================================================================================================
1764 
1765 //*************************************************************************************************
1767 template< typename MT, bool SO >
1768 struct HasConstDataAccess< StrictlyUpperMatrix<MT,SO,true> >
1769  : public TrueType
1770 {};
1772 //*************************************************************************************************
1773 
1774 
1775 
1776 
1777 //=================================================================================================
1778 //
1779 // ISALIGNED SPECIALIZATIONS
1780 //
1781 //=================================================================================================
1782 
1783 //*************************************************************************************************
1785 template< typename MT, bool SO, bool DF >
1786 struct IsAligned< StrictlyUpperMatrix<MT,SO,DF> >
1787  : public IsAligned<MT>
1788 {};
1790 //*************************************************************************************************
1791 
1792 
1793 
1794 
1795 //=================================================================================================
1796 //
1797 // ISCONTIGUOUS SPECIALIZATIONS
1798 //
1799 //=================================================================================================
1800 
1801 //*************************************************************************************************
1803 template< typename MT, bool SO, bool DF >
1804 struct IsContiguous< StrictlyUpperMatrix<MT,SO,DF> >
1805  : public IsContiguous<MT>
1806 {};
1808 //*************************************************************************************************
1809 
1810 
1811 
1812 
1813 //=================================================================================================
1814 //
1815 // ISPADDED SPECIALIZATIONS
1816 //
1817 //=================================================================================================
1818 
1819 //*************************************************************************************************
1821 template< typename MT, bool SO, bool DF >
1822 struct IsPadded< StrictlyUpperMatrix<MT,SO,DF> >
1823  : public IsPadded<MT>
1824 {};
1826 //*************************************************************************************************
1827 
1828 
1829 
1830 
1831 //=================================================================================================
1832 //
1833 // ISRESIZABLE SPECIALIZATIONS
1834 //
1835 //=================================================================================================
1836 
1837 //*************************************************************************************************
1839 template< typename MT, bool SO, bool DF >
1840 struct IsResizable< StrictlyUpperMatrix<MT,SO,DF> >
1841  : public IsResizable<MT>
1842 {};
1844 //*************************************************************************************************
1845 
1846 
1847 
1848 
1849 //=================================================================================================
1850 //
1851 // ISSHRINKABLE SPECIALIZATIONS
1852 //
1853 //=================================================================================================
1854 
1855 //*************************************************************************************************
1857 template< typename MT, bool SO, bool DF >
1858 struct IsShrinkable< StrictlyUpperMatrix<MT,SO,DF> >
1859  : public IsShrinkable<MT>
1860 {};
1862 //*************************************************************************************************
1863 
1864 
1865 
1866 
1867 //=================================================================================================
1868 //
1869 // REMOVEADAPTOR SPECIALIZATIONS
1870 //
1871 //=================================================================================================
1872 
1873 //*************************************************************************************************
1875 template< typename MT, bool SO, bool DF >
1876 struct RemoveAdaptor< StrictlyUpperMatrix<MT,SO,DF> >
1877 {
1878  using Type = MT;
1879 };
1881 //*************************************************************************************************
1882 
1883 
1884 
1885 
1886 //=================================================================================================
1887 //
1888 // ADDTRAIT SPECIALIZATIONS
1889 //
1890 //=================================================================================================
1891 
1892 //*************************************************************************************************
1894 template< typename T1, typename T2 >
1895 struct AddTraitEval1< T1, T2
1896  , EnableIf_t< IsMatrix_v<T1> &&
1897  IsMatrix_v<T2> &&
1898  ( IsStrictlyUpper_v<T1> && IsStrictlyUpper_v<T2> ) &&
1899  !( IsZero_v<T1> || IsZero_v<T2> ) > >
1900 {
1901  using Type = StrictlyUpperMatrix< typename AddTraitEval2<T1,T2>::Type >;
1902 };
1904 //*************************************************************************************************
1905 
1906 
1907 
1908 
1909 //=================================================================================================
1910 //
1911 // SUBTRAIT SPECIALIZATIONS
1912 //
1913 //=================================================================================================
1914 
1915 //*************************************************************************************************
1917 template< typename T1, typename T2 >
1918 struct SubTraitEval1< T1, T2
1919  , EnableIf_t< IsMatrix_v<T1> &&
1920  IsMatrix_v<T2> &&
1921  ( ( IsUniUpper_v<T1> && IsUniUpper_v<T2> ) ||
1922  ( IsStrictlyUpper_v<T1> && IsStrictlyUpper_v<T2> ) ) &&
1923  !( IsIdentity_v<T1> && IsIdentity_v<T2> ) &&
1924  !( IsZero_v<T1> || IsZero_v<T2> ) > >
1925 {
1926  using Type = StrictlyUpperMatrix< typename SubTraitEval2<T1,T2>::Type >;
1927 };
1929 //*************************************************************************************************
1930 
1931 
1932 
1933 
1934 //=================================================================================================
1935 //
1936 // SCHURTRAIT SPECIALIZATIONS
1937 //
1938 //=================================================================================================
1939 
1940 //*************************************************************************************************
1942 template< typename T1, typename T2 >
1943 struct SchurTraitEval1< T1, T2
1944  , EnableIf_t< IsMatrix_v<T1> &&
1945  IsMatrix_v<T2> &&
1946  ( ( IsStrictlyUpper_v<T1> && !IsLower_v<T2> ) ||
1947  ( !IsLower_v<T1> && IsStrictlyUpper_v<T2> ) ) &&
1948  !( IsZero_v<T1> || IsZero_v<T2> ) > >
1949 {
1950  using Type = StrictlyUpperMatrix< typename SchurTraitEval2<T1,T2>::Type >;
1951 };
1953 //*************************************************************************************************
1954 
1955 
1956 
1957 
1958 //=================================================================================================
1959 //
1960 // MULTTRAIT SPECIALIZATIONS
1961 //
1962 //=================================================================================================
1963 
1964 //*************************************************************************************************
1966 template< typename T1, typename T2 >
1967 struct MultTraitEval1< T1, T2
1968  , EnableIf_t< IsMatrix_v<T1> &&
1969  IsNumeric_v<T2> &&
1970  ( IsStrictlyUpper_v<T1> && !IsUniform_v<T1> ) > >
1971 {
1972  using Type = StrictlyUpperMatrix< typename MultTraitEval2<T1,T2>::Type >;
1973 };
1974 
1975 template< typename T1, typename T2 >
1976 struct MultTraitEval1< T1, T2
1977  , EnableIf_t< IsNumeric_v<T1> &&
1978  IsMatrix_v<T2> &&
1979  ( IsStrictlyUpper_v<T2> && !IsUniform_v<T2> ) > >
1980 {
1981  using Type = StrictlyUpperMatrix< typename MultTraitEval2<T1,T2>::Type >;
1982 };
1983 
1984 template< typename T1, typename T2 >
1985 struct MultTraitEval1< T1, T2
1986  , EnableIf_t< IsMatrix_v<T1> &&
1987  IsMatrix_v<T2> &&
1988  ( ( IsStrictlyUpper_v<T1> && IsUpper_v<T2> ) ||
1989  ( IsUpper_v<T1> && IsStrictlyUpper_v<T2> ) ) &&
1990  !( IsIdentity_v<T1> || IsIdentity_v<T2> ) &&
1991  !( IsZero_v<T1> || IsZero_v<T2> ) > >
1992 {
1993  using Type = StrictlyUpperMatrix< typename MultTraitEval2<T1,T2>::Type >;
1994 };
1996 //*************************************************************************************************
1997 
1998 
1999 
2000 
2001 //=================================================================================================
2002 //
2003 // KRONTRAIT SPECIALIZATIONS
2004 //
2005 //=================================================================================================
2006 
2007 //*************************************************************************************************
2009 template< typename T1, typename T2 >
2010 struct KronTraitEval1< T1, T2
2011  , EnableIf_t< IsMatrix_v<T1> &&
2012  IsMatrix_v<T2> &&
2013  ( ( IsStrictlyUpper_v<T1> ) ||
2014  ( IsUpper_v<T1> && IsStrictlyUpper_v<T2> ) ) &&
2015  !( IsZero_v<T1> || IsZero_v<T2> ) > >
2016 {
2017  using Type = StrictlyUpperMatrix< typename KronTraitEval2<T1,T2>::Type >;
2018 };
2020 //*************************************************************************************************
2021 
2022 
2023 
2024 
2025 //=================================================================================================
2026 //
2027 // DIVTRAIT SPECIALIZATIONS
2028 //
2029 //=================================================================================================
2030 
2031 //*************************************************************************************************
2033 template< typename T1, typename T2 >
2034 struct DivTraitEval1< T1, T2
2035  , EnableIf_t< IsStrictlyUpper_v<T1> && IsNumeric_v<T2> > >
2036 {
2037  using Type = StrictlyUpperMatrix< typename DivTraitEval2<T1,T2>::Type >;
2038 };
2040 //*************************************************************************************************
2041 
2042 
2043 
2044 
2045 //=================================================================================================
2046 //
2047 // MAPTRAIT SPECIALIZATIONS
2048 //
2049 //=================================================================================================
2050 
2051 //*************************************************************************************************
2053 template< typename T, typename OP >
2054 struct UnaryMapTraitEval1< T, OP
2055  , EnableIf_t< YieldsStrictlyUpper_v<OP,T> &&
2056  !YieldsDiagonal_v<OP,T> > >
2057 {
2058  using Type = StrictlyUpperMatrix< typename UnaryMapTraitEval2<T,OP>::Type, StorageOrder_v<T> >;
2059 };
2061 //*************************************************************************************************
2062 
2063 
2064 //*************************************************************************************************
2066 template< typename T1, typename T2, typename OP >
2067 struct BinaryMapTraitEval1< T1, T2, OP
2068  , EnableIf_t< YieldsStrictlyUpper_v<OP,T1,T2> &&
2069  !YieldsDiagonal_v<OP,T1,T2> > >
2070 {
2071  using Type = StrictlyUpperMatrix< typename BinaryMapTraitEval2<T1,T2,OP>::Type >;
2072 };
2074 //*************************************************************************************************
2075 
2076 
2077 
2078 
2079 //=================================================================================================
2080 //
2081 // DECLSYMTRAIT SPECIALIZATIONS
2082 //
2083 //=================================================================================================
2084 
2085 //*************************************************************************************************
2087 template< typename MT, bool SO, bool DF >
2088 struct DeclSymTrait< StrictlyUpperMatrix<MT,SO,DF> >
2089 {
2090  using Type = ZeroMatrix< typename MT::ElementType, SO >;
2091 };
2093 //*************************************************************************************************
2094 
2095 
2096 
2097 
2098 //=================================================================================================
2099 //
2100 // DECLHERMTRAIT SPECIALIZATIONS
2101 //
2102 //=================================================================================================
2103 
2104 //*************************************************************************************************
2106 template< typename MT, bool SO, bool DF >
2107 struct DeclHermTrait< StrictlyUpperMatrix<MT,SO,DF> >
2108 {
2109  using Type = ZeroMatrix< typename MT::ElementType, SO >;
2110 };
2112 //*************************************************************************************************
2113 
2114 
2115 
2116 
2117 //=================================================================================================
2118 //
2119 // DECLLOWTRAIT SPECIALIZATIONS
2120 //
2121 //=================================================================================================
2122 
2123 //*************************************************************************************************
2125 template< typename MT, bool SO, bool DF >
2126 struct DeclLowTrait< StrictlyUpperMatrix<MT,SO,DF> >
2127 {
2128  using Type = ZeroMatrix< typename MT::ElementType, SO >;
2129 };
2131 //*************************************************************************************************
2132 
2133 
2134 
2135 
2136 //=================================================================================================
2137 //
2138 // DECLUPPTRAIT SPECIALIZATIONS
2139 //
2140 //=================================================================================================
2141 
2142 //*************************************************************************************************
2144 template< typename MT, bool SO, bool DF >
2145 struct DeclUppTrait< StrictlyUpperMatrix<MT,SO,DF> >
2146 {
2147  using Type = StrictlyUpperMatrix<MT>;
2148 };
2150 //*************************************************************************************************
2151 
2152 
2153 
2154 
2155 //=================================================================================================
2156 //
2157 // DECLDIAGTRAIT SPECIALIZATIONS
2158 //
2159 //=================================================================================================
2160 
2161 //*************************************************************************************************
2163 template< typename MT, bool SO, bool DF >
2164 struct DeclDiagTrait< StrictlyUpperMatrix<MT,SO,DF> >
2165 {
2166  using Type = ZeroMatrix< typename MT::ElementType, SO >;
2167 };
2169 //*************************************************************************************************
2170 
2171 
2172 
2173 
2174 //=================================================================================================
2175 //
2176 // HIGHTYPE SPECIALIZATIONS
2177 //
2178 //=================================================================================================
2179 
2180 //*************************************************************************************************
2182 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2183 struct HighType< StrictlyUpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
2184 {
2185  using Type = StrictlyUpperMatrix< typename HighType<MT1,MT2>::Type >;
2186 };
2188 //*************************************************************************************************
2189 
2190 
2191 
2192 
2193 //=================================================================================================
2194 //
2195 // LOWTYPE SPECIALIZATIONS
2196 //
2197 //=================================================================================================
2198 
2199 //*************************************************************************************************
2201 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2202 struct LowType< StrictlyUpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
2203 {
2204  using Type = StrictlyUpperMatrix< typename LowType<MT1,MT2>::Type >;
2205 };
2207 //*************************************************************************************************
2208 
2209 
2210 
2211 
2212 //=================================================================================================
2213 //
2214 // SUBMATRIXTRAIT SPECIALIZATIONS
2215 //
2216 //=================================================================================================
2217 
2218 //*************************************************************************************************
2220 template< typename MT, size_t I, size_t N >
2221 struct SubmatrixTraitEval1< MT, I, I, N, N
2222  , EnableIf_t< IsStrictlyUpper_v<MT> > >
2223 {
2224  using Type = StrictlyUpperMatrix< typename SubmatrixTraitEval2<MT,I,I,N,N>::Type >;
2225 };
2227 //*************************************************************************************************
2228 
2229 } // namespace blaze
2230 
2231 #endif
BoolConstant< false > FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: IntegralConstant.h:121
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
Headerfile for the generic min algorithm.
Header file for the decldiag trait.
Header file for the Schur product trait.
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.The IsMatrix_v variable template provides a c...
Definition: IsMatrix.h:138
Header file for the IsUniUpper type trait.
Header file for the subtraction trait.
Header file for the declherm trait.
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
StrictlyUpperMatrix specialization for dense matrices.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
Header file for the MAYBE_UNUSED function template.
Header file for the IsIdentity type trait.
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: IntegralConstant.h:132
Header file for all forward declarations of the math module.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
Header file for the IsMatrix type trait.
Header file for the IsSquare type trait.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Header file for the LowType type trait.
Header file for the IsUniform type trait.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
constexpr bool IsStrictlyUpper_v
Auxiliary variable template for the IsStrictlyUpper type trait.The IsStrictlyUpper_v variable templat...
Definition: IsStrictlyUpper.h:173
Matrix adapter for strictly upper triangular matrices.
Definition: BaseTemplate.h:558
Header file for the IsShrinkable type trait.
Header file for the YieldsStrictlyUpper type trait.
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1162
Header file for the decllow trait.
constexpr bool IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.The IsNumeric_v variable template provides a...
Definition: IsNumeric.h:143
Header file for the IsLower type trait.
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Header file for the IsAligned type trait.
Header file for the Kron product trait.
StrictlyUpperMatrix specialization for sparse matrices.
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:438
Header file for the RemoveAdaptor type trait.
Constraint on the data type.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:615
Header file for the IsPadded type trait.
Header file for the IsAdaptor type trait.
Header file for the implementation of the base template of the StrictlyUpperMatrix.
decltype(auto) band(Matrix< MT, SO > &matrix, RBAs... args)
Creating a view on a specific band of the given matrix.
Definition: Band.h:137
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:74
Header file for the declupp trait.
Header file for run time assertion macros.
Header file for the addition trait.
Header file for the division trait.
Header file for the submatrix trait.
Header file for the IsContiguous type trait.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
Header file for the IsZero type trait.
Header file for the declsym trait.
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:282
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
constexpr bool YieldsStrictlyUpper_v
Auxiliary variable template for the YieldsStrictlyUpper type trait.The YieldsStrictlyUpper_v variable...
Definition: YieldsStrictlyUpper.h:124
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
Header file for the YieldsDiagonal type trait.
Header file for the StorageOrder type trait.
Header file for the IntegralConstant class template.
Header file for the map trait.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:635
Header file for the IsUpper type trait.
Header file for the IsHermitian type trait.
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
Header file for the Size type trait.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
Definition: Assert.h:101
Header file for the HighType type trait.