Blaze  3.6
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>
95 #include <blaze/util/Assert.h>
96 #include <blaze/util/EnableIf.h>
98 #include <blaze/util/MaybeUnused.h>
100 
101 
102 namespace blaze {
103 
104 //=================================================================================================
105 //
106 // UNIUPPERMATRIX OPERATORS
107 //
108 //=================================================================================================
109 
110 //*************************************************************************************************
113 template< typename MT, bool SO, bool DF >
114 void reset( UniUpperMatrix<MT,SO,DF>& m );
115 
116 template< typename MT, bool SO, bool DF >
117 void reset( UniUpperMatrix<MT,SO,DF>& m, size_t i );
118 
119 template< typename MT, bool SO, bool DF >
120 void clear( UniUpperMatrix<MT,SO,DF>& m );
121 
122 template< bool RF, typename MT, bool SO, bool DF >
123 bool isDefault( const UniUpperMatrix<MT,SO,DF>& m );
124 
125 template< typename MT, bool SO, bool DF >
126 bool isIntact( const UniUpperMatrix<MT,SO,DF>& m );
127 
128 template< typename MT, bool SO, bool DF >
129 void swap( UniUpperMatrix<MT,SO,DF>& a, UniUpperMatrix<MT,SO,DF>& b ) noexcept;
131 //*************************************************************************************************
132 
133 
134 //*************************************************************************************************
141 template< typename MT // Type of the adapted matrix
142  , bool SO // Storage order of the adapted matrix
143  , bool DF > // Density flag
145 {
146  m.reset();
147 }
148 //*************************************************************************************************
149 
150 
151 //*************************************************************************************************
164 template< typename MT // Type of the adapted matrix
165  , bool SO // Storage order of the adapted matrix
166  , bool DF > // Density flag
167 inline void reset( UniUpperMatrix<MT,SO,DF>& m, size_t i )
168 {
169  m.reset( i );
170 }
171 //*************************************************************************************************
172 
173 
174 //*************************************************************************************************
181 template< typename MT // Type of the adapted matrix
182  , bool SO // Storage order of the adapted matrix
183  , bool DF > // Density flag
185 {
186  m.clear();
187 }
188 //*************************************************************************************************
189 
190 
191 //*************************************************************************************************
201 template< bool RF // Relaxation flag
202  , typename MT // Type of the adapted matrix
203  , bool SO // Storage order of the adapted matrix
204  , bool DF > // Density flag
205 inline bool isDefault_backend( const UniUpperMatrix<MT,SO,DF>& m, TrueType )
206 {
207  return ( m.rows() == 0UL );
208 }
210 //*************************************************************************************************
211 
212 
213 //*************************************************************************************************
223 template< bool RF // Relaxation flag
224  , typename MT // Type of the adapted matrix
225  , bool SO // Storage order of the adapted matrix
226  , bool DF > // Density flag
227 inline bool isDefault_backend( const UniUpperMatrix<MT,SO,DF>& m, FalseType )
228 {
229  return isIdentity<RF>( m );
230 }
232 //*************************************************************************************************
233 
234 
235 //*************************************************************************************************
262 template< bool RF // Relaxation flag
263  , typename MT // Type of the adapted matrix
264  , bool SO // Storage order of the adapted matrix
265  , bool DF > // Density flag
266 inline bool isDefault( const UniUpperMatrix<MT,SO,DF>& m )
267 {
268  return isDefault_backend<RF>( m, typename IsResizable<MT>::Type() );
269 }
270 //*************************************************************************************************
271 
272 
273 //*************************************************************************************************
294 template< typename MT // Type of the adapted matrix
295  , bool SO // Storage order of the adapted matrix
296  , bool DF > // Density flag
297 inline bool isIntact( const UniUpperMatrix<MT,SO,DF>& m )
298 {
299  return m.isIntact();
300 }
301 //*************************************************************************************************
302 
303 
304 //*************************************************************************************************
312 template< typename MT // Type of the adapted matrix
313  , bool SO // Storage order of the adapted matrix
314  , bool DF > // Density flag
316 {
317  a.swap( b );
318 }
319 //*************************************************************************************************
320 
321 
322 //*************************************************************************************************
345 template< InversionFlag IF // Inversion algorithm
346  , typename MT // Type of the dense matrix
347  , bool SO > // Storage order of the dense matrix
348 inline void invert( UniUpperMatrix<MT,SO,true>& m )
349 {
351 
352  if( IF == asLower || IF == asUniLower ) {
353  BLAZE_INTERNAL_ASSERT( isIdentity( m ), "Violation of preconditions detected" );
354  return;
355  }
356 
357  constexpr InversionFlag flag( ( IF == byLU || IF == asGeneral || IF == asUpper || IF == asUniUpper)
358  ? ( asUniUpper )
359  : ( asDiagonal ) );
360 
361  invert<flag>( derestrict( m ) );
362 
363  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
364 }
366 //*************************************************************************************************
367 
368 
369 //*************************************************************************************************
388 template< typename MT1, bool SO1, typename MT2, typename MT3, typename MT4, bool SO2 >
389 inline void lu( const UniUpperMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
390  DenseMatrix<MT3,SO1>& U, Matrix<MT4,SO2>& P )
391 {
392  BLAZE_CONSTRAINT_MUST_BE_BLAS_COMPATIBLE_TYPE( ElementType_t<MT1> );
393 
398 
403 
404  using ET2 = ElementType_t<MT2>;
405  using ET4 = ElementType_t<MT4>;
406 
407  const size_t n( (~A).rows() );
408 
409  decltype(auto) L2( derestrict( ~L ) );
410 
411  (~U) = A;
412 
413  resize( ~L, n, n );
414  reset( L2 );
415 
416  resize( ~P, n, n );
417  reset( ~P );
418 
419  for( size_t i=0UL; i<n; ++i ) {
420  L2(i,i) = ET2(1);
421  (~P)(i,i) = ET4(1);
422  }
423 }
425 //*************************************************************************************************
426 
427 
428 //*************************************************************************************************
444 template< typename MT // Type of the adapted matrix
445  , bool SO // Storage order of the adapted matrix
446  , bool DF // Density flag
447  , typename ET > // Type of the element
448 inline bool trySet( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
449 {
450  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
451  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
452 
453  MAYBE_UNUSED( mat );
454 
455  return ( i < j ) ||
456  ( i == j && isOne( value ) ) ||
457  isDefault( value );
458 }
460 //*************************************************************************************************
461 
462 
463 //*************************************************************************************************
481 template< typename MT // Type of the adapted matrix
482  , bool SO // Storage order of the adapted matrix
483  , bool DF // Density flag
484  , typename ET > // Type of the element
486  trySet( const UniUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
487 {
488  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
489  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
490  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
491  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
492 
493  MAYBE_UNUSED( mat );
494 
495  return ( m == 0UL ) ||
496  ( n == 0UL ) ||
497  ( column >= row + m ) ||
498  ( ( row >= column + n ) && isDefault( value ) ) ||
499  ( row == column && m == 1UL && n == 1UL && isOne( value ) );
500 }
502 //*************************************************************************************************
503 
504 
505 //*************************************************************************************************
521 template< typename MT // Type of the adapted matrix
522  , bool SO // Storage order of the adapted matrix
523  , bool DF // Density flag
524  , typename ET > // Type of the element
525 inline bool tryAdd( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
526 {
527  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
528  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
529 
530  MAYBE_UNUSED( mat );
531 
532  return ( i < j ) || isDefault( value );
533 }
535 //*************************************************************************************************
536 
537 
538 //*************************************************************************************************
556 template< typename MT // Type of the adapted matrix
557  , bool SO // Storage order of the adapted matrix
558  , bool DF // Density flag
559  , typename ET > // Type of the element
561  tryAdd( const UniUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
562 {
563  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
564  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
565  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
566  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
567 
568  MAYBE_UNUSED( mat );
569 
570  return ( m == 0UL ) ||
571  ( n == 0UL ) ||
572  ( column >= row + m ) ||
573  isDefault( value );
574 }
576 //*************************************************************************************************
577 
578 
579 //*************************************************************************************************
595 template< typename MT // Type of the adapted matrix
596  , bool SO // Storage order of the adapted matrix
597  , bool DF // Density flag
598  , typename ET > // Type of the element
599 inline bool trySub( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
600 {
601  return tryAdd( mat, i, j, value );
602 }
604 //*************************************************************************************************
605 
606 
607 //*************************************************************************************************
625 template< typename MT // Type of the adapted matrix
626  , bool SO // Storage order of the adapted matrix
627  , bool DF // Density flag
628  , typename ET > // Type of the element
630  trySub( const UniUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
631 {
632  return tryAdd( mat, row, column, m, n, value );
633 }
635 //*************************************************************************************************
636 
637 
638 //*************************************************************************************************
654 template< typename MT // Type of the adapted matrix
655  , bool SO // Storage order of the adapted matrix
656  , bool DF // Density flag
657  , typename ET > // Type of the element
658 inline bool tryMult( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
659 {
660  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
661  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
662 
663  MAYBE_UNUSED( mat );
664 
665  return ( i != j || isOne( value ) );
666 }
668 //*************************************************************************************************
669 
670 
671 //*************************************************************************************************
689 template< typename MT // Type of the adapted matrix
690  , bool SO // Storage order of the adapted matrix
691  , bool DF // Density flag
692  , typename ET > // Type of the element
694  tryMult( const UniUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
695 {
696  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
697  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
698  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
699  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
700 
701  MAYBE_UNUSED( mat );
702 
703  return ( m == 0UL ) ||
704  ( n == 0UL ) ||
705  ( column >= row + m ) ||
706  ( row >= column + n ) ||
707  isOne( value );
708 }
710 //*************************************************************************************************
711 
712 
713 //*************************************************************************************************
729 template< typename MT // Type of the adapted matrix
730  , bool SO // Storage order of the adapted matrix
731  , bool DF // Density flag
732  , typename ET > // Type of the element
733 inline bool tryDiv( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
734 {
735  return tryMult( mat, i, j, value );
736 }
738 //*************************************************************************************************
739 
740 
741 //*************************************************************************************************
759 template< typename MT // Type of the adapted matrix
760  , bool SO // Storage order of the adapted matrix
761  , bool DF // Density flag
762  , typename ET > // Type of the element
764  tryDiv( const UniUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
765 {
766  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
767  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
768  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
769  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
770 
771  MAYBE_UNUSED( mat );
772 
773  return ( column >= row + m ) || ( row >= column + n ) || isOne( value );
774 }
776 //*************************************************************************************************
777 
778 
779 //*************************************************************************************************
795 template< typename MT // Type of the adapted matrix
796  , bool SO // Storage order of the adapted matrix
797  , bool DF > // Density flag
798 inline bool tryShift( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, int count )
799 {
800  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
801  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
802 
803  MAYBE_UNUSED( mat );
804 
805  return ( i != j || isDefault( count ) );
806 }
808 //*************************************************************************************************
809 
810 
811 //*************************************************************************************************
829 template< typename MT // Type of the adapted matrix
830  , bool SO // Storage order of the adapted matrix
831  , bool DF > // Density flag
833  tryShift( const UniUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, int count )
834 {
835  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
836  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
837  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
838  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
839 
840  MAYBE_UNUSED( mat );
841 
842  return ( m == 0UL ) ||
843  ( n == 0UL ) ||
844  ( column >= row + m ) ||
845  ( row >= column + n ) ||
846  isDefault( count );
847 }
849 //*************************************************************************************************
850 
851 
852 //*************************************************************************************************
868 template< typename MT // Type of the adapted matrix
869  , bool SO // Storage order of the adapted matrix
870  , bool DF // Density flag
871  , typename ET > // Type of the element
872 inline bool tryBitand( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
873 {
874  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
875  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
876 
877  MAYBE_UNUSED( mat );
878 
879  return ( i != j ) || ( ElementType_t<MT>(1) & value );
880 }
882 //*************************************************************************************************
883 
884 
885 //*************************************************************************************************
903 template< typename MT // Type of the adapted matrix
904  , bool SO // Storage order of the adapted matrix
905  , bool DF // Density flag
906  , typename ET > // Type of the element
908  tryBitand( const UniUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
909 {
910  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
911  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
912  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
913  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
914 
915  MAYBE_UNUSED( mat );
916 
917  return ( m == 0UL ) ||
918  ( n == 0UL ) ||
919  ( column >= row + m ) ||
920  ( row >= column + n ) ||
921  ( ElementType_t<MT>(1) & value );
922 }
924 //*************************************************************************************************
925 
926 
927 //*************************************************************************************************
943 template< typename MT // Type of the adapted matrix
944  , bool SO // Storage order of the adapted matrix
945  , bool DF // Density flag
946  , typename ET > // Type of the element
947 inline bool tryBitor( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
948 {
949  return trySet( mat, i, j, value );
950 }
952 //*************************************************************************************************
953 
954 
955 //*************************************************************************************************
973 template< typename MT // Type of the adapted matrix
974  , bool SO // Storage order of the adapted matrix
975  , bool DF // Density flag
976  , typename ET > // Type of the element
978  tryBitor( const UniUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
979 {
980  return trySet( mat, row, column, m, n, value );
981 }
983 //*************************************************************************************************
984 
985 
986 //*************************************************************************************************
1002 template< typename MT // Type of the adapted matrix
1003  , bool SO // Storage order of the adapted matrix
1004  , bool DF // Density flag
1005  , typename ET > // Type of the element
1006 inline bool tryBitxor( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
1007 {
1008  return tryAdd( mat, i, j, value );
1009 }
1011 //*************************************************************************************************
1012 
1013 
1014 //*************************************************************************************************
1032 template< typename MT // Type of the adapted matrix
1033  , bool SO // Storage order of the adapted matrix
1034  , bool DF // Density flag
1035  , typename ET > // Type of the element
1037  tryBitxor( const UniUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
1038 {
1039  return tryAdd( mat, row, column, m, n, value );
1040 }
1042 //*************************************************************************************************
1043 
1044 
1045 //*************************************************************************************************
1061 template< typename MT // Type of the adapted matrix
1062  , bool SO // Storage order of the adapted matrix
1063  , bool DF // Density flag
1064  , typename VT > // Type of the right-hand side dense vector
1065 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1066  const DenseVector<VT,false>& rhs, size_t row, size_t column )
1067 {
1069 
1070  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1071  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1072  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1073 
1074  MAYBE_UNUSED( lhs );
1075 
1076  if( column >= row + (~rhs).size() )
1077  return true;
1078 
1079  const bool containsDiagonal( column >= row );
1080  const size_t ibegin( ( !containsDiagonal )?( 0UL ):( column - row + 1UL ) );
1081 
1082  if( containsDiagonal && !isOne( (~rhs)[column-row] ) )
1083  return false;
1084 
1085  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
1086  if( !isDefault( (~rhs)[i] ) )
1087  return false;
1088  }
1089 
1090  return true;
1091 }
1093 //*************************************************************************************************
1094 
1095 
1096 //*************************************************************************************************
1112 template< typename MT // Type of the adapted matrix
1113  , bool SO // Storage order of the adapted matrix
1114  , bool DF // Density flag
1115  , typename VT > // Type of the right-hand side dense vector
1116 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1117  const DenseVector<VT,true>& rhs, size_t row, size_t column )
1118 {
1120 
1121  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1122  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1123  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1124 
1125  MAYBE_UNUSED( lhs );
1126 
1127  if( row < column )
1128  return true;
1129 
1130  const bool containsDiagonal( row < column + (~rhs).size() );
1131  const size_t iend( min( row - column, (~rhs).size() ) );
1132 
1133  for( size_t i=0UL; i<iend; ++i ) {
1134  if( !isDefault( (~rhs)[i] ) )
1135  return false;
1136  }
1137 
1138  if( containsDiagonal && !isOne( (~rhs)[iend] ) )
1139  return false;
1140 
1141  return true;
1142 }
1144 //*************************************************************************************************
1145 
1146 
1147 //*************************************************************************************************
1165 template< typename MT // Type of the adapted matrix
1166  , bool SO // Storage order of the adapted matrix
1167  , bool DF // Density flag
1168  , typename VT // Type of the right-hand side dense vector
1169  , bool TF > // Transpose flag of the right-hand side dense vector
1170 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
1171  ptrdiff_t band, size_t row, size_t column )
1172 {
1174 
1175  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1176  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1177  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1178  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1179 
1180  MAYBE_UNUSED( lhs, row, column );
1181 
1182  if( band == 0L ) {
1183  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
1184  if( !isOne( (~rhs)[i] ) )
1185  return false;
1186  }
1187  }
1188  else if( band < 0L ) {
1189  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
1190  if( !isDefault( (~rhs)[i] ) )
1191  return false;
1192  }
1193  }
1194 
1195  return true;
1196 }
1198 //*************************************************************************************************
1199 
1200 
1201 //*************************************************************************************************
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 sparse vector
1221 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1222  const SparseVector<VT,false>& rhs, size_t row, size_t column )
1223 {
1225 
1226  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1227  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1228  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1229 
1230  MAYBE_UNUSED( lhs );
1231 
1232  if( column >= row + (~rhs).size() )
1233  return true;
1234 
1235  const bool containsDiagonal( column >= row );
1236  const size_t index( ( containsDiagonal )?( column - row ):( 0UL ) );
1237  const auto last( (~rhs).end() );
1238  auto element( (~rhs).lowerBound( index ) );
1239 
1240  if( containsDiagonal ) {
1241  if( element == last || element->index() != index || !isOne( element->value() ) )
1242  return false;
1243  ++element;
1244  }
1245 
1246  for( ; element!=last; ++element ) {
1247  if( !isDefault( element->value() ) )
1248  return false;
1249  }
1250 
1251  return true;
1252 }
1254 //*************************************************************************************************
1255 
1256 
1257 //*************************************************************************************************
1273 template< typename MT // Type of the adapted matrix
1274  , bool SO // Storage order of the adapted matrix
1275  , bool DF // Density flag
1276  , typename VT > // Type of the right-hand side sparse vector
1277 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1278  const SparseVector<VT,true>& rhs, size_t row, size_t column )
1279 {
1281 
1282  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1283  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1284  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1285 
1286  MAYBE_UNUSED( lhs );
1287 
1288  if( row < column )
1289  return true;
1290 
1291  const bool containsDiagonal( row < column + (~rhs).size() );
1292  const size_t index( row - column );
1293  const auto last( (~rhs).lowerBound( index ) );
1294 
1295  if( containsDiagonal ) {
1296  if( last == (~rhs).end() || last->index() != index || !isOne( last->value() ) )
1297  return false;
1298  }
1299 
1300  for( auto element=(~rhs).begin(); element!=last; ++element ) {
1301  if( !isDefault( element->value() ) )
1302  return false;
1303  }
1304 
1305  return true;
1306 }
1308 //*************************************************************************************************
1309 
1310 
1311 //*************************************************************************************************
1329 template< typename MT // Type of the adapted matrix
1330  , bool SO // Storage order of the adapted matrix
1331  , bool DF // Density flag
1332  , typename VT // Type of the right-hand side sparse vector
1333  , bool TF > // Transpose flag of the right-hand side sparse vector
1334 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
1335  ptrdiff_t band, size_t row, size_t column )
1336 {
1338 
1339  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1340  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1341  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1342  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1343 
1344  MAYBE_UNUSED( lhs, row, column );
1345 
1346  if( band == 0L ) {
1347  if( (~rhs).nonZeros() != (~rhs).size() )
1348  return false;
1349  for( const auto& element : ~rhs ) {
1350  if( !isOne( element.value() ) )
1351  return false;
1352  }
1353  }
1354  else if( band < 0L ) {
1355  for( const auto& element : ~rhs ) {
1356  if( !isDefault( element.value() ) )
1357  return false;
1358  }
1359  }
1360 
1361  return true;
1362 }
1364 //*************************************************************************************************
1365 
1366 
1367 //*************************************************************************************************
1383 template< typename MT1 // Type of the adapted matrix
1384  , bool SO // Storage order of the adapted matrix
1385  , bool DF // Density flag
1386  , typename MT2 > // Type of the right-hand side dense matrix
1387 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1388  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
1389 {
1391 
1392  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1393  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1394  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1395  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1396 
1397  MAYBE_UNUSED( lhs );
1398 
1399  const size_t M( (~rhs).rows() );
1400  const size_t N( (~rhs).columns() );
1401 
1402  if( column >= row + M )
1403  return true;
1404 
1405  const size_t ibegin( ( column < row )?( 0UL ):( column - row ) );
1406 
1407  for( size_t i=ibegin; i<M; ++i )
1408  {
1409  const size_t jend( min( row + i - column, N ) );
1410 
1411  for( size_t j=0UL; j<jend; ++j ) {
1412  if( !isDefault( (~rhs)(i,j) ) )
1413  return false;
1414  }
1415 
1416  const bool containsDiagonal( row + i < column + N );
1417 
1418  if( containsDiagonal && !isOne( (~rhs)(i,jend) ) )
1419  return false;
1420  }
1421 
1422  return true;
1423 }
1425 //*************************************************************************************************
1426 
1427 
1428 //*************************************************************************************************
1444 template< typename MT1 // Type of the adapted matrix
1445  , bool SO // Storage order of the adapted matrix
1446  , bool DF // Density flag
1447  , typename MT2 > // Type of the right-hand side dense matrix
1448 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1449  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
1450 {
1452 
1453  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1454  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1455  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1456  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1457 
1458  MAYBE_UNUSED( lhs );
1459 
1460  const size_t M( (~rhs).rows() );
1461  const size_t N( (~rhs).columns() );
1462 
1463  if( column >= row + M )
1464  return true;
1465 
1466  const size_t jend( min( row + M - column, N ) );
1467 
1468  for( size_t j=0UL; j<jend; ++j )
1469  {
1470  const bool containsDiagonal( column + j >= row );
1471 
1472  if( containsDiagonal && !isOne( (~rhs)(column+j-row,j) ) )
1473  return false;
1474 
1475  const size_t ibegin( ( containsDiagonal )?( column + j - row + 1UL ):( 0UL ) );
1476 
1477  for( size_t i=ibegin; i<M; ++i ) {
1478  if( !isDefault( (~rhs)(i,j) ) )
1479  return false;
1480  }
1481  }
1482 
1483  return true;
1484 }
1486 //*************************************************************************************************
1487 
1488 
1489 //*************************************************************************************************
1505 template< typename MT1 // Type of the adapted matrix
1506  , bool SO // Storage order of the adapted matrix
1507  , bool DF // Density flag
1508  , typename MT2 > // Type of the right-hand side sparse matrix
1509 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1510  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
1511 {
1513 
1514  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1515  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1516  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1517  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1518 
1519  MAYBE_UNUSED( lhs );
1520 
1521  const size_t M( (~rhs).rows() );
1522  const size_t N( (~rhs).columns() );
1523 
1524  if( column >= row + M )
1525  return true;
1526 
1527  const size_t ibegin( ( column < row )?( 0UL ):( column - row ) );
1528 
1529  for( size_t i=ibegin; i<M; ++i )
1530  {
1531  const bool containsDiagonal( row + i < column + N );
1532 
1533  const size_t index( row + i - column );
1534  const auto last( (~rhs).lowerBound( i, min( index, N ) ) );
1535 
1536  if( containsDiagonal ) {
1537  if( last == (~rhs).end(i) || ( last->index() != index ) || !isOne( last->value() ) )
1538  return false;
1539  }
1540 
1541  for( auto element=(~rhs).begin(i); element!=last; ++element ) {
1542  if( !isDefault( element->value() ) )
1543  return false;
1544  }
1545  }
1546 
1547  return true;
1548 }
1550 //*************************************************************************************************
1551 
1552 
1553 //*************************************************************************************************
1569 template< typename MT1 // Type of the adapted matrix
1570  , bool SO // Storage order of the adapted matrix
1571  , bool DF // Density flag
1572  , typename MT2 > // Type of the right-hand side sparse matrix
1573 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1574  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
1575 {
1577 
1578  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1579  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1580  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1581  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1582 
1583  MAYBE_UNUSED( lhs );
1584 
1585  const size_t M( (~rhs).rows() );
1586  const size_t N( (~rhs).columns() );
1587 
1588  if( column >= row + M )
1589  return true;
1590 
1591  const size_t jend( min( row + M - column, N ) );
1592 
1593  for( size_t j=0UL; j<jend; ++j )
1594  {
1595  const bool containsDiagonal( column + j >= row );
1596  const size_t index( ( containsDiagonal )?( column + j - row ):( 0UL ) );
1597 
1598  const auto last( (~rhs).end(j) );
1599  auto element( (~rhs).lowerBound( index, j ) );
1600 
1601  if( containsDiagonal ) {
1602  if( element == last || ( element->index() != index ) || !isOne( element->value() ) )
1603  return false;
1604  ++element;
1605  }
1606 
1607  for( ; element!=last; ++element ) {
1608  if( !isDefault( element->value() ) )
1609  return false;
1610  }
1611  }
1612 
1613  return true;
1614 }
1616 //*************************************************************************************************
1617 
1618 
1619 //*************************************************************************************************
1636 template< typename MT // Type of the adapted matrix
1637  , bool SO // Storage order of the adapted matrix
1638  , bool DF // Density flag
1639  , typename VT > // Type of the right-hand side dense vector
1640 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1641  const DenseVector<VT,false>& rhs, size_t row, size_t column )
1642 {
1644 
1645  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1646  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1647  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1648 
1649  MAYBE_UNUSED( lhs );
1650 
1651  const size_t ibegin( ( column <= row )?( 0UL ):( column - row ) );
1652 
1653  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
1654  if( !isDefault( (~rhs)[i] ) )
1655  return false;
1656  }
1657 
1658  return true;
1659 }
1661 //*************************************************************************************************
1662 
1663 
1664 //*************************************************************************************************
1681 template< typename MT // Type of the adapted matrix
1682  , bool SO // Storage order of the adapted matrix
1683  , bool DF // Density flag
1684  , typename VT > // Type of the right-hand side dense vector
1685 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1686  const DenseVector<VT,true>& rhs, size_t row, size_t column )
1687 {
1689 
1690  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1691  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1692  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1693 
1694  MAYBE_UNUSED( lhs );
1695 
1696  if( row < column )
1697  return true;
1698 
1699  const size_t iend( min( row - column + 1UL, (~rhs).size() ) );
1700 
1701  for( size_t i=0UL; i<iend; ++i ) {
1702  if( !isDefault( (~rhs)[i] ) )
1703  return false;
1704  }
1705 
1706  return true;
1707 }
1709 //*************************************************************************************************
1710 
1711 
1712 //*************************************************************************************************
1729 template< typename MT // Type of the adapted matrix
1730  , bool SO // Storage order of the adapted matrix
1731  , bool DF // Density flag
1732  , typename VT // Type of the right-hand side dense vector
1733  , bool TF > // Transpose flag of the right-hand side dense vector
1734 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
1735  ptrdiff_t band, size_t row, size_t column )
1736 {
1738 
1739  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1740  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1741  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1742  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1743 
1744  MAYBE_UNUSED( lhs, row, column );
1745 
1746  if( band <= 0L ) {
1747  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
1748  if( !isDefault( (~rhs)[i] ) )
1749  return false;
1750  }
1751  }
1752 
1753  return true;
1754 }
1756 //*************************************************************************************************
1757 
1758 
1759 //*************************************************************************************************
1776 template< typename MT // Type of the adapted matrix
1777  , bool SO // Storage order of the adapted matrix
1778  , bool DF // Density flag
1779  , typename VT > // Type of the right-hand side sparse vector
1780 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1781  const SparseVector<VT,false>& rhs, size_t row, size_t column )
1782 {
1784 
1785  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1786  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1787  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1788 
1789  MAYBE_UNUSED( lhs );
1790 
1791  const auto last( (~rhs).end() );
1792  auto element( (~rhs).lowerBound( ( column <= row )?( 0UL ):( column - row ) ) );
1793 
1794  for( ; element!=last; ++element ) {
1795  if( !isDefault( element->value() ) )
1796  return false;
1797  }
1798 
1799  return true;
1800 }
1802 //*************************************************************************************************
1803 
1804 
1805 //*************************************************************************************************
1822 template< typename MT // Type of the adapted matrix
1823  , bool SO // Storage order of the adapted matrix
1824  , bool DF // Density flag
1825  , typename VT > // Type of the right-hand side sparse vector
1826 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1827  const SparseVector<VT,true>& rhs, size_t row, size_t column )
1828 {
1830 
1831  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1832  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1833  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1834 
1835  MAYBE_UNUSED( lhs );
1836 
1837  if( row < column )
1838  return true;
1839 
1840  const auto last( (~rhs).lowerBound( row - column + 1UL ) );
1841 
1842  for( auto element=(~rhs).begin(); element!=last; ++element ) {
1843  if( !isDefault( element->value() ) )
1844  return false;
1845  }
1846 
1847  return true;
1848 }
1850 //*************************************************************************************************
1851 
1852 
1853 //*************************************************************************************************
1870 template< typename MT // Type of the adapted matrix
1871  , bool SO // Storage order of the adapted matrix
1872  , bool DF // Density flag
1873  , typename VT // Type of the right-hand side sparse vector
1874  , bool TF > // Transpose flag of the right-hand side sparse vector
1875 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
1876  ptrdiff_t band, size_t row, size_t column )
1877 {
1879 
1880  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1881  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1882  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1883  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1884 
1885  MAYBE_UNUSED( lhs, row, column );
1886 
1887  if( band <= 0L ) {
1888  for( const auto& element : ~rhs ) {
1889  if( !isDefault( element.value() ) )
1890  return false;
1891  }
1892  }
1893 
1894  return true;
1895 }
1897 //*************************************************************************************************
1898 
1899 
1900 //*************************************************************************************************
1917 template< typename MT1 // Type of the adapted matrix
1918  , bool SO // Storage order of the adapted matrix
1919  , bool DF // Density flag
1920  , typename MT2 > // Type of the right-hand side dense matrix
1921 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1922  const DenseMatrix<MT2,false>& 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( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1929  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1930 
1931  MAYBE_UNUSED( lhs );
1932 
1933  const size_t M( (~rhs).rows() );
1934  const size_t N( (~rhs).columns() );
1935 
1936  if( column >= row + M )
1937  return true;
1938 
1939  const size_t ibegin( ( column <= row )?( 0UL ):( column - row ) );
1940 
1941  for( size_t i=ibegin; i<M; ++i )
1942  {
1943  const size_t jend( min( row + i - column + 1UL, N ) );
1944 
1945  for( size_t j=0UL; j<jend; ++j ) {
1946  if( !isDefault( (~rhs)(i,j) ) )
1947  return false;
1948  }
1949  }
1950 
1951  return true;
1952 }
1954 //*************************************************************************************************
1955 
1956 
1957 //*************************************************************************************************
1974 template< typename MT1 // Type of the adapted matrix
1975  , bool SO // Storage order of the adapted matrix
1976  , bool DF // Density flag
1977  , typename MT2 > // Type of the right-hand side dense matrix
1978 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1979  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
1980 {
1982 
1983  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1984  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1985  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1986  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1987 
1988  MAYBE_UNUSED( lhs );
1989 
1990  const size_t M( (~rhs).rows() );
1991  const size_t N( (~rhs).columns() );
1992 
1993  if( column >= row + M )
1994  return true;
1995 
1996  const size_t jend( min( row + M - column, N ) );
1997 
1998  for( size_t j=0UL; j<jend; ++j )
1999  {
2000  const bool containsDiagonal( column + j >= row );
2001  const size_t ibegin( ( containsDiagonal )?( column + j - row ):( 0UL ) );
2002 
2003  for( size_t i=ibegin; i<M; ++i ) {
2004  if( !isDefault( (~rhs)(i,j) ) )
2005  return false;
2006  }
2007  }
2008 
2009  return true;
2010 }
2012 //*************************************************************************************************
2013 
2014 
2015 //*************************************************************************************************
2032 template< typename MT1 // Type of the adapted matrix
2033  , bool SO // Storage order of the adapted matrix
2034  , bool DF // Density flag
2035  , typename MT2 > // Type of the right-hand side sparse matrix
2036 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
2037  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
2038 {
2040 
2041  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2042  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2043  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
2044  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
2045 
2046  MAYBE_UNUSED( lhs );
2047 
2048  const size_t M( (~rhs).rows() );
2049  const size_t N( (~rhs).columns() );
2050 
2051  if( column >= row + M )
2052  return true;
2053 
2054  const size_t ibegin( ( column < row )?( 0UL ):( column - row ) );
2055 
2056  for( size_t i=ibegin; i<M; ++i )
2057  {
2058  const size_t index( row + i - column + 1UL );
2059  const auto last( (~rhs).lowerBound( i, min( index, N ) ) );
2060 
2061  for( auto element=(~rhs).begin(i); element!=last; ++element ) {
2062  if( !isDefault( element->value() ) )
2063  return false;
2064  }
2065  }
2066 
2067  return true;
2068 }
2070 //*************************************************************************************************
2071 
2072 
2073 //*************************************************************************************************
2090 template< typename MT1 // Type of the adapted matrix
2091  , bool SO // Storage order of the adapted matrix
2092  , bool DF // Density flag
2093  , typename MT2 > // Type of the right-hand side sparse matrix
2094 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
2095  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
2096 {
2098 
2099  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2100  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2101  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
2102  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
2103 
2104  MAYBE_UNUSED( lhs );
2105 
2106  const size_t M( (~rhs).rows() );
2107  const size_t N( (~rhs).columns() );
2108 
2109  if( column >= row + M )
2110  return true;
2111 
2112  const size_t jend( min( row + M - column, N ) );
2113 
2114  for( size_t j=0UL; j<jend; ++j )
2115  {
2116  const bool containsDiagonal( column + j >= row );
2117  const size_t index( ( containsDiagonal )?( column + j - row ):( 0UL ) );
2118 
2119  const auto last( (~rhs).end(j) );
2120  auto element( (~rhs).lowerBound( index, j ) );
2121 
2122  for( ; element!=last; ++element ) {
2123  if( !isDefault( element->value() ) )
2124  return false;
2125  }
2126  }
2127 
2128  return true;
2129 }
2131 //*************************************************************************************************
2132 
2133 
2134 //*************************************************************************************************
2151 template< typename MT // Type of the adapted matrix
2152  , bool SO // Storage order of the adapted matrix
2153  , bool DF // Density flag
2154  , typename VT // Type of the right-hand side vector
2155  , bool TF > // Transpose flag of the right-hand side vector
2156 inline bool trySubAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
2157  const Vector<VT,TF>& rhs, size_t row, size_t column )
2158 {
2159  return tryAddAssign( lhs, ~rhs, row, column );
2160 }
2162 //*************************************************************************************************
2163 
2164 
2165 //*************************************************************************************************
2183 template< typename MT // Type of the adapted matrix
2184  , bool SO // Storage order of the adapted matrix
2185  , bool DF // Density flag
2186  , typename VT // Type of the right-hand side vector
2187  , bool TF > // Transpose flag of the right-hand side vector
2188 inline bool trySubAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
2189  ptrdiff_t band, size_t row, size_t column )
2190 {
2191  return tryAddAssign( lhs, ~rhs, band, row, column );
2192 }
2194 //*************************************************************************************************
2195 
2196 
2197 //*************************************************************************************************
2214 template< typename MT1 // Type of the adapted matrix
2215  , bool SO1 // Storage order of the adapted matrix
2216  , bool DF // Density flag
2217  , typename MT2 // Type of the right-hand side matrix
2218  , bool SO2 > // Storage order of the right-hand side matrix
2219 inline bool trySubAssign( const UniUpperMatrix<MT1,SO1,DF>& lhs,
2220  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
2221 {
2222  return tryAddAssign( lhs, ~rhs, row, column );
2223 }
2225 //*************************************************************************************************
2226 
2227 
2228 //*************************************************************************************************
2245 template< typename MT // Type of the adapted matrix
2246  , bool SO // Storage order of the adapted matrix
2247  , bool DF // Density flag
2248  , typename VT > // Type of the right-hand side vector
2249 inline bool tryMultAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
2250  const Vector<VT,false>& rhs, size_t row, size_t column )
2251 {
2253 
2254  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2255  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2256  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2257 
2258  MAYBE_UNUSED( lhs );
2259 
2260  return ( column < row ) ||
2261  ( (~rhs).size() <= column - row ) ||
2262  isOne( (~rhs)[column-row] );
2263 }
2265 //*************************************************************************************************
2266 
2267 
2268 //*************************************************************************************************
2285 template< typename MT // Type of the adapted matrix
2286  , bool SO // Storage order of the adapted matrix
2287  , bool DF // Density flag
2288  , typename VT > // Type of the right-hand side vector
2289 inline bool tryMultAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
2290  const Vector<VT,true>& rhs, size_t row, size_t column )
2291 {
2293 
2294  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2295  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2296  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2297 
2298  MAYBE_UNUSED( lhs );
2299 
2300  return ( row < column ) ||
2301  ( (~rhs).size() <= row - column ) ||
2302  isOne( (~rhs)[row-column] );
2303 }
2305 //*************************************************************************************************
2306 
2307 
2308 //*************************************************************************************************
2325 template< typename MT // Type of the adapted matrix
2326  , bool SO // Storage order of the adapted matrix
2327  , bool DF // Density flag
2328  , typename VT // Type of the right-hand side dense vector
2329  , bool TF > // Transpose flag of the right-hand side dense vector
2330 inline bool tryMultAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
2331  ptrdiff_t band, size_t row, size_t column )
2332 {
2334 
2335  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2336  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2337  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2338  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2339 
2340  MAYBE_UNUSED( lhs, row, column );
2341 
2342  if( band == 0L ) {
2343  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
2344  if( !isOne( (~rhs)[i] ) )
2345  return false;
2346  }
2347  }
2348 
2349  return true;
2350 }
2352 //*************************************************************************************************
2353 
2354 
2355 //*************************************************************************************************
2372 template< typename MT // Type of the adapted matrix
2373  , bool SO // Storage order of the adapted matrix
2374  , bool DF // Density flag
2375  , typename VT // Type of the right-hand side sparse vector
2376  , bool TF > // Transpose flag of the right-hand side sparse vector
2377 inline bool tryMultAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
2378  ptrdiff_t band, size_t row, size_t column )
2379 {
2381 
2382  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2383  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2384  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2385  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2386 
2387  MAYBE_UNUSED( lhs, row, column );
2388 
2389  if( band == 0L ) {
2390  if( (~rhs).nonZeros() != (~rhs).size() )
2391  return false;
2392  for( const auto& element : ~rhs ) {
2393  if( !isOne( element.value() ) )
2394  return false;
2395  }
2396  }
2397 
2398  return true;
2399 }
2401 //*************************************************************************************************
2402 
2403 
2404 //*************************************************************************************************
2421 template< typename MT1 // Type of the adapted matrix
2422  , bool SO1 // Storage order of the adapted matrix
2423  , bool DF // Density flag
2424  , typename MT2 // Type of the right-hand side matrix
2425  , bool SO2 > // Storage order of the right-hand side matrix
2426 inline bool trySchurAssign( const UniUpperMatrix<MT1,SO1,DF>& lhs,
2427  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
2428 {
2430 
2431  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2432  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2433  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
2434  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
2435 
2436  MAYBE_UNUSED( lhs );
2437 
2438  const size_t M( (~rhs).rows() );
2439  const size_t N( (~rhs).columns() );
2440 
2441  if( ( column >= row + M ) || ( row >= column + N ) )
2442  return true;
2443 
2444  size_t i( row < column ? column - row : 0UL );
2445  size_t j( column < row ? row - column : 0UL );
2446 
2447  for( ; i<M && j<N; ++i, ++j )
2448  {
2449  if( !isOne( (~rhs)(i,j) ) )
2450  return false;
2451  }
2452 
2453  return true;
2454 }
2456 //*************************************************************************************************
2457 
2458 
2459 //*************************************************************************************************
2475 template< typename MT // Type of the adapted matrix
2476  , bool SO // Storage order of the adapted matrix
2477  , bool DF // Density flag
2478  , typename VT // Type of the right-hand side vector
2479  , bool TF > // Transpose flag of the right-hand side vector
2480 inline bool tryDivAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
2481  const Vector<VT,TF>& rhs, size_t row, size_t column )
2482 {
2483  return tryMultAssign( lhs, ~rhs, row, column );
2484 }
2486 //*************************************************************************************************
2487 
2488 
2489 //*************************************************************************************************
2506 template< typename MT // Type of the adapted matrix
2507  , bool SO // Storage order of the adapted matrix
2508  , bool DF // Density flag
2509  , typename VT // Type of the right-hand side vector
2510  , bool TF > // Transpose flag of the right-hand side vector
2511 inline bool tryDivAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
2512  ptrdiff_t band, size_t row, size_t column )
2513 {
2514  return tryMultAssign( lhs, ~rhs, band, row, column );
2515 }
2517 //*************************************************************************************************
2518 
2519 
2520 //*************************************************************************************************
2536 template< typename MT // Type of the adapted matrix
2537  , bool SO // Storage order of the adapted matrix
2538  , bool DF // Density flag
2539  , typename VT > // Type of the right-hand side vector
2540 inline bool tryShiftAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
2541  const Vector<VT,false>& rhs, size_t row, size_t column )
2542 {
2544 
2545  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2546  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2547  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2548 
2549  MAYBE_UNUSED( lhs );
2550 
2551  return ( column < row ) ||
2552  ( (~rhs).size() <= column - row ) ||
2553  isDefault( (~rhs)[column-row] );
2554 }
2556 //*************************************************************************************************
2557 
2558 
2559 //*************************************************************************************************
2575 template< typename MT // Type of the adapted matrix
2576  , bool SO // Storage order of the adapted matrix
2577  , bool DF // Density flag
2578  , typename VT > // Type of the right-hand side vector
2579 inline bool tryShiftAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
2580  const Vector<VT,true>& rhs, size_t row, size_t column )
2581 {
2583 
2584  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2585  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2586  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2587 
2588  MAYBE_UNUSED( lhs );
2589 
2590  return ( row < column ) ||
2591  ( (~rhs).size() <= row - column ) ||
2592  isDefault( (~rhs)[row-column] );
2593 }
2595 //*************************************************************************************************
2596 
2597 
2598 //*************************************************************************************************
2615 template< typename MT // Type of the adapted matrix
2616  , bool SO // Storage order of the adapted matrix
2617  , bool DF // Density flag
2618  , typename VT // Type of the right-hand side dense vector
2619  , bool TF > // Transpose flag of the right-hand side dense vector
2620 inline bool tryShiftAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
2621  ptrdiff_t band, size_t row, size_t column )
2622 {
2624 
2625  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2626  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2627  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2628  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2629 
2630  MAYBE_UNUSED( lhs, row, column );
2631 
2632  if( band == 0L ) {
2633  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
2634  if( !isDefault( (~rhs)[i] ) )
2635  return false;
2636  }
2637  }
2638 
2639  return true;
2640 }
2642 //*************************************************************************************************
2643 
2644 
2645 //*************************************************************************************************
2662 template< typename MT // Type of the adapted matrix
2663  , bool SO // Storage order of the adapted matrix
2664  , bool DF // Density flag
2665  , typename VT // Type of the right-hand side sparse vector
2666  , bool TF > // Transpose flag of the right-hand side sparse vector
2667 inline bool tryShiftAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
2668  ptrdiff_t band, size_t row, size_t column )
2669 {
2671 
2672  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2673  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2674  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2675  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2676 
2677  MAYBE_UNUSED( lhs, row, column );
2678 
2679  if( band == 0L ) {
2680  if( (~rhs).nonZeros() != (~rhs).size() )
2681  return false;
2682  for( const auto& element : ~rhs ) {
2683  if( !isDefault( element.value() ) )
2684  return false;
2685  }
2686  }
2687 
2688  return true;
2689 }
2691 //*************************************************************************************************
2692 
2693 
2694 //*************************************************************************************************
2710 template< typename MT1 // Type of the adapted matrix
2711  , bool SO1 // Storage order of the adapted matrix
2712  , bool DF // Density flag
2713  , typename MT2 // Type of the right-hand side matrix
2714  , bool SO2 > // Storage order of the right-hand side matrix
2715 inline bool tryShiftAssign( const UniUpperMatrix<MT1,SO1,DF>& lhs,
2716  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
2717 {
2719 
2720  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2721  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2722  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
2723  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
2724 
2725  MAYBE_UNUSED( lhs );
2726 
2727  const size_t M( (~rhs).rows() );
2728  const size_t N( (~rhs).columns() );
2729 
2730  if( ( column >= row + M ) || ( row >= column + N ) )
2731  return true;
2732 
2733  size_t i( row < column ? column - row : 0UL );
2734  size_t j( column < row ? row - column : 0UL );
2735 
2736  for( ; i<M && j<N; ++i, ++j )
2737  {
2738  if( !isDefault( (~rhs)(i,j) ) )
2739  return false;
2740  }
2741 
2742  return true;
2743 }
2745 //*************************************************************************************************
2746 
2747 
2748 //*************************************************************************************************
2765 template< typename MT // Type of the adapted matrix
2766  , bool SO // Storage order of the adapted matrix
2767  , bool DF // Density flag
2768  , typename VT > // Type of the right-hand side vector
2769 inline bool tryBitandAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
2770  const Vector<VT,false>& rhs, size_t row, size_t column )
2771 {
2773 
2774  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2775  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2776  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2777 
2778  MAYBE_UNUSED( lhs );
2779 
2780  return ( column < row ) ||
2781  ( (~rhs).size() <= column - row ) ||
2782  ( ElementType_t<MT>(1) & (~rhs)[column-row] );
2783 }
2785 //*************************************************************************************************
2786 
2787 
2788 //*************************************************************************************************
2805 template< typename MT // Type of the adapted matrix
2806  , bool SO // Storage order of the adapted matrix
2807  , bool DF // Density flag
2808  , typename VT > // Type of the right-hand side vector
2809 inline bool tryBitandAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
2810  const Vector<VT,true>& rhs, size_t row, size_t column )
2811 {
2813 
2814  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2815  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2816  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2817 
2818  MAYBE_UNUSED( lhs );
2819 
2820  return ( row < column ) ||
2821  ( (~rhs).size() <= row - column ) ||
2822  ( ElementType_t<MT>(1) & (~rhs)[row-column] );
2823 }
2825 //*************************************************************************************************
2826 
2827 
2828 //*************************************************************************************************
2845 template< typename MT // Type of the adapted matrix
2846  , bool SO // Storage order of the adapted matrix
2847  , bool DF // Density flag
2848  , typename VT // Type of the right-hand side dense vector
2849  , bool TF > // Transpose flag of the right-hand side dense vector
2850 inline bool tryBitandAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
2851  ptrdiff_t band, size_t row, size_t column )
2852 {
2854 
2855  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2856  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2857  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2858  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2859 
2860  MAYBE_UNUSED( lhs, row, column );
2861 
2862  if( band == 0L ) {
2863  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
2864  if( !( ElementType_t<MT>(1) & (~rhs)[i] ) )
2865  return false;
2866  }
2867  }
2868 
2869  return true;
2870 }
2872 //*************************************************************************************************
2873 
2874 
2875 //*************************************************************************************************
2892 template< typename MT // Type of the adapted matrix
2893  , bool SO // Storage order of the adapted matrix
2894  , bool DF // Density flag
2895  , typename VT // Type of the right-hand side sparse vector
2896  , bool TF > // Transpose flag of the right-hand side sparse vector
2897 inline bool tryBitandAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
2898  ptrdiff_t band, size_t row, size_t column )
2899 {
2901 
2902  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2903  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2904  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2905  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2906 
2907  MAYBE_UNUSED( lhs, row, column );
2908 
2909  if( band == 0L ) {
2910  if( (~rhs).nonZeros() != (~rhs).size() )
2911  return false;
2912  for( const auto& element : ~rhs ) {
2913  if( !( ElementType_t<MT>(1) & element.value() ) )
2914  return false;
2915  }
2916  }
2917 
2918  return true;
2919 }
2921 //*************************************************************************************************
2922 
2923 
2924 //*************************************************************************************************
2941 template< typename MT1 // Type of the adapted matrix
2942  , bool SO1 // Storage order of the adapted matrix
2943  , bool DF // Density flag
2944  , typename MT2 // Type of the right-hand side matrix
2945  , bool SO2 > // Storage order of the right-hand side matrix
2946 inline bool tryBitandAssign( const UniUpperMatrix<MT1,SO1,DF>& lhs,
2947  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
2948 {
2950 
2951  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2952  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2953  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
2954  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
2955 
2956  MAYBE_UNUSED( lhs );
2957 
2958  const size_t M( (~rhs).rows() );
2959  const size_t N( (~rhs).columns() );
2960 
2961  if( ( column >= row + M ) || ( row >= column + N ) )
2962  return true;
2963 
2964  size_t i( row < column ? column - row : 0UL );
2965  size_t j( column < row ? row - column : 0UL );
2966 
2967  for( ; i<M && j<N; ++i, ++j )
2968  {
2969  if( !( ElementType_t<MT1>(1) & (~rhs)(i,j) ) )
2970  return false;
2971  }
2972 
2973  return true;
2974 }
2976 //*************************************************************************************************
2977 
2978 
2979 //*************************************************************************************************
2996 template< typename MT // Type of the adapted matrix
2997  , bool SO // Storage order of the adapted matrix
2998  , bool DF // Density flag
2999  , typename VT // Type of the right-hand side vector
3000  , bool TF > // Transpose flag of the right-hand side vector
3001 inline bool tryBitorAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
3002  const Vector<VT,TF>& rhs, size_t row, size_t column )
3003 {
3004  return tryAssign( lhs, ~rhs, row, column );
3005 }
3007 //*************************************************************************************************
3008 
3009 
3010 //*************************************************************************************************
3027 template< typename MT // Type of the adapted matrix
3028  , bool SO // Storage order of the adapted matrix
3029  , bool DF // Density flag
3030  , typename VT // Type of the right-hand side vector
3031  , bool TF > // Transpose flag of the right-hand side vector
3032 inline bool tryBitorAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
3033  ptrdiff_t band, size_t row, size_t column )
3034 {
3035  return tryAssign( lhs, ~rhs, band, row, column );
3036 }
3038 //*************************************************************************************************
3039 
3040 
3041 //*************************************************************************************************
3058 template< typename MT1 // Type of the adapted matrix
3059  , bool SO1 // Storage order of the adapted matrix
3060  , bool DF // Density flag
3061  , typename MT2 // Type of the right-hand side matrix
3062  , bool SO2 > // Storage order of the right-hand side matrix
3063 inline bool tryBitorAssign( const UniUpperMatrix<MT1,SO1,DF>& lhs,
3064  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
3065 {
3066  return tryAssign( lhs, ~rhs, row, column );
3067 }
3069 //*************************************************************************************************
3070 
3071 
3072 //*************************************************************************************************
3089 template< typename MT // Type of the adapted matrix
3090  , bool SO // Storage order of the adapted matrix
3091  , bool DF // Density flag
3092  , typename VT // Type of the right-hand side vector
3093  , bool TF > // Transpose flag of the right-hand side vector
3094 inline bool tryBitxorAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
3095  const Vector<VT,TF>& rhs, size_t row, size_t column )
3096 {
3097  return tryAddAssign( lhs, ~rhs, row, column );
3098 }
3100 //*************************************************************************************************
3101 
3102 
3103 //*************************************************************************************************
3120 template< typename MT // Type of the adapted matrix
3121  , bool SO // Storage order of the adapted matrix
3122  , bool DF // Density flag
3123  , typename VT // Type of the right-hand side vector
3124  , bool TF > // Transpose flag of the right-hand side vector
3125 inline bool tryBitxorAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
3126  ptrdiff_t band, size_t row, size_t column )
3127 {
3128  return tryAddAssign( lhs, ~rhs, band, row, column );
3129 }
3131 //*************************************************************************************************
3132 
3133 
3134 //*************************************************************************************************
3151 template< typename MT1 // Type of the adapted matrix
3152  , bool SO1 // Storage order of the adapted matrix
3153  , bool DF // Density flag
3154  , typename MT2 // Type of the right-hand side matrix
3155  , bool SO2 > // Storage order of the right-hand side matrix
3156 inline bool tryBitxorAssign( const UniUpperMatrix<MT1,SO1,DF>& lhs,
3157  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
3158 {
3159  return tryAddAssign( lhs, ~rhs, row, column );
3160 }
3162 //*************************************************************************************************
3163 
3164 
3165 //*************************************************************************************************
3179 template< typename MT // Type of the adapted matrix
3180  , bool SO // Storage order of the adapted matrix
3181  , bool DF > // Density flag
3182 inline MT& derestrict( UniUpperMatrix<MT,SO,DF>& m )
3183 {
3184  return m.matrix_;
3185 }
3187 //*************************************************************************************************
3188 
3189 
3190 
3191 
3192 //=================================================================================================
3193 //
3194 // SIZE SPECIALIZATIONS
3195 //
3196 //=================================================================================================
3197 
3198 //*************************************************************************************************
3200 template< typename MT, bool SO, bool DF >
3201 struct Size< UniUpperMatrix<MT,SO,DF>, 0UL >
3202  : public Size<MT,0UL>
3203 {};
3204 
3205 template< typename MT, bool SO, bool DF >
3206 struct Size< UniUpperMatrix<MT,SO,DF>, 1UL >
3207  : public Size<MT,1UL>
3208 {};
3210 //*************************************************************************************************
3211 
3212 
3213 
3214 
3215 //=================================================================================================
3216 //
3217 // MAXSIZE SPECIALIZATIONS
3218 //
3219 //=================================================================================================
3220 
3221 //*************************************************************************************************
3223 template< typename MT, bool SO, bool DF >
3224 struct MaxSize< UniUpperMatrix<MT,SO,DF>, 0UL >
3225  : public MaxSize<MT,0UL>
3226 {};
3227 
3228 template< typename MT, bool SO, bool DF >
3229 struct MaxSize< UniUpperMatrix<MT,SO,DF>, 1UL >
3230  : public MaxSize<MT,1UL>
3231 {};
3233 //*************************************************************************************************
3234 
3235 
3236 
3237 
3238 //=================================================================================================
3239 //
3240 // ISSQUARE SPECIALIZATIONS
3241 //
3242 //=================================================================================================
3243 
3244 //*************************************************************************************************
3246 template< typename MT, bool SO, bool DF >
3247 struct IsSquare< UniUpperMatrix<MT,SO,DF> >
3248  : public TrueType
3249 {};
3251 //*************************************************************************************************
3252 
3253 
3254 
3255 
3256 //=================================================================================================
3257 //
3258 // ISUNIUPPER SPECIALIZATIONS
3259 //
3260 //=================================================================================================
3261 
3262 //*************************************************************************************************
3264 template< typename MT, bool SO, bool DF >
3265 struct IsUniUpper< UniUpperMatrix<MT,SO,DF> >
3266  : public TrueType
3267 {};
3269 //*************************************************************************************************
3270 
3271 
3272 
3273 
3274 //=================================================================================================
3275 //
3276 // ISADAPTOR SPECIALIZATIONS
3277 //
3278 //=================================================================================================
3279 
3280 //*************************************************************************************************
3282 template< typename MT, bool SO, bool DF >
3283 struct IsAdaptor< UniUpperMatrix<MT,SO,DF> >
3284  : public TrueType
3285 {};
3287 //*************************************************************************************************
3288 
3289 
3290 
3291 
3292 //=================================================================================================
3293 //
3294 // ISRESTRICTED SPECIALIZATIONS
3295 //
3296 //=================================================================================================
3297 
3298 //*************************************************************************************************
3300 template< typename MT, bool SO, bool DF >
3301 struct IsRestricted< UniUpperMatrix<MT,SO,DF> >
3302  : public TrueType
3303 {};
3305 //*************************************************************************************************
3306 
3307 
3308 
3309 
3310 //=================================================================================================
3311 //
3312 // HASCONSTDATAACCESS SPECIALIZATIONS
3313 //
3314 //=================================================================================================
3315 
3316 //*************************************************************************************************
3318 template< typename MT, bool SO >
3319 struct HasConstDataAccess< UniUpperMatrix<MT,SO,true> >
3320  : public TrueType
3321 {};
3323 //*************************************************************************************************
3324 
3325 
3326 
3327 
3328 //=================================================================================================
3329 //
3330 // ISALIGNED SPECIALIZATIONS
3331 //
3332 //=================================================================================================
3333 
3334 //*************************************************************************************************
3336 template< typename MT, bool SO, bool DF >
3337 struct IsAligned< UniUpperMatrix<MT,SO,DF> >
3338  : public IsAligned<MT>
3339 {};
3341 //*************************************************************************************************
3342 
3343 
3344 
3345 
3346 //=================================================================================================
3347 //
3348 // ISCONTIGUOUS SPECIALIZATIONS
3349 //
3350 //=================================================================================================
3351 
3352 //*************************************************************************************************
3354 template< typename MT, bool SO, bool DF >
3355 struct IsContiguous< UniUpperMatrix<MT,SO,DF> >
3356  : public IsContiguous<MT>
3357 {};
3359 //*************************************************************************************************
3360 
3361 
3362 
3363 
3364 //=================================================================================================
3365 //
3366 // ISPADDED SPECIALIZATIONS
3367 //
3368 //=================================================================================================
3369 
3370 //*************************************************************************************************
3372 template< typename MT, bool SO, bool DF >
3373 struct IsPadded< UniUpperMatrix<MT,SO,DF> >
3374  : public IsPadded<MT>
3375 {};
3377 //*************************************************************************************************
3378 
3379 
3380 
3381 
3382 //=================================================================================================
3383 //
3384 // ISRESIZABLE SPECIALIZATIONS
3385 //
3386 //=================================================================================================
3387 
3388 //*************************************************************************************************
3390 template< typename MT, bool SO, bool DF >
3391 struct IsResizable< UniUpperMatrix<MT,SO,DF> >
3392  : public IsResizable<MT>
3393 {};
3395 //*************************************************************************************************
3396 
3397 
3398 
3399 
3400 //=================================================================================================
3401 //
3402 // ISSHRINKABLE SPECIALIZATIONS
3403 //
3404 //=================================================================================================
3405 
3406 //*************************************************************************************************
3408 template< typename MT, bool SO, bool DF >
3409 struct IsShrinkable< UniUpperMatrix<MT,SO,DF> >
3410  : public IsShrinkable<MT>
3411 {};
3413 //*************************************************************************************************
3414 
3415 
3416 
3417 
3418 //=================================================================================================
3419 //
3420 // REMOVEADAPTOR SPECIALIZATIONS
3421 //
3422 //=================================================================================================
3423 
3424 //*************************************************************************************************
3426 template< typename MT, bool SO, bool DF >
3427 struct RemoveAdaptor< UniUpperMatrix<MT,SO,DF> >
3428 {
3429  using Type = MT;
3430 };
3432 //*************************************************************************************************
3433 
3434 
3435 
3436 
3437 //=================================================================================================
3438 //
3439 // ADDTRAIT SPECIALIZATIONS
3440 //
3441 //=================================================================================================
3442 
3443 //*************************************************************************************************
3445 template< typename T1, typename T2 >
3446 struct AddTraitEval1< T1, T2
3447  , EnableIf_t< IsMatrix_v<T1> &&
3448  IsMatrix_v<T2> &&
3449  ( ( IsUniUpper_v<T1> && IsStrictlyUpper_v<T2> &&
3450  !( IsUniLower_v<T1> && IsStrictlyLower_v<T2> ) ) ||
3451  ( IsStrictlyUpper_v<T1> && IsUniUpper_v<T2> &&
3452  !( IsStrictlyLower_v<T1> && IsUniLower_v<T2> ) ) ) &&
3453  !( IsZero_v<T1> || IsZero_v<T2> ) > >
3454 {
3455  using Type = UniUpperMatrix< typename AddTraitEval2<T1,T2>::Type >;
3456 };
3458 //*************************************************************************************************
3459 
3460 
3461 
3462 
3463 //=================================================================================================
3464 //
3465 // SUBTRAIT SPECIALIZATIONS
3466 //
3467 //=================================================================================================
3468 
3469 //*************************************************************************************************
3471 template< typename T1, typename T2 >
3472 struct SubTraitEval1< T1, T2
3473  , EnableIf_t< IsMatrix_v<T1> &&
3474  IsMatrix_v<T2> &&
3475  ( IsUniUpper_v<T1> && IsStrictlyUpper_v<T2> &&
3476  !( IsUniLower_v<T1> && IsStrictlyLower_v<T2> ) ) &&
3477  !( IsZero_v<T1> || IsZero_v<T2> ) > >
3478 {
3479  using Type = UniUpperMatrix< typename SubTraitEval2<T1,T2>::Type >;
3480 };
3482 //*************************************************************************************************
3483 
3484 
3485 
3486 
3487 //=================================================================================================
3488 //
3489 // SCHURTRAIT SPECIALIZATIONS
3490 //
3491 //=================================================================================================
3492 
3493 //*************************************************************************************************
3495 template< typename T1, typename T2 >
3496 struct SchurTraitEval1< T1, T2
3497  , EnableIf_t< IsMatrix_v<T1> &&
3498  IsMatrix_v<T2> &&
3499  ( IsUniUpper_v<T1> && IsUniUpper_v<T2> ) &&
3500  !( IsDiagonal_v<T1> || IsDiagonal_v<T2> ) &&
3501  !( IsZero_v<T1> || IsZero_v<T2> ) > >
3502 {
3503  using Type = UniUpperMatrix< typename SchurTraitEval2<T1,T2>::Type >;
3504 };
3506 //*************************************************************************************************
3507 
3508 
3509 
3510 
3511 //=================================================================================================
3512 //
3513 // MULTTRAIT SPECIALIZATIONS
3514 //
3515 //=================================================================================================
3516 
3517 //*************************************************************************************************
3519 template< typename T1, typename T2 >
3520 struct MultTraitEval1< T1, T2
3521  , EnableIf_t< IsMatrix_v<T1> &&
3522  IsMatrix_v<T2> &&
3523  ( IsUniUpper_v<T1> && IsUniUpper_v<T2> ) &&
3524  !( IsIdentity_v<T1> || IsIdentity_v<T2> ) > >
3525 {
3526  using Type = UniUpperMatrix< typename MultTraitEval2<T1,T2>::Type >;
3527 };
3529 //*************************************************************************************************
3530 
3531 
3532 
3533 
3534 //=================================================================================================
3535 //
3536 // KRONTRAIT SPECIALIZATIONS
3537 //
3538 //=================================================================================================
3539 
3540 //*************************************************************************************************
3542 template< typename T1, typename T2 >
3543 struct KronTraitEval1< T1, T2
3544  , EnableIf_t< IsMatrix_v<T1> &&
3545  IsMatrix_v<T2> &&
3546  ( IsUniUpper_v<T1> && IsUniUpper_v<T2> ) &&
3547  !( IsIdentity_v<T1> && IsIdentity_v<T2> ) &&
3548  !( IsZero_v<T1> || IsZero_v<T2> ) > >
3549 {
3550  using Type = UniUpperMatrix< typename KronTraitEval2<T1,T2>::Type >;
3551 };
3553 //*************************************************************************************************
3554 
3555 
3556 
3557 
3558 //=================================================================================================
3559 //
3560 // MAPTRAIT SPECIALIZATIONS
3561 //
3562 //=================================================================================================
3563 
3564 //*************************************************************************************************
3566 template< typename T, typename OP >
3567 struct UnaryMapTraitEval1< T, OP
3568  , EnableIf_t< YieldsUniUpper_v<OP,T> &&
3569  !YieldsIdentity_v<OP,T> > >
3570 {
3571  using Type = UniUpperMatrix< typename UnaryMapTraitEval2<T,OP>::Type, StorageOrder_v<T> >;
3572 };
3574 //*************************************************************************************************
3575 
3576 
3577 //*************************************************************************************************
3579 template< typename T1, typename T2, typename OP >
3580 struct BinaryMapTraitEval1< T1, T2, OP
3581  , EnableIf_t< YieldsUniUpper_v<OP,T1,T2> &&
3582  !YieldsIdentity_v<OP,T1,T2> > >
3583 {
3584  using Type = UniUpperMatrix< typename BinaryMapTraitEval2<T1,T2,OP>::Type >;
3585 };
3587 //*************************************************************************************************
3588 
3589 
3590 
3591 
3592 //=================================================================================================
3593 //
3594 // DECLSYMTRAIT SPECIALIZATIONS
3595 //
3596 //=================================================================================================
3597 
3598 //*************************************************************************************************
3600 template< typename MT, bool SO, bool DF >
3601 struct DeclSymTrait< UniUpperMatrix<MT,SO,DF> >
3602 {
3603  using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3604 };
3606 //*************************************************************************************************
3607 
3608 
3609 
3610 
3611 //=================================================================================================
3612 //
3613 // DECLHERMTRAIT SPECIALIZATIONS
3614 //
3615 //=================================================================================================
3616 
3617 //*************************************************************************************************
3619 template< typename MT, bool SO, bool DF >
3620 struct DeclHermTrait< UniUpperMatrix<MT,SO,DF> >
3621 {
3622  using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3623 };
3625 //*************************************************************************************************
3626 
3627 
3628 
3629 
3630 //=================================================================================================
3631 //
3632 // DECLLOWTRAIT SPECIALIZATIONS
3633 //
3634 //=================================================================================================
3635 
3636 //*************************************************************************************************
3638 template< typename MT, bool SO, bool DF >
3639 struct DeclLowTrait< UniUpperMatrix<MT,SO,DF> >
3640 {
3641  using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3642 };
3644 //*************************************************************************************************
3645 
3646 
3647 
3648 
3649 //=================================================================================================
3650 //
3651 // DECLUPPTRAIT SPECIALIZATIONS
3652 //
3653 //=================================================================================================
3654 
3655 //*************************************************************************************************
3657 template< typename MT, bool SO, bool DF >
3658 struct DeclUppTrait< UniUpperMatrix<MT,SO,DF> >
3659 {
3660  using Type = UniUpperMatrix<MT,SO,DF>;
3661 };
3663 //*************************************************************************************************
3664 
3665 
3666 
3667 
3668 //=================================================================================================
3669 //
3670 // DECLDIAGTRAIT SPECIALIZATIONS
3671 //
3672 //=================================================================================================
3673 
3674 //*************************************************************************************************
3676 template< typename MT, bool SO, bool DF >
3677 struct DeclDiagTrait< UniUpperMatrix<MT,SO,DF> >
3678 {
3679  using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3680 };
3682 //*************************************************************************************************
3683 
3684 
3685 
3686 
3687 //=================================================================================================
3688 //
3689 // HIGHTYPE SPECIALIZATIONS
3690 //
3691 //=================================================================================================
3692 
3693 //*************************************************************************************************
3695 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3696 struct HighType< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
3697 {
3698  using Type = UniUpperMatrix< typename HighType<MT1,MT2>::Type >;
3699 };
3701 //*************************************************************************************************
3702 
3703 
3704 
3705 
3706 //=================================================================================================
3707 //
3708 // LOWTYPE SPECIALIZATIONS
3709 //
3710 //=================================================================================================
3711 
3712 //*************************************************************************************************
3714 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3715 struct LowType< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
3716 {
3717  using Type = UniUpperMatrix< typename LowType<MT1,MT2>::Type >;
3718 };
3720 //*************************************************************************************************
3721 
3722 
3723 
3724 
3725 //=================================================================================================
3726 //
3727 // SUBMATRIXTRAIT SPECIALIZATIONS
3728 //
3729 //=================================================================================================
3730 
3731 //*************************************************************************************************
3733 template< typename MT, size_t I, size_t N >
3734 struct SubmatrixTraitEval1< MT, I, I, N, N
3735  , EnableIf_t< IsUniUpper_v<MT> &&
3736  !IsIdentity_v<MT> > >
3737 {
3738  using Type = UniUpperMatrix< typename SubmatrixTraitEval2<MT,I,I,N,N>::Type >;
3739 };
3741 //*************************************************************************************************
3742 
3743 } // namespace blaze
3744 
3745 #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
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: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.
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 declherm trait.
Flag for the inversion of a upper unitriangular matrix.
Definition: InversionFlag.h:114
Flag for the inversion of a lower unitriangular matrix.
Definition: InversionFlag.h:112
Header file for the IsDiagonal type trait.
Header file for the dense matrix inversion flags.
UniUpperMatrix specialization for sparse matrices.
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
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
Header file for the YieldsIdentity type trait.
constexpr bool IsUniUpper_v
Auxiliary variable template for the IsUniUpper type trait.The IsUniUpper_v variable template provides...
Definition: IsUniUpper.h:173
#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
Header file for the MAYBE_UNUSED function template.
Header file for the IsIdentity type trait.
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
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.
Constraint on the data type.
Header file for the IsUniLower type trait.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is an identity matrix.
Definition: DenseMatrix.h:2433
Constraint on the data type.
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
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:779
Flag for the inversion of a upper triangular matrix.
Definition: InversionFlag.h:113
Constraint on the data type.
Header file for the LowType type trait.
Flag for the inversion of a lower triangular matrix.
Definition: InversionFlag.h:111
Header file for the multiplication trait.
Header file for the IsStrictlyUpper 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
Flag for the LU-based matrix inversion.
Definition: InversionFlag.h:103
Header file for the IsShrinkable type trait.
constexpr bool YieldsUniUpper_v
Auxiliary variable template for the YieldsUniUpper type trait.The YieldsUniUpper_v variable template ...
Definition: YieldsUniUpper.h:124
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.
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:222
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.
#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
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:738
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.
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 isOne shim.
Constraint on the data type.
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.
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,...
Definition: Symmetric.h:79
Header file for run time assertion macros.
Header file for the addition trait.
Header file for the submatrix trait.
Constraint on the data type.
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.
#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:697
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_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
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
UniUpperMatrix specialization for dense matrices.
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
#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,...
Definition: Hermitian.h:79
Header file for the YieldsUniUpper type trait.
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
Header file for the Size type trait.
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,...
Definition: Assert.h:101
Header file for the implementation of the base template of the UniUpperMatrix.
Header file for the HighType type trait.