Blaze  3.6
UniLowerMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_UNILOWERMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_UNILOWERMATRIX_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>
96 #include <blaze/util/Assert.h>
97 #include <blaze/util/EnableIf.h>
99 #include <blaze/util/MaybeUnused.h>
101 
102 
103 namespace blaze {
104 
105 //=================================================================================================
106 //
107 // UNILOWERMATRIX OPERATORS
108 //
109 //=================================================================================================
110 
111 //*************************************************************************************************
114 template< typename MT, bool SO, bool DF >
115 void reset( UniLowerMatrix<MT,SO,DF>& m );
116 
117 template< typename MT, bool SO, bool DF >
118 void reset( UniLowerMatrix<MT,SO,DF>& m, size_t i );
119 
120 template< typename MT, bool SO, bool DF >
121 void clear( UniLowerMatrix<MT,SO,DF>& m );
122 
123 template< bool RF, typename MT, bool SO, bool DF >
124 bool isDefault( const UniLowerMatrix<MT,SO,DF>& m );
125 
126 template< typename MT, bool SO, bool DF >
127 bool isIntact( const UniLowerMatrix<MT,SO,DF>& m );
128 
129 template< typename MT, bool SO, bool DF >
130 void swap( UniLowerMatrix<MT,SO,DF>& a, UniLowerMatrix<MT,SO,DF>& b ) noexcept;
132 //*************************************************************************************************
133 
134 
135 //*************************************************************************************************
142 template< typename MT // Type of the adapted matrix
143  , bool SO // Storage order of the adapted matrix
144  , bool DF > // Density flag
146 {
147  m.reset();
148 }
149 //*************************************************************************************************
150 
151 
152 //*************************************************************************************************
165 template< typename MT // Type of the adapted matrix
166  , bool SO // Storage order of the adapted matrix
167  , bool DF > // Density flag
168 inline void reset( UniLowerMatrix<MT,SO,DF>& m, size_t i )
169 {
170  m.reset( i );
171 }
172 //*************************************************************************************************
173 
174 
175 //*************************************************************************************************
182 template< typename MT // Type of the adapted matrix
183  , bool SO // Storage order of the adapted matrix
184  , bool DF > // Density flag
186 {
187  m.clear();
188 }
189 //*************************************************************************************************
190 
191 
192 //*************************************************************************************************
202 template< bool RF // Relaxation flag
203  , typename MT // Type of the adapted matrix
204  , bool SO // Storage order of the adapted matrix
205  , bool DF > // Density flag
206 inline bool isDefault_backend( const UniLowerMatrix<MT,SO,DF>& m, TrueType )
207 {
208  return ( m.rows() == 0UL );
209 }
211 //*************************************************************************************************
212 
213 
214 //*************************************************************************************************
224 template< bool RF // Relaxation flag
225  , typename MT // Type of the adapted matrix
226  , bool SO // Storage order of the adapted matrix
227  , bool DF > // Density flag
228 inline bool isDefault_backend( const UniLowerMatrix<MT,SO,DF>& m, FalseType )
229 {
230  return isIdentity<RF>( m );
231 }
233 //*************************************************************************************************
234 
235 
236 //*************************************************************************************************
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 UniLowerMatrix<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 UniLowerMatrix<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( UniLowerMatrix<MT,SO,true>& m )
349 {
351 
352  if( IF == asUpper || IF == asUniUpper ) {
353  BLAZE_INTERNAL_ASSERT( isIdentity( m ), "Violation of preconditions detected" );
354  return;
355  }
356 
357  constexpr InversionFlag flag( ( IF == byLU || IF == asGeneral || IF == asLower || IF == asUniLower )
358  ? ( asUniLower )
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 UniLowerMatrix<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 ET3 = ElementType_t<MT3>;
405  using ET4 = ElementType_t<MT4>;
406 
407  const size_t n( (~A).rows() );
408 
409  decltype(auto) U2( derestrict( ~U ) );
410 
411  (~L) = A;
412 
413  resize( ~U, n, n );
414  reset( U2 );
415 
416  resize( ~P, n, n );
417  reset( ~P );
418 
419  for( size_t i=0UL; i<n; ++i ) {
420  U2(i,i) = ET3(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 UniLowerMatrix<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 UniLowerMatrix<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  ( row >= column + n ) ||
498  ( ( column >= row + m ) && 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 UniLowerMatrix<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 UniLowerMatrix<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  ( row >= column + n ) ||
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 UniLowerMatrix<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 UniLowerMatrix<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 UniLowerMatrix<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 UniLowerMatrix<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  ( row >= column + n ) ||
706  ( column >= row + m ) ||
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 UniLowerMatrix<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 UniLowerMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
765 {
766  return tryMult( mat, row, column, m, n, value );
767 }
769 //*************************************************************************************************
770 
771 
772 //*************************************************************************************************
788 template< typename MT // Type of the adapted matrix
789  , bool SO // Storage order of the adapted matrix
790  , bool DF > // Density flag
791 inline bool tryShift( const UniLowerMatrix<MT,SO,DF>& mat, size_t i, size_t j, int count )
792 {
793  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
794  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
795 
796  MAYBE_UNUSED( mat );
797 
798  return ( i != j || isDefault( count ) );
799 }
801 //*************************************************************************************************
802 
803 
804 //*************************************************************************************************
822 template< typename MT // Type of the adapted matrix
823  , bool SO // Storage order of the adapted matrix
824  , bool DF > // Density flag
826  tryShift( const UniLowerMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, int count )
827 {
828  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
829  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
830  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
831  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
832 
833  MAYBE_UNUSED( mat );
834 
835  return ( m == 0UL ) ||
836  ( n == 0UL ) ||
837  ( row >= column + n ) ||
838  ( column >= row + m ) ||
839  isDefault( count );
840 }
842 //*************************************************************************************************
843 
844 
845 //*************************************************************************************************
861 template< typename MT // Type of the adapted matrix
862  , bool SO // Storage order of the adapted matrix
863  , bool DF // Density flag
864  , typename ET > // Type of the element
865 inline bool tryBitand( const UniLowerMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
866 {
867  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
868  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
869 
870  MAYBE_UNUSED( mat );
871 
872  return ( i != j ) || ( ElementType_t<MT>(1) & value );
873 }
875 //*************************************************************************************************
876 
877 
878 //*************************************************************************************************
896 template< typename MT // Type of the adapted matrix
897  , bool SO // Storage order of the adapted matrix
898  , bool DF // Density flag
899  , typename ET > // Type of the element
901  tryBitand( const UniLowerMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
902 {
903  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
904  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
905  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
906  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
907 
908  MAYBE_UNUSED( mat );
909 
910  return ( m == 0UL ) ||
911  ( n == 0UL ) ||
912  ( row >= column + n ) ||
913  ( column >= row + m ) ||
914  ( ElementType_t<MT>(1) & value );
915 }
917 //*************************************************************************************************
918 
919 
920 //*************************************************************************************************
936 template< typename MT // Type of the adapted matrix
937  , bool SO // Storage order of the adapted matrix
938  , bool DF // Density flag
939  , typename ET > // Type of the element
940 inline bool tryBitor( const UniLowerMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
941 {
942  return trySet( mat, i, j, value );
943 }
945 //*************************************************************************************************
946 
947 
948 //*************************************************************************************************
966 template< typename MT // Type of the adapted matrix
967  , bool SO // Storage order of the adapted matrix
968  , bool DF // Density flag
969  , typename ET > // Type of the element
971  tryBitor( const UniLowerMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
972 {
973  return trySet( mat, row, column, m, n, value );
974 }
976 //*************************************************************************************************
977 
978 
979 //*************************************************************************************************
995 template< typename MT // Type of the adapted matrix
996  , bool SO // Storage order of the adapted matrix
997  , bool DF // Density flag
998  , typename ET > // Type of the element
999 inline bool tryBitxor( const UniLowerMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
1000 {
1001  return tryAdd( mat, i, j, value );
1002 }
1004 //*************************************************************************************************
1005 
1006 
1007 //*************************************************************************************************
1025 template< typename MT // Type of the adapted matrix
1026  , bool SO // Storage order of the adapted matrix
1027  , bool DF // Density flag
1028  , typename ET > // Type of the element
1030  tryBitxor( const UniLowerMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
1031 {
1032  return tryAdd( mat, row, column, m, n, value );
1033 }
1035 //*************************************************************************************************
1036 
1037 
1038 //*************************************************************************************************
1054 template< typename MT // Type of the adapted matrix
1055  , bool SO // Storage order of the adapted matrix
1056  , bool DF // Density flag
1057  , typename VT > // Type of the right-hand side dense vector
1058 inline bool tryAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1059  const DenseVector<VT,false>& rhs, size_t row, size_t column )
1060 {
1062 
1063  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1064  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1065  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1066 
1067  MAYBE_UNUSED( lhs );
1068 
1069  if( column < row )
1070  return true;
1071 
1072  const bool containsDiagonal( column < row + (~rhs).size() );
1073  const size_t iend( min( column - row, (~rhs).size() ) );
1074 
1075  for( size_t i=0UL; i<iend; ++i ) {
1076  if( !isDefault( (~rhs)[i] ) )
1077  return false;
1078  }
1079 
1080  if( containsDiagonal && !isOne( (~rhs)[iend] ) )
1081  return false;
1082 
1083  return true;
1084 }
1086 //*************************************************************************************************
1087 
1088 
1089 //*************************************************************************************************
1105 template< typename MT // Type of the adapted matrix
1106  , bool SO // Storage order of the adapted matrix
1107  , bool DF // Density flag
1108  , typename VT > // Type of the right-hand side dense vector
1109 inline bool tryAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1110  const DenseVector<VT,true>& rhs, size_t row, size_t column )
1111 {
1113 
1114  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1115  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1116  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1117 
1118  MAYBE_UNUSED( lhs );
1119 
1120  if( row >= column + (~rhs).size() )
1121  return true;
1122 
1123  const bool containsDiagonal( row >= column );
1124  const size_t ibegin( ( !containsDiagonal )?( 0UL ):( row - column + 1UL ) );
1125 
1126  if( containsDiagonal && !isOne( (~rhs)[row-column] ) )
1127  return false;
1128 
1129  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
1130  if( !isDefault( (~rhs)[i] ) )
1131  return false;
1132  }
1133 
1134  return true;
1135 }
1137 //*************************************************************************************************
1138 
1139 
1140 //*************************************************************************************************
1158 template< typename MT // Type of the adapted matrix
1159  , bool SO // Storage order of the adapted matrix
1160  , bool DF // Density flag
1161  , typename VT // Type of the right-hand side dense vector
1162  , bool TF > // Transpose flag of the right-hand side dense vector
1163 inline bool tryAssign( const UniLowerMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
1164  ptrdiff_t band, size_t row, size_t column )
1165 {
1167 
1168  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1169  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1170  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1171  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1172 
1173  MAYBE_UNUSED( lhs, row, column );
1174 
1175  if( band == 0L ) {
1176  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
1177  if( !isOne( (~rhs)[i] ) )
1178  return false;
1179  }
1180  }
1181  else if( band > 0L ) {
1182  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
1183  if( !isDefault( (~rhs)[i] ) )
1184  return false;
1185  }
1186  }
1187 
1188  return true;
1189 }
1191 //*************************************************************************************************
1192 
1193 
1194 //*************************************************************************************************
1210 template< typename MT // Type of the adapted matrix
1211  , bool SO // Storage order of the adapted matrix
1212  , bool DF // Density flag
1213  , typename VT > // Type of the right-hand side sparse vector
1214 inline bool tryAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1215  const SparseVector<VT,false>& rhs, size_t row, size_t column )
1216 {
1218 
1219  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1220  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1221  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1222 
1223  MAYBE_UNUSED( lhs );
1224 
1225  if( column < row )
1226  return true;
1227 
1228  const bool containsDiagonal( column < row + (~rhs).size() );
1229  const size_t index( column - row );
1230  const auto last( (~rhs).lowerBound( index ) );
1231 
1232  if( containsDiagonal ) {
1233  if( last == (~rhs).end() || last->index() != index || !isOne( last->value() ) )
1234  return false;
1235  }
1236 
1237  for( auto element=(~rhs).begin(); element!=last; ++element ) {
1238  if( !isDefault( element->value() ) )
1239  return false;
1240  }
1241 
1242  return true;
1243 }
1245 //*************************************************************************************************
1246 
1247 
1248 //*************************************************************************************************
1264 template< typename MT // Type of the adapted matrix
1265  , bool SO // Storage order of the adapted matrix
1266  , bool DF // Density flag
1267  , typename VT > // Type of the right-hand side sparse vector
1268 inline bool tryAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1269  const SparseVector<VT,true>& rhs, size_t row, size_t column )
1270 {
1272 
1273  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1274  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1275  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1276 
1277  MAYBE_UNUSED( lhs );
1278 
1279  if( row >= column + (~rhs).size() )
1280  return true;
1281 
1282  const bool containsDiagonal( row >= column );
1283  const size_t index( ( containsDiagonal )?( row - column ):( 0UL ) );
1284  const auto last( (~rhs).end() );
1285  auto element( (~rhs).lowerBound( index ) );
1286 
1287  if( containsDiagonal ) {
1288  if( element == last || element->index() != index || !isOne( element->value() ) )
1289  return false;
1290  ++element;
1291  }
1292 
1293  for( ; element!=last; ++element ) {
1294  if( !isDefault( element->value() ) )
1295  return false;
1296  }
1297 
1298  return true;
1299 }
1301 //*************************************************************************************************
1302 
1303 
1304 //*************************************************************************************************
1322 template< typename MT // Type of the adapted matrix
1323  , bool SO // Storage order of the adapted matrix
1324  , bool DF // Density flag
1325  , typename VT // Type of the right-hand side sparse vector
1326  , bool TF > // Transpose flag of the right-hand side sparse vector
1327 inline bool tryAssign( const UniLowerMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
1328  ptrdiff_t band, size_t row, size_t column )
1329 {
1331 
1332  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1333  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1334  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1335  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1336 
1337  MAYBE_UNUSED( lhs, row, column );
1338 
1339  if( band == 0L ) {
1340  if( (~rhs).nonZeros() != (~rhs).size() )
1341  return false;
1342  for( const auto& element : ~rhs ) {
1343  if( !isOne( element.value() ) )
1344  return false;
1345  }
1346  }
1347  else if( band > 0L ) {
1348  for( const auto& element : ~rhs ) {
1349  if( !isDefault( element.value() ) )
1350  return false;
1351  }
1352  }
1353 
1354  return true;
1355 }
1357 //*************************************************************************************************
1358 
1359 
1360 //*************************************************************************************************
1376 template< typename MT1 // Type of the adapted matrix
1377  , bool SO // Storage order of the adapted matrix
1378  , bool DF // Density flag
1379  , typename MT2 > // Type of the right-hand side dense matrix
1380 inline bool tryAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
1381  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
1382 {
1384 
1385  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1386  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1387  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1388  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1389 
1390  MAYBE_UNUSED( lhs );
1391 
1392  const size_t M( (~rhs).rows() );
1393  const size_t N( (~rhs).columns() );
1394 
1395  if( row >= column + N )
1396  return true;
1397 
1398  const size_t iend( min( column + N - row, M ) );
1399 
1400  for( size_t i=0UL; i<iend; ++i )
1401  {
1402  const bool containsDiagonal( row + i >= column );
1403 
1404  if( containsDiagonal && !isOne( (~rhs)(i,row+i-column) ) )
1405  return false;
1406 
1407  const size_t jbegin( ( containsDiagonal )?( row + i - column + 1UL ):( 0UL ) );
1408 
1409  for( size_t j=jbegin; j<N; ++j ) {
1410  if( !isDefault( (~rhs)(i,j) ) )
1411  return false;
1412  }
1413  }
1414 
1415  return true;
1416 }
1418 //*************************************************************************************************
1419 
1420 
1421 //*************************************************************************************************
1437 template< typename MT1 // Type of the adapted matrix
1438  , bool SO // Storage order of the adapted matrix
1439  , bool DF // Density flag
1440  , typename MT2 > // Type of the right-hand side dense matrix
1441 inline bool tryAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
1442  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
1443 {
1445 
1446  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1447  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1448  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1449  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1450 
1451  MAYBE_UNUSED( lhs );
1452 
1453  const size_t M( (~rhs).rows() );
1454  const size_t N( (~rhs).columns() );
1455 
1456  if( row >= column + N )
1457  return true;
1458 
1459  const size_t jbegin( ( row < column )?( 0UL ):( row - column ) );
1460 
1461  for( size_t j=jbegin; j<N; ++j )
1462  {
1463  const size_t iend( min( column + j - row, M ) );
1464 
1465  for( size_t i=0UL; i<iend; ++i ) {
1466  if( !isDefault( (~rhs)(i,j) ) )
1467  return false;
1468  }
1469 
1470  const bool containsDiagonal( column + j < row + M );
1471 
1472  if( containsDiagonal && !isOne( (~rhs)(iend,j) ) )
1473  return false;
1474  }
1475 
1476  return true;
1477 }
1479 //*************************************************************************************************
1480 
1481 
1482 //*************************************************************************************************
1498 template< typename MT1 // Type of the adapted matrix
1499  , bool SO // Storage order of the adapted matrix
1500  , bool DF // Density flag
1501  , typename MT2 > // Type of the right-hand side sparse matrix
1502 inline bool tryAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
1503  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
1504 {
1506 
1507  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1508  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1509  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1510  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1511 
1512  MAYBE_UNUSED( lhs );
1513 
1514  const size_t M( (~rhs).rows() );
1515  const size_t N( (~rhs).columns() );
1516 
1517  if( row >= column + N )
1518  return true;
1519 
1520  const size_t iend( min( column + N - row, M ) );
1521 
1522  for( size_t i=0UL; i<iend; ++i )
1523  {
1524  const bool containsDiagonal( row + i >= column );
1525  const size_t index( ( containsDiagonal )?( row + i - column ):( 0UL ) );
1526 
1527  const auto last( (~rhs).end(i) );
1528  auto element( (~rhs).lowerBound( i, index ) );
1529 
1530  if( containsDiagonal ) {
1531  if( element == last || ( element->index() != index ) || !isOne( element->value() ) )
1532  return false;
1533  ++element;
1534  }
1535 
1536  for( ; element!=last; ++element ) {
1537  if( !isDefault( element->value() ) )
1538  return false;
1539  }
1540  }
1541 
1542  return true;
1543 }
1545 //*************************************************************************************************
1546 
1547 
1548 //*************************************************************************************************
1564 template< typename MT1 // Type of the adapted matrix
1565  , bool SO // Storage order of the adapted matrix
1566  , bool DF // Density flag
1567  , typename MT2 > // Type of the right-hand side sparse matrix
1568 inline bool tryAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
1569  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
1570 {
1572 
1573  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1574  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1575  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1576  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1577 
1578  MAYBE_UNUSED( lhs );
1579 
1580  const size_t M( (~rhs).rows() );
1581  const size_t N( (~rhs).columns() );
1582 
1583  if( row >= column + N )
1584  return true;
1585 
1586  const size_t jbegin( ( row < column )?( 0UL ):( row - column ) );
1587 
1588  for( size_t j=jbegin; j<N; ++j )
1589  {
1590  const bool containsDiagonal( column + j < row + M );
1591 
1592  const size_t index( column + j - row );
1593  const auto last( (~rhs).lowerBound( min( index, M ), j ) );
1594 
1595  if( containsDiagonal ) {
1596  if( last == (~rhs).end(j) || ( last->index() != index ) || !isOne( last->value() ) )
1597  return false;
1598  }
1599 
1600  for( auto element=(~rhs).begin(j); element!=last; ++element ) {
1601  if( !isDefault( element->value() ) )
1602  return false;
1603  }
1604  }
1605 
1606  return true;
1607 }
1609 //*************************************************************************************************
1610 
1611 
1612 //*************************************************************************************************
1629 template< typename MT // Type of the adapted matrix
1630  , bool SO // Storage order of the adapted matrix
1631  , bool DF // Density flag
1632  , typename VT > // Type of the right-hand side dense vector
1633 inline bool tryAddAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1634  const DenseVector<VT,false>& rhs, size_t row, size_t column )
1635 {
1637 
1638  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1639  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1640  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1641 
1642  MAYBE_UNUSED( lhs );
1643 
1644  if( column < row )
1645  return true;
1646 
1647  const size_t iend( min( column - row + 1UL, (~rhs).size() ) );
1648 
1649  for( size_t i=0UL; i<iend; ++i ) {
1650  if( !isDefault( (~rhs)[i] ) )
1651  return false;
1652  }
1653 
1654  return true;
1655 }
1657 //*************************************************************************************************
1658 
1659 
1660 //*************************************************************************************************
1677 template< typename MT // Type of the adapted matrix
1678  , bool SO // Storage order of the adapted matrix
1679  , bool DF // Density flag
1680  , typename VT > // Type of the right-hand side dense vector
1681 inline bool tryAddAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1682  const DenseVector<VT,true>& rhs, size_t row, size_t column )
1683 {
1685 
1686  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1687  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1688  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1689 
1690  MAYBE_UNUSED( lhs );
1691 
1692  const size_t ibegin( ( row <= column )?( 0UL ):( row - column ) );
1693 
1694  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
1695  if( !isDefault( (~rhs)[i] ) )
1696  return false;
1697  }
1698 
1699  return true;
1700 }
1702 //*************************************************************************************************
1703 
1704 
1705 //*************************************************************************************************
1722 template< typename MT // Type of the adapted matrix
1723  , bool SO // Storage order of the adapted matrix
1724  , bool DF // Density flag
1725  , typename VT // Type of the right-hand side dense vector
1726  , bool TF > // Transpose flag of the right-hand side dense vector
1727 inline bool tryAddAssign( const UniLowerMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
1728  ptrdiff_t band, size_t row, size_t column )
1729 {
1731 
1732  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1733  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1734  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1735  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1736 
1737  MAYBE_UNUSED( lhs, row, column );
1738 
1739  if( band >= 0L ) {
1740  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
1741  if( !isDefault( (~rhs)[i] ) )
1742  return false;
1743  }
1744  }
1745 
1746  return true;
1747 }
1749 //*************************************************************************************************
1750 
1751 
1752 //*************************************************************************************************
1769 template< typename MT // Type of the adapted matrix
1770  , bool SO // Storage order of the adapted matrix
1771  , bool DF // Density flag
1772  , typename VT > // Type of the right-hand side sparse vector
1773 inline bool tryAddAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1774  const SparseVector<VT,false>& rhs, size_t row, size_t column )
1775 {
1777 
1778  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1779  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1780  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1781 
1782  MAYBE_UNUSED( lhs );
1783 
1784  if( column < row )
1785  return true;
1786 
1787  const auto last( (~rhs).lowerBound( column - row + 1UL ) );
1788 
1789  for( auto element=(~rhs).begin(); element!=last; ++element ) {
1790  if( !isDefault( element->value() ) )
1791  return false;
1792  }
1793 
1794  return true;
1795 }
1797 //*************************************************************************************************
1798 
1799 
1800 //*************************************************************************************************
1817 template< typename MT // Type of the adapted matrix
1818  , bool SO // Storage order of the adapted matrix
1819  , bool DF // Density flag
1820  , typename VT > // Type of the right-hand side sparse vector
1821 inline bool tryAddAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1822  const SparseVector<VT,true>& rhs, size_t row, size_t column )
1823 {
1825 
1826  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1827  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1828  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1829 
1830  MAYBE_UNUSED( lhs );
1831 
1832  const auto last( (~rhs).end() );
1833  auto element( (~rhs).lowerBound( ( row <= column )?( 0UL ):( row - column ) ) );
1834 
1835  for( ; element!=last; ++element ) {
1836  if( !isDefault( element->value() ) )
1837  return false;
1838  }
1839 
1840  return true;
1841 }
1843 //*************************************************************************************************
1844 
1845 
1846 //*************************************************************************************************
1863 template< typename MT // Type of the adapted matrix
1864  , bool SO // Storage order of the adapted matrix
1865  , bool DF // Density flag
1866  , typename VT // Type of the right-hand side sparse vector
1867  , bool TF > // Transpose flag of the right-hand side sparse vector
1868 inline bool tryAddAssign( const UniLowerMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
1869  ptrdiff_t band, size_t row, size_t column )
1870 {
1872 
1873  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1874  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1875  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1876  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1877 
1878  MAYBE_UNUSED( lhs, row, column );
1879 
1880  if( band >= 0L ) {
1881  for( const auto& element : ~rhs ) {
1882  if( !isDefault( element.value() ) )
1883  return false;
1884  }
1885  }
1886 
1887  return true;
1888 }
1890 //*************************************************************************************************
1891 
1892 
1893 //*************************************************************************************************
1910 template< typename MT1 // Type of the adapted matrix
1911  , bool SO // Storage order of the adapted matrix
1912  , bool DF // Density flag
1913  , typename MT2 > // Type of the right-hand side dense matrix
1914 inline bool tryAddAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
1915  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
1916 {
1918 
1919  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1920  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1921  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1922  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1923 
1924  MAYBE_UNUSED( lhs );
1925 
1926  const size_t M( (~rhs).rows() );
1927  const size_t N( (~rhs).columns() );
1928 
1929  if( row >= column + N )
1930  return true;
1931 
1932  const size_t iend( min( column + N - row, M ) );
1933 
1934  for( size_t i=0UL; i<iend; ++i )
1935  {
1936  const bool containsDiagonal( row + i >= column );
1937  const size_t jbegin( ( containsDiagonal )?( row + i - column ):( 0UL ) );
1938 
1939  for( size_t j=jbegin; j<N; ++j ) {
1940  if( !isDefault( (~rhs)(i,j) ) )
1941  return false;
1942  }
1943  }
1944 
1945  return true;
1946 }
1948 //*************************************************************************************************
1949 
1950 
1951 //*************************************************************************************************
1968 template< typename MT1 // Type of the adapted matrix
1969  , bool SO // Storage order of the adapted matrix
1970  , bool DF // Density flag
1971  , typename MT2 > // Type of the right-hand side dense matrix
1972 inline bool tryAddAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
1973  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
1974 {
1976 
1977  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1978  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1979  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1980  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1981 
1982  MAYBE_UNUSED( lhs );
1983 
1984  const size_t M( (~rhs).rows() );
1985  const size_t N( (~rhs).columns() );
1986 
1987  if( row >= column + N )
1988  return true;
1989 
1990  const size_t jbegin( ( row <= column )?( 0UL ):( row - column ) );
1991 
1992  for( size_t j=jbegin; j<N; ++j )
1993  {
1994  const size_t iend( min( column + j - row + 1UL, M ) );
1995 
1996  for( size_t i=0UL; i<iend; ++i ) {
1997  if( !isDefault( (~rhs)(i,j) ) )
1998  return false;
1999  }
2000  }
2001 
2002  return true;
2003 }
2005 //*************************************************************************************************
2006 
2007 
2008 //*************************************************************************************************
2025 template< typename MT1 // Type of the adapted matrix
2026  , bool SO // Storage order of the adapted matrix
2027  , bool DF // Density flag
2028  , typename MT2 > // Type of the right-hand side sparse matrix
2029 inline bool tryAddAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
2030  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
2031 {
2033 
2034  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2035  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2036  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
2037  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
2038 
2039  MAYBE_UNUSED( lhs );
2040 
2041  const size_t M( (~rhs).rows() );
2042  const size_t N( (~rhs).columns() );
2043 
2044  if( row >= column + N )
2045  return true;
2046 
2047  const size_t iend( min( column + N - row, M ) );
2048 
2049  for( size_t i=0UL; i<iend; ++i )
2050  {
2051  const bool containsDiagonal( row + i >= column );
2052  const size_t index( ( containsDiagonal )?( row + i - column ):( 0UL ) );
2053 
2054  const auto last( (~rhs).end(i) );
2055  auto element( (~rhs).lowerBound( i, index ) );
2056 
2057  for( ; element!=last; ++element ) {
2058  if( !isDefault( element->value() ) )
2059  return false;
2060  }
2061  }
2062 
2063  return true;
2064 }
2066 //*************************************************************************************************
2067 
2068 
2069 //*************************************************************************************************
2086 template< typename MT1 // Type of the adapted matrix
2087  , bool SO // Storage order of the adapted matrix
2088  , bool DF // Density flag
2089  , typename MT2 > // Type of the right-hand side sparse matrix
2090 inline bool tryAddAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
2091  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
2092 {
2094 
2095  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2096  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2097  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
2098  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
2099 
2100  MAYBE_UNUSED( lhs );
2101 
2102  const size_t M( (~rhs).rows() );
2103  const size_t N( (~rhs).columns() );
2104 
2105  if( row >= column + N )
2106  return true;
2107 
2108  const size_t jbegin( ( row < column )?( 0UL ):( row - column ) );
2109 
2110  for( size_t j=jbegin; j<N; ++j )
2111  {
2112  const size_t index( column + j - row + 1UL );
2113  const auto last( (~rhs).lowerBound( min( index, M ), j ) );
2114 
2115  for( auto element=(~rhs).begin(j); element!=last; ++element ) {
2116  if( !isDefault( element->value() ) )
2117  return false;
2118  }
2119  }
2120 
2121  return true;
2122 }
2124 //*************************************************************************************************
2125 
2126 
2127 //*************************************************************************************************
2144 template< typename MT // Type of the adapted matrix
2145  , bool SO // Storage order of the adapted matrix
2146  , bool DF // Density flag
2147  , typename VT // Type of the right-hand side vector
2148  , bool TF > // Transpose flag of the right-hand side vector
2149 inline bool trySubAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
2150  const Vector<VT,TF>& rhs, size_t row, size_t column )
2151 {
2152  return tryAddAssign( lhs, ~rhs, row, column );
2153 }
2155 //*************************************************************************************************
2156 
2157 
2158 //*************************************************************************************************
2176 template< typename MT // Type of the adapted matrix
2177  , bool SO // Storage order of the adapted matrix
2178  , bool DF // Density flag
2179  , typename VT // Type of the right-hand side vector
2180  , bool TF > // Transpose flag of the right-hand side vector
2181 inline bool trySubAssign( const UniLowerMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
2182  ptrdiff_t band, size_t row, size_t column )
2183 {
2184  return tryAddAssign( lhs, ~rhs, band, row, column );
2185 }
2187 //*************************************************************************************************
2188 
2189 
2190 //*************************************************************************************************
2207 template< typename MT1 // Type of the adapted matrix
2208  , bool SO1 // Storage order of the adapted matrix
2209  , bool DF // Density flag
2210  , typename MT2 // Type of the right-hand side matrix
2211  , bool SO2 > // Storage order of the right-hand side matrix
2212 inline bool trySubAssign( const UniLowerMatrix<MT1,SO1,DF>& lhs,
2213  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
2214 {
2215  return tryAddAssign( lhs, ~rhs, row, column );
2216 }
2218 //*************************************************************************************************
2219 
2220 
2221 //*************************************************************************************************
2238 template< typename MT // Type of the adapted matrix
2239  , bool SO // Storage order of the adapted matrix
2240  , bool DF // Density flag
2241  , typename VT > // Type of the right-hand side vector
2242 inline bool tryMultAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
2243  const Vector<VT,false>& rhs, size_t row, size_t column )
2244 {
2246 
2247  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2248  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2249  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2250 
2251  MAYBE_UNUSED( lhs );
2252 
2253  return ( column < row ) ||
2254  ( (~rhs).size() <= column - row ) ||
2255  isOne( (~rhs)[column-row] );
2256 }
2258 //*************************************************************************************************
2259 
2260 
2261 //*************************************************************************************************
2278 template< typename MT // Type of the adapted matrix
2279  , bool SO // Storage order of the adapted matrix
2280  , bool DF // Density flag
2281  , typename VT > // Type of the right-hand side vector
2282 inline bool tryMultAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
2283  const Vector<VT,true>& rhs, size_t row, size_t column )
2284 {
2286 
2287  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2288  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2289  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2290 
2291  MAYBE_UNUSED( lhs );
2292 
2293  return ( row < column ) ||
2294  ( (~rhs).size() <= row - column ) ||
2295  isOne( (~rhs)[row-column] );
2296 }
2298 //*************************************************************************************************
2299 
2300 
2301 //*************************************************************************************************
2318 template< typename MT // Type of the adapted matrix
2319  , bool SO // Storage order of the adapted matrix
2320  , bool DF // Density flag
2321  , typename VT // Type of the right-hand side dense vector
2322  , bool TF > // Transpose flag of the right-hand side dense vector
2323 inline bool tryMultAssign( const UniLowerMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
2324  ptrdiff_t band, size_t row, size_t column )
2325 {
2327 
2328  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2329  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2330  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2331  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2332 
2333  MAYBE_UNUSED( lhs, row, column );
2334 
2335  if( band == 0L ) {
2336  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
2337  if( !isOne( (~rhs)[i] ) )
2338  return false;
2339  }
2340  }
2341 
2342  return true;
2343 }
2345 //*************************************************************************************************
2346 
2347 
2348 //*************************************************************************************************
2365 template< typename MT // Type of the adapted matrix
2366  , bool SO // Storage order of the adapted matrix
2367  , bool DF // Density flag
2368  , typename VT // Type of the right-hand side sparse vector
2369  , bool TF > // Transpose flag of the right-hand side sparse vector
2370 inline bool tryMultAssign( const UniLowerMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
2371  ptrdiff_t band, size_t row, size_t column )
2372 {
2374 
2375  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2376  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2377  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2378  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2379 
2380  MAYBE_UNUSED( lhs, row, column );
2381 
2382  if( band == 0L ) {
2383  if( (~rhs).nonZeros() != (~rhs).size() )
2384  return false;
2385  for( const auto& element : ~rhs ) {
2386  if( !isOne( element.value() ) )
2387  return false;
2388  }
2389  }
2390 
2391  return true;
2392 }
2394 //*************************************************************************************************
2395 
2396 
2397 //*************************************************************************************************
2414 template< typename MT1 // Type of the adapted matrix
2415  , bool SO1 // Storage order of the adapted matrix
2416  , bool DF // Density flag
2417  , typename MT2 // Type of the right-hand side matrix
2418  , bool SO2 > // Storage order of the right-hand side matrix
2419 inline bool trySchurAssign( const UniLowerMatrix<MT1,SO1,DF>& lhs,
2420  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
2421 {
2423 
2424  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2425  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2426  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
2427  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
2428 
2429  MAYBE_UNUSED( lhs );
2430 
2431  const size_t M( (~rhs).rows() );
2432  const size_t N( (~rhs).columns() );
2433 
2434  if( ( row >= column + N ) || ( column >= row + M ) )
2435  return true;
2436 
2437  size_t i( row < column ? column - row : 0UL );
2438  size_t j( column < row ? row - column : 0UL );
2439 
2440  for( ; i<M && j<N; ++i, ++j )
2441  {
2442  if( !isOne( (~rhs)(i,j) ) )
2443  return false;
2444  }
2445 
2446  return true;
2447 }
2449 //*************************************************************************************************
2450 
2451 
2452 //*************************************************************************************************
2468 template< typename MT // Type of the adapted matrix
2469  , bool SO // Storage order of the adapted matrix
2470  , bool DF // Density flag
2471  , typename VT // Type of the right-hand side vector
2472  , bool TF > // Transpose flag of the right-hand side vector
2473 inline bool tryDivAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
2474  const Vector<VT,TF>& rhs, size_t row, size_t column )
2475 {
2476  return tryMultAssign( lhs, ~rhs, row, column );
2477 }
2479 //*************************************************************************************************
2480 
2481 
2482 //*************************************************************************************************
2499 template< typename MT // Type of the adapted matrix
2500  , bool SO // Storage order of the adapted matrix
2501  , bool DF // Density flag
2502  , typename VT // Type of the right-hand side vector
2503  , bool TF > // Transpose flag of the right-hand side vector
2504 inline bool tryDivAssign( const UniLowerMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
2505  ptrdiff_t band, size_t row, size_t column )
2506 {
2507  return tryMultAssign( lhs, ~rhs, band, row, column );
2508 }
2510 //*************************************************************************************************
2511 
2512 
2513 //*************************************************************************************************
2529 template< typename MT // Type of the adapted matrix
2530  , bool SO // Storage order of the adapted matrix
2531  , bool DF // Density flag
2532  , typename VT > // Type of the right-hand side vector
2533 inline bool tryShiftAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
2534  const Vector<VT,false>& rhs, size_t row, size_t column )
2535 {
2537 
2538  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2539  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2540  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2541 
2542  MAYBE_UNUSED( lhs );
2543 
2544  return ( column < row ) ||
2545  ( (~rhs).size() <= column - row ) ||
2546  isDefault( (~rhs)[column-row] );
2547 }
2549 //*************************************************************************************************
2550 
2551 
2552 //*************************************************************************************************
2568 template< typename MT // Type of the adapted matrix
2569  , bool SO // Storage order of the adapted matrix
2570  , bool DF // Density flag
2571  , typename VT > // Type of the right-hand side vector
2572 inline bool tryShiftAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
2573  const Vector<VT,true>& rhs, size_t row, size_t column )
2574 {
2576 
2577  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2578  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2579  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2580 
2581  MAYBE_UNUSED( lhs );
2582 
2583  return ( row < column ) ||
2584  ( (~rhs).size() <= row - column ) ||
2585  isDefault( (~rhs)[row-column] );
2586 }
2588 //*************************************************************************************************
2589 
2590 
2591 //*************************************************************************************************
2608 template< typename MT // Type of the adapted matrix
2609  , bool SO // Storage order of the adapted matrix
2610  , bool DF // Density flag
2611  , typename VT // Type of the right-hand side dense vector
2612  , bool TF > // Transpose flag of the right-hand side dense vector
2613 inline bool tryShiftAssign( const UniLowerMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
2614  ptrdiff_t band, size_t row, size_t column )
2615 {
2617 
2618  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2619  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2620  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2621  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2622 
2623  MAYBE_UNUSED( lhs, row, column );
2624 
2625  if( band == 0L ) {
2626  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
2627  if( !isDefault( (~rhs)[i] ) )
2628  return false;
2629  }
2630  }
2631 
2632  return true;
2633 }
2635 //*************************************************************************************************
2636 
2637 
2638 //*************************************************************************************************
2655 template< typename MT // Type of the adapted matrix
2656  , bool SO // Storage order of the adapted matrix
2657  , bool DF // Density flag
2658  , typename VT // Type of the right-hand side sparse vector
2659  , bool TF > // Transpose flag of the right-hand side sparse vector
2660 inline bool tryShiftAssign( const UniLowerMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
2661  ptrdiff_t band, size_t row, size_t column )
2662 {
2664 
2665  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2666  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2667  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2668  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2669 
2670  MAYBE_UNUSED( lhs, row, column );
2671 
2672  if( band == 0L ) {
2673  if( (~rhs).nonZeros() != (~rhs).size() )
2674  return false;
2675  for( const auto& element : ~rhs ) {
2676  if( !isDefault( element.value() ) )
2677  return false;
2678  }
2679  }
2680 
2681  return true;
2682 }
2684 //*************************************************************************************************
2685 
2686 
2687 //*************************************************************************************************
2703 template< typename MT1 // Type of the adapted matrix
2704  , bool SO1 // Storage order of the adapted matrix
2705  , bool DF // Density flag
2706  , typename MT2 // Type of the right-hand side matrix
2707  , bool SO2 > // Storage order of the right-hand side matrix
2708 inline bool tryShiftAssign( const UniLowerMatrix<MT1,SO1,DF>& lhs,
2709  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
2710 {
2712 
2713  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2714  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2715  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
2716  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
2717 
2718  MAYBE_UNUSED( lhs );
2719 
2720  const size_t M( (~rhs).rows() );
2721  const size_t N( (~rhs).columns() );
2722 
2723  if( ( row >= column + N ) || ( column >= row + M ) )
2724  return true;
2725 
2726  size_t i( row < column ? column - row : 0UL );
2727  size_t j( column < row ? row - column : 0UL );
2728 
2729  for( ; i<M && j<N; ++i, ++j )
2730  {
2731  if( !isDefault( (~rhs)(i,j) ) )
2732  return false;
2733  }
2734 
2735  return true;
2736 }
2738 //*************************************************************************************************
2739 
2740 
2741 //*************************************************************************************************
2758 template< typename MT // Type of the adapted matrix
2759  , bool SO // Storage order of the adapted matrix
2760  , bool DF // Density flag
2761  , typename VT > // Type of the right-hand side vector
2762 inline bool tryBitandAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
2763  const Vector<VT,false>& rhs, size_t row, size_t column )
2764 {
2766 
2767  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2768  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2769  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2770 
2771  MAYBE_UNUSED( lhs );
2772 
2773  return ( column < row ) ||
2774  ( (~rhs).size() <= column - row ) ||
2775  ( ElementType_t<MT>(1) & (~rhs)[column-row] );
2776 }
2778 //*************************************************************************************************
2779 
2780 
2781 //*************************************************************************************************
2798 template< typename MT // Type of the adapted matrix
2799  , bool SO // Storage order of the adapted matrix
2800  , bool DF // Density flag
2801  , typename VT > // Type of the right-hand side vector
2802 inline bool tryBitandAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
2803  const Vector<VT,true>& rhs, size_t row, size_t column )
2804 {
2806 
2807  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2808  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2809  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2810 
2811  MAYBE_UNUSED( lhs );
2812 
2813  return ( row < column ) ||
2814  ( (~rhs).size() <= row - column ) ||
2815  ( ElementType_t<MT>(1) & (~rhs)[row-column] );
2816 }
2818 //*************************************************************************************************
2819 
2820 
2821 //*************************************************************************************************
2838 template< typename MT // Type of the adapted matrix
2839  , bool SO // Storage order of the adapted matrix
2840  , bool DF // Density flag
2841  , typename VT // Type of the right-hand side dense vector
2842  , bool TF > // Transpose flag of the right-hand side dense vector
2843 inline bool tryBitandAssign( const UniLowerMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
2844  ptrdiff_t band, size_t row, size_t column )
2845 {
2847 
2848  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2849  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2850  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2851  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2852 
2853  MAYBE_UNUSED( lhs, row, column );
2854 
2855  if( band == 0L ) {
2856  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
2857  if( !( ElementType_t<MT>(1) & (~rhs)[i] ) )
2858  return false;
2859  }
2860  }
2861 
2862  return true;
2863 }
2865 //*************************************************************************************************
2866 
2867 
2868 //*************************************************************************************************
2885 template< typename MT // Type of the adapted matrix
2886  , bool SO // Storage order of the adapted matrix
2887  , bool DF // Density flag
2888  , typename VT // Type of the right-hand side sparse vector
2889  , bool TF > // Transpose flag of the right-hand side sparse vector
2890 inline bool tryBitandAssign( const UniLowerMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
2891  ptrdiff_t band, size_t row, size_t column )
2892 {
2894 
2895  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2896  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2897  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2898  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2899 
2900  MAYBE_UNUSED( lhs, row, column );
2901 
2902  if( band == 0L ) {
2903  if( (~rhs).nonZeros() != (~rhs).size() )
2904  return false;
2905  for( const auto& element : ~rhs ) {
2906  if( !( ElementType_t<MT>(1) & element.value() ) )
2907  return false;
2908  }
2909  }
2910 
2911  return true;
2912 }
2914 //*************************************************************************************************
2915 
2916 
2917 //*************************************************************************************************
2934 template< typename MT1 // Type of the adapted matrix
2935  , bool SO1 // Storage order of the adapted matrix
2936  , bool DF // Density flag
2937  , typename MT2 // Type of the right-hand side matrix
2938  , bool SO2 > // Storage order of the right-hand side matrix
2939 inline bool tryBitandAssign( const UniLowerMatrix<MT1,SO1,DF>& lhs,
2940  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
2941 {
2943 
2944  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2945  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2946  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
2947  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
2948 
2949  MAYBE_UNUSED( lhs );
2950 
2951  const size_t M( (~rhs).rows() );
2952  const size_t N( (~rhs).columns() );
2953 
2954  if( ( row >= column + N ) || ( column >= row + M ) )
2955  return true;
2956 
2957  size_t i( row < column ? column - row : 0UL );
2958  size_t j( column < row ? row - column : 0UL );
2959 
2960  for( ; i<M && j<N; ++i, ++j )
2961  {
2962  if( !( ElementType_t<MT1>(1) & (~rhs)(i,j) ) )
2963  return false;
2964  }
2965 
2966  return true;
2967 }
2969 //*************************************************************************************************
2970 
2971 
2972 //*************************************************************************************************
2989 template< typename MT // Type of the adapted matrix
2990  , bool SO // Storage order of the adapted matrix
2991  , bool DF // Density flag
2992  , typename VT // Type of the right-hand side vector
2993  , bool TF > // Transpose flag of the right-hand side vector
2994 inline bool tryBitorAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
2995  const Vector<VT,TF>& rhs, size_t row, size_t column )
2996 {
2997  return tryAssign( lhs, ~rhs, row, column );
2998 }
3000 //*************************************************************************************************
3001 
3002 
3003 //*************************************************************************************************
3020 template< typename MT // Type of the adapted matrix
3021  , bool SO // Storage order of the adapted matrix
3022  , bool DF // Density flag
3023  , typename VT // Type of the right-hand side vector
3024  , bool TF > // Transpose flag of the right-hand side vector
3025 inline bool tryBitorAssign( const UniLowerMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
3026  ptrdiff_t band, size_t row, size_t column )
3027 {
3028  return tryAssign( lhs, ~rhs, band, row, column );
3029 }
3031 //*************************************************************************************************
3032 
3033 
3034 //*************************************************************************************************
3051 template< typename MT1 // Type of the adapted matrix
3052  , bool SO1 // Storage order of the adapted matrix
3053  , bool DF // Density flag
3054  , typename MT2 // Type of the right-hand side matrix
3055  , bool SO2 > // Storage order of the right-hand side matrix
3056 inline bool tryBitorAssign( const UniLowerMatrix<MT1,SO1,DF>& lhs,
3057  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
3058 {
3059  return tryAssign( lhs, ~rhs, row, column );
3060 }
3062 //*************************************************************************************************
3063 
3064 
3065 //*************************************************************************************************
3082 template< typename MT // Type of the adapted matrix
3083  , bool SO // Storage order of the adapted matrix
3084  , bool DF // Density flag
3085  , typename VT // Type of the right-hand side vector
3086  , bool TF > // Transpose flag of the right-hand side vector
3087 inline bool tryBitxorAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
3088  const Vector<VT,TF>& rhs, size_t row, size_t column )
3089 {
3090  return tryAddAssign( lhs, ~rhs, row, column );
3091 }
3093 //*************************************************************************************************
3094 
3095 
3096 //*************************************************************************************************
3113 template< typename MT // Type of the adapted matrix
3114  , bool SO // Storage order of the adapted matrix
3115  , bool DF // Density flag
3116  , typename VT // Type of the right-hand side vector
3117  , bool TF > // Transpose flag of the right-hand side vector
3118 inline bool tryBitxorAssign( const UniLowerMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
3119  ptrdiff_t band, size_t row, size_t column )
3120 {
3121  return tryAddAssign( lhs, ~rhs, band, row, column );
3122 }
3124 //*************************************************************************************************
3125 
3126 
3127 //*************************************************************************************************
3144 template< typename MT1 // Type of the adapted matrix
3145  , bool SO1 // Storage order of the adapted matrix
3146  , bool DF // Density flag
3147  , typename MT2 // Type of the right-hand side matrix
3148  , bool SO2 > // Storage order of the right-hand side matrix
3149 inline bool tryBitxorAssign( const UniLowerMatrix<MT1,SO1,DF>& lhs,
3150  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
3151 {
3152  return tryAddAssign( lhs, ~rhs, row, column );
3153 }
3155 //*************************************************************************************************
3156 
3157 
3158 //*************************************************************************************************
3172 template< typename MT // Type of the adapted matrix
3173  , bool SO // Storage order of the adapted matrix
3174  , bool DF > // Density flag
3175 inline MT& derestrict( UniLowerMatrix<MT,SO,DF>& m )
3176 {
3177  return m.matrix_;
3178 }
3180 //*************************************************************************************************
3181 
3182 
3183 
3184 
3185 //=================================================================================================
3186 //
3187 // SIZE SPECIALIZATIONS
3188 //
3189 //=================================================================================================
3190 
3191 //*************************************************************************************************
3193 template< typename MT, bool SO, bool DF >
3194 struct Size< UniLowerMatrix<MT,SO,DF>, 0UL >
3195  : public Size<MT,0UL>
3196 {};
3197 
3198 template< typename MT, bool SO, bool DF >
3199 struct Size< UniLowerMatrix<MT,SO,DF>, 1UL >
3200  : public Size<MT,1UL>
3201 {};
3203 //*************************************************************************************************
3204 
3205 
3206 
3207 
3208 //=================================================================================================
3209 //
3210 // MAXSIZE SPECIALIZATIONS
3211 //
3212 //=================================================================================================
3213 
3214 //*************************************************************************************************
3216 template< typename MT, bool SO, bool DF >
3217 struct MaxSize< UniLowerMatrix<MT,SO,DF>, 0UL >
3218  : public MaxSize<MT,0UL>
3219 {};
3220 
3221 template< typename MT, bool SO, bool DF >
3222 struct MaxSize< UniLowerMatrix<MT,SO,DF>, 1UL >
3223  : public MaxSize<MT,1UL>
3224 {};
3226 //*************************************************************************************************
3227 
3228 
3229 
3230 
3231 //=================================================================================================
3232 //
3233 // ISSQUARE SPECIALIZATIONS
3234 //
3235 //=================================================================================================
3236 
3237 //*************************************************************************************************
3239 template< typename MT, bool SO, bool DF >
3240 struct IsSquare< UniLowerMatrix<MT,SO,DF> >
3241  : public TrueType
3242 {};
3244 //*************************************************************************************************
3245 
3246 
3247 
3248 
3249 //=================================================================================================
3250 //
3251 // ISUNILOWER SPECIALIZATIONS
3252 //
3253 //=================================================================================================
3254 
3255 //*************************************************************************************************
3257 template< typename MT, bool SO, bool DF >
3258 struct IsUniLower< UniLowerMatrix<MT,SO,DF> >
3259  : public TrueType
3260 {};
3262 //*************************************************************************************************
3263 
3264 
3265 
3266 
3267 //=================================================================================================
3268 //
3269 // ISADAPTOR SPECIALIZATIONS
3270 //
3271 //=================================================================================================
3272 
3273 //*************************************************************************************************
3275 template< typename MT, bool SO, bool DF >
3276 struct IsAdaptor< UniLowerMatrix<MT,SO,DF> >
3277  : public TrueType
3278 {};
3280 //*************************************************************************************************
3281 
3282 
3283 
3284 
3285 //=================================================================================================
3286 //
3287 // ISRESTRICTED SPECIALIZATIONS
3288 //
3289 //=================================================================================================
3290 
3291 //*************************************************************************************************
3293 template< typename MT, bool SO, bool DF >
3294 struct IsRestricted< UniLowerMatrix<MT,SO,DF> >
3295  : public TrueType
3296 {};
3298 //*************************************************************************************************
3299 
3300 
3301 
3302 
3303 //=================================================================================================
3304 //
3305 // HASCONSTDATAACCESS SPECIALIZATIONS
3306 //
3307 //=================================================================================================
3308 
3309 //*************************************************************************************************
3311 template< typename MT, bool SO >
3312 struct HasConstDataAccess< UniLowerMatrix<MT,SO,true> >
3313  : public TrueType
3314 {};
3316 //*************************************************************************************************
3317 
3318 
3319 
3320 
3321 //=================================================================================================
3322 //
3323 // ISALIGNED SPECIALIZATIONS
3324 //
3325 //=================================================================================================
3326 
3327 //*************************************************************************************************
3329 template< typename MT, bool SO, bool DF >
3330 struct IsAligned< UniLowerMatrix<MT,SO,DF> >
3331  : public IsAligned<MT>
3332 {};
3334 //*************************************************************************************************
3335 
3336 
3337 
3338 
3339 //=================================================================================================
3340 //
3341 // ISCONTIGUOUS SPECIALIZATIONS
3342 //
3343 //=================================================================================================
3344 
3345 //*************************************************************************************************
3347 template< typename MT, bool SO, bool DF >
3348 struct IsContiguous< UniLowerMatrix<MT,SO,DF> >
3349  : public IsContiguous<MT>
3350 {};
3352 //*************************************************************************************************
3353 
3354 
3355 
3356 
3357 //=================================================================================================
3358 //
3359 // ISPADDED SPECIALIZATIONS
3360 //
3361 //=================================================================================================
3362 
3363 //*************************************************************************************************
3365 template< typename MT, bool SO, bool DF >
3366 struct IsPadded< UniLowerMatrix<MT,SO,DF> >
3367  : public IsPadded<MT>
3368 {};
3370 //*************************************************************************************************
3371 
3372 
3373 
3374 
3375 //=================================================================================================
3376 //
3377 // ISRESIZABLE SPECIALIZATIONS
3378 //
3379 //=================================================================================================
3380 
3381 //*************************************************************************************************
3383 template< typename MT, bool SO, bool DF >
3384 struct IsResizable< UniLowerMatrix<MT,SO,DF> >
3385  : public IsResizable<MT>
3386 {};
3388 //*************************************************************************************************
3389 
3390 
3391 
3392 
3393 //=================================================================================================
3394 //
3395 // ISSHRINKABLE SPECIALIZATIONS
3396 //
3397 //=================================================================================================
3398 
3399 //*************************************************************************************************
3401 template< typename MT, bool SO, bool DF >
3402 struct IsShrinkable< UniLowerMatrix<MT,SO,DF> >
3403  : public IsShrinkable<MT>
3404 {};
3406 //*************************************************************************************************
3407 
3408 
3409 
3410 
3411 //=================================================================================================
3412 //
3413 // REMOVEADAPTOR SPECIALIZATIONS
3414 //
3415 //=================================================================================================
3416 
3417 //*************************************************************************************************
3419 template< typename MT, bool SO, bool DF >
3420 struct RemoveAdaptor< UniLowerMatrix<MT,SO,DF> >
3421 {
3422  using Type = MT;
3423 };
3425 //*************************************************************************************************
3426 
3427 
3428 
3429 
3430 //=================================================================================================
3431 //
3432 // ADDTRAIT SPECIALIZATIONS
3433 //
3434 //=================================================================================================
3435 
3436 //*************************************************************************************************
3438 template< typename T1, typename T2 >
3439 struct AddTraitEval1< T1, T2
3440  , EnableIf_t< IsMatrix_v<T1> &&
3441  IsMatrix_v<T2> &&
3442  ( ( IsUniLower_v<T1> && IsStrictlyLower_v<T2> &&
3443  !( IsUniUpper_v<T1> && IsStrictlyUpper_v<T2> ) ) ||
3444  ( IsStrictlyLower_v<T1> && IsUniLower_v<T2> &&
3445  !( IsStrictlyUpper_v<T1> && IsUniUpper_v<T2> ) ) ) &&
3446  !( IsZero_v<T1> || IsZero_v<T2> ) > >
3447 {
3448  using Type = UniLowerMatrix< typename AddTraitEval2<T1,T2>::Type >;
3449 };
3451 //*************************************************************************************************
3452 
3453 
3454 
3455 
3456 //=================================================================================================
3457 //
3458 // SUBTRAIT SPECIALIZATIONS
3459 //
3460 //=================================================================================================
3461 
3462 //*************************************************************************************************
3464 template< typename T1, typename T2 >
3465 struct SubTraitEval1< T1, T2
3466  , EnableIf_t< IsMatrix_v<T1> &&
3467  IsMatrix_v<T2> &&
3468  ( IsUniLower_v<T1> && IsStrictlyLower_v<T2> &&
3469  !( IsUniUpper_v<T1> && IsStrictlyUpper_v<T2> ) ) &&
3470  !( IsZero_v<T1> || IsZero_v<T2> ) > >
3471 {
3472  using Type = UniLowerMatrix< typename SubTraitEval2<T1,T2>::Type >;
3473 };
3475 //*************************************************************************************************
3476 
3477 
3478 
3479 
3480 //=================================================================================================
3481 //
3482 // SCHURTRAIT SPECIALIZATIONS
3483 //
3484 //=================================================================================================
3485 
3486 //*************************************************************************************************
3488 template< typename T1, typename T2 >
3489 struct SchurTraitEval1< T1, T2
3490  , EnableIf_t< IsMatrix_v<T1> &&
3491  IsMatrix_v<T2> &&
3492  ( IsUniLower_v<T1> && IsUniLower_v<T2> ) &&
3493  !( IsDiagonal_v<T1> || IsDiagonal_v<T2> ) &&
3494  !( IsZero_v<T1> || IsZero_v<T2> ) > >
3495 {
3496  using Type = UniLowerMatrix< typename SchurTraitEval2<T1,T2>::Type >;
3497 };
3499 //*************************************************************************************************
3500 
3501 
3502 
3503 
3504 //=================================================================================================
3505 //
3506 // MULTTRAIT SPECIALIZATIONS
3507 //
3508 //=================================================================================================
3509 
3510 //*************************************************************************************************
3512 template< typename T1, typename T2 >
3513 struct MultTraitEval1< T1, T2
3514  , EnableIf_t< IsMatrix_v<T1> &&
3515  IsMatrix_v<T2> &&
3516  ( IsUniLower_v<T1> && IsUniLower_v<T2> ) &&
3517  !( IsIdentity_v<T1> || IsIdentity_v<T2> ) > >
3518 {
3519  using Type = UniLowerMatrix< typename MultTraitEval2<T1,T2>::Type >;
3520 };
3522 //*************************************************************************************************
3523 
3524 
3525 
3526 
3527 //=================================================================================================
3528 //
3529 // KRONTRAIT SPECIALIZATIONS
3530 //
3531 //=================================================================================================
3532 
3533 //*************************************************************************************************
3535 template< typename T1, typename T2 >
3536 struct KronTraitEval1< T1, T2
3537  , EnableIf_t< IsMatrix_v<T1> &&
3538  IsMatrix_v<T2> &&
3539  ( IsUniLower_v<T1> && IsUniLower_v<T2> ) &&
3540  !( IsIdentity_v<T1> && IsIdentity_v<T2> ) &&
3541  !( IsZero_v<T1> || IsZero_v<T2> ) > >
3542 {
3543  using Type = UniLowerMatrix< typename KronTraitEval2<T1,T2>::Type >;
3544 };
3546 //*************************************************************************************************
3547 
3548 
3549 
3550 
3551 //=================================================================================================
3552 //
3553 // MAPTRAIT SPECIALIZATIONS
3554 //
3555 //=================================================================================================
3556 
3557 //*************************************************************************************************
3559 template< typename T, typename OP >
3560 struct UnaryMapTraitEval1< T, OP
3561  , EnableIf_t< YieldsUniLower_v<OP,T> &&
3562  !YieldsIdentity_v<OP,T> > >
3563 {
3564  using Type = UniLowerMatrix< typename UnaryMapTraitEval2<T,OP>::Type, StorageOrder_v<T> >;
3565 };
3567 //*************************************************************************************************
3568 
3569 
3570 //*************************************************************************************************
3572 template< typename T1, typename T2, typename OP >
3573 struct BinaryMapTraitEval1< T1, T2, OP
3574  , EnableIf_t< YieldsUniLower_v<OP,T1,T2> &&
3575  !YieldsIdentity_v<OP,T1,T2> > >
3576 {
3577  using Type = UniLowerMatrix< typename BinaryMapTraitEval2<T1,T2,OP>::Type >;
3578 };
3580 //*************************************************************************************************
3581 
3582 
3583 
3584 
3585 //=================================================================================================
3586 //
3587 // DECLSYMTRAIT SPECIALIZATIONS
3588 //
3589 //=================================================================================================
3590 
3591 //*************************************************************************************************
3593 template< typename MT, bool SO, bool DF >
3594 struct DeclSymTrait< UniLowerMatrix<MT,SO,DF> >
3595 {
3596  using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3597 };
3599 //*************************************************************************************************
3600 
3601 
3602 
3603 
3604 //=================================================================================================
3605 //
3606 // DECLHERMTRAIT SPECIALIZATIONS
3607 //
3608 //=================================================================================================
3609 
3610 //*************************************************************************************************
3612 template< typename MT, bool SO, bool DF >
3613 struct DeclHermTrait< UniLowerMatrix<MT,SO,DF> >
3614 {
3615  using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3616 };
3618 //*************************************************************************************************
3619 
3620 
3621 
3622 
3623 //=================================================================================================
3624 //
3625 // DECLLOWTRAIT SPECIALIZATIONS
3626 //
3627 //=================================================================================================
3628 
3629 //*************************************************************************************************
3631 template< typename MT, bool SO, bool DF >
3632 struct DeclLowTrait< UniLowerMatrix<MT,SO,DF> >
3633 {
3634  using Type = UniLowerMatrix<MT,SO,DF>;
3635 };
3637 //*************************************************************************************************
3638 
3639 
3640 
3641 
3642 //=================================================================================================
3643 //
3644 // DECLUPPTRAIT SPECIALIZATIONS
3645 //
3646 //=================================================================================================
3647 
3648 //*************************************************************************************************
3650 template< typename MT, bool SO, bool DF >
3651 struct DeclUppTrait< UniLowerMatrix<MT,SO,DF> >
3652 {
3653  using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3654 };
3656 //*************************************************************************************************
3657 
3658 
3659 
3660 
3661 //=================================================================================================
3662 //
3663 // DECLDIAGTRAIT SPECIALIZATIONS
3664 //
3665 //=================================================================================================
3666 
3667 //*************************************************************************************************
3669 template< typename MT, bool SO, bool DF >
3670 struct DeclDiagTrait< UniLowerMatrix<MT,SO,DF> >
3671 {
3672  using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3673 };
3675 //*************************************************************************************************
3676 
3677 
3678 
3679 
3680 //=================================================================================================
3681 //
3682 // HIGHTYPE SPECIALIZATIONS
3683 //
3684 //=================================================================================================
3685 
3686 //*************************************************************************************************
3688 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3689 struct HighType< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
3690 {
3691  using Type = UniLowerMatrix< typename HighType<MT1,MT2>::Type >;
3692 };
3694 //*************************************************************************************************
3695 
3696 
3697 
3698 
3699 //=================================================================================================
3700 //
3701 // LOWTYPE SPECIALIZATIONS
3702 //
3703 //=================================================================================================
3704 
3705 //*************************************************************************************************
3707 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
3708 struct LowType< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
3709 {
3710  using Type = UniLowerMatrix< typename LowType<MT1,MT2>::Type >;
3711 };
3713 //*************************************************************************************************
3714 
3715 
3716 
3717 
3718 //=================================================================================================
3719 //
3720 // SUBMATRIXTRAIT SPECIALIZATIONS
3721 //
3722 //=================================================================================================
3723 
3724 //*************************************************************************************************
3726 template< typename MT, size_t I, size_t N >
3727 struct SubmatrixTraitEval1< MT, I, I, N, N
3728  , EnableIf_t< IsUniLower_v<MT> &&
3729  !IsIdentity_v<MT> > >
3730 {
3731  using Type = UniLowerMatrix< typename SubmatrixTraitEval2<MT,I,I,N,N>::Type >;
3732 };
3734 //*************************************************************************************************
3735 
3736 } // namespace blaze
3737 
3738 #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 the implementation of the base template of the UniLowerMatrix.
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.
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.
#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.
Header file for the MaxSize 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.
constexpr bool YieldsUniLower_v
Auxiliary variable template for the YieldsUniLower type trait.The YieldsUniLower_v variable template ...
Definition: YieldsUniLower.h:124
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.
UniLowerMatrix specialization for dense matrices.
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 YieldsUniLower type trait.
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
UniLowerMatrix specialization for sparse matrices.
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.
#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
constexpr bool IsUniLower_v
Auxiliary variable template for the IsUniLower type trait.The IsUniLower_v variable template provides...
Definition: IsUniLower.h:173
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
Header file for the StorageOrder type trait.
Header file for the IntegralConstant class template.
Matrix adapter for lower unitriangular matrices.
Definition: BaseTemplate.h:577
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 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 HighType type trait.