UniUpperMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
54 #include <blaze/math/Forward.h>
57 #include <blaze/math/shims/IsOne.h>
94 #include <blaze/util/Assert.h>
95 #include <blaze/util/EnableIf.h>
96 #include <blaze/util/TrueType.h>
98 #include <blaze/util/Unused.h>
99 
100 
101 namespace blaze {
102 
103 //=================================================================================================
104 //
105 // UNIUPPERMATRIX OPERATORS
106 //
107 //=================================================================================================
108 
109 //*************************************************************************************************
112 template< typename MT, bool SO, bool DF >
113 void reset( UniUpperMatrix<MT,SO,DF>& m );
114 
115 template< typename MT, bool SO, bool DF >
116 void reset( UniUpperMatrix<MT,SO,DF>& m, size_t i );
117 
118 template< typename MT, bool SO, bool DF >
119 void clear( UniUpperMatrix<MT,SO,DF>& m );
120 
121 template< bool RF, typename MT, bool SO, bool DF >
122 bool isDefault( const UniUpperMatrix<MT,SO,DF>& m );
123 
124 template< typename MT, bool SO, bool DF >
125 bool isIntact( const UniUpperMatrix<MT,SO,DF>& m );
126 
127 template< typename MT, bool SO, bool DF >
128 void swap( UniUpperMatrix<MT,SO,DF>& a, UniUpperMatrix<MT,SO,DF>& b ) noexcept;
130 //*************************************************************************************************
131 
132 
133 //*************************************************************************************************
140 template< typename MT // Type of the adapted matrix
141  , bool SO // Storage order of the adapted matrix
142  , bool DF > // Density flag
144 {
145  m.reset();
146 }
147 //*************************************************************************************************
148 
149 
150 //*************************************************************************************************
163 template< typename MT // Type of the adapted matrix
164  , bool SO // Storage order of the adapted matrix
165  , bool DF > // Density flag
166 inline void reset( UniUpperMatrix<MT,SO,DF>& m, size_t i )
167 {
168  m.reset( i );
169 }
170 //*************************************************************************************************
171 
172 
173 //*************************************************************************************************
180 template< typename MT // Type of the adapted matrix
181  , bool SO // Storage order of the adapted matrix
182  , bool DF > // Density flag
184 {
185  m.clear();
186 }
187 //*************************************************************************************************
188 
189 
190 //*************************************************************************************************
200 template< bool RF // Relaxation flag
201  , typename MT // Type of the adapted matrix
202  , bool SO // Storage order of the adapted matrix
203  , bool DF > // Density flag
204 inline bool isDefault_backend( const UniUpperMatrix<MT,SO,DF>& m, TrueType )
205 {
206  return ( m.rows() == 0UL );
207 }
209 //*************************************************************************************************
210 
211 
212 //*************************************************************************************************
222 template< bool RF // Relaxation flag
223  , typename MT // Type of the adapted matrix
224  , bool SO // Storage order of the adapted matrix
225  , bool DF > // Density flag
226 inline bool isDefault_backend( const UniUpperMatrix<MT,SO,DF>& m, FalseType )
227 {
228  return isIdentity<RF>( m );
229 }
231 //*************************************************************************************************
232 
233 
234 //*************************************************************************************************
261 template< bool RF // Relaxation flag
262  , typename MT // Type of the adapted matrix
263  , bool SO // Storage order of the adapted matrix
264  , bool DF > // Density flag
265 inline bool isDefault( const UniUpperMatrix<MT,SO,DF>& m )
266 {
267  return isDefault_backend<RF>( m, typename IsResizable<MT>::Type() );
268 }
269 //*************************************************************************************************
270 
271 
272 //*************************************************************************************************
293 template< typename MT // Type of the adapted matrix
294  , bool SO // Storage order of the adapted matrix
295  , bool DF > // Density flag
296 inline bool isIntact( const UniUpperMatrix<MT,SO,DF>& m )
297 {
298  return m.isIntact();
299 }
300 //*************************************************************************************************
301 
302 
303 //*************************************************************************************************
311 template< typename MT // Type of the adapted matrix
312  , bool SO // Storage order of the adapted matrix
313  , bool DF > // Density flag
315 {
316  a.swap( b );
317 }
318 //*************************************************************************************************
319 
320 
321 //*************************************************************************************************
344 template< InversionFlag IF // Inversion algorithm
345  , typename MT // Type of the dense matrix
346  , bool SO > // Storage order of the dense matrix
347 inline void invert( UniUpperMatrix<MT,SO,true>& m )
348 {
350 
351  if( IF == asLower || IF == asUniLower ) {
352  BLAZE_INTERNAL_ASSERT( isIdentity( m ), "Violation of preconditions detected" );
353  return;
354  }
355 
356  constexpr InversionFlag flag( ( IF == byLU || IF == asGeneral || IF == asUpper || IF == asUniUpper)
357  ? ( asUniUpper )
358  : ( asDiagonal ) );
359 
360  invert<flag>( derestrict( m ) );
361 
362  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
363 }
365 //*************************************************************************************************
366 
367 
368 //*************************************************************************************************
387 template< typename MT1, bool SO1, typename MT2, typename MT3, typename MT4, bool SO2 >
388 inline void lu( const UniUpperMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
389  DenseMatrix<MT3,SO1>& U, Matrix<MT4,SO2>& P )
390 {
391  BLAZE_CONSTRAINT_MUST_BE_BLAS_COMPATIBLE_TYPE( ElementType_t<MT1> );
392 
397 
402 
403  using ET2 = ElementType_t<MT2>;
404  using ET4 = ElementType_t<MT4>;
405 
406  const size_t n( (~A).rows() );
407 
408  decltype(auto) L2( derestrict( ~L ) );
409 
410  (~U) = A;
411 
412  resize( ~L, n, n );
413  reset( L2 );
414 
415  resize( ~P, n, n );
416  reset( ~P );
417 
418  for( size_t i=0UL; i<n; ++i ) {
419  L2(i,i) = ET2(1);
420  (~P)(i,i) = ET4(1);
421  }
422 }
424 //*************************************************************************************************
425 
426 
427 //*************************************************************************************************
443 template< typename MT // Type of the adapted matrix
444  , bool SO // Storage order of the adapted matrix
445  , bool DF // Density flag
446  , typename ET > // Type of the element
447 inline bool trySet( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
448 {
449  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
450  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
451 
452  UNUSED_PARAMETER( mat );
453 
454  if( i < j )
455  return true;
456  else if( i == j )
457  return isOne( value );
458  else
459  return isDefault( value );
460 }
462 //*************************************************************************************************
463 
464 
465 //*************************************************************************************************
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
485 inline bool tryAdd( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
486 {
487  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
488  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
489 
490  UNUSED_PARAMETER( mat );
491 
492  if( i < j )
493  return true;
494  else
495  return isDefault( value );
496 }
498 //*************************************************************************************************
499 
500 
501 //*************************************************************************************************
517 template< typename MT // Type of the adapted matrix
518  , bool SO // Storage order of the adapted matrix
519  , bool DF // Density flag
520  , typename ET > // Type of the element
521 inline bool trySub( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
522 {
523  return tryAdd( mat, i, j, value );
524 }
526 //*************************************************************************************************
527 
528 
529 //*************************************************************************************************
545 template< typename MT // Type of the adapted matrix
546  , bool SO // Storage order of the adapted matrix
547  , bool DF // Density flag
548  , typename ET > // Type of the element
549 inline bool tryMult( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
550 {
551  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
552  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
553 
554  UNUSED_PARAMETER( mat );
555 
556  return ( i != j || isOne( value ) );
557 }
559 //*************************************************************************************************
560 
561 
562 //*************************************************************************************************
580 template< typename MT // Type of the adapted matrix
581  , bool SO // Storage order of the adapted matrix
582  , bool DF // Density flag
583  , typename ET > // Type of the element
585  tryMult( const UniUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
586 {
587  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
588  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
589  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
590  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
591 
592  UNUSED_PARAMETER( mat );
593 
594  return ( row >= column + n ) || ( column >= row + m ) || isOne( value );
595 }
597 //*************************************************************************************************
598 
599 
600 //*************************************************************************************************
616 template< typename MT // Type of the adapted matrix
617  , bool SO // Storage order of the adapted matrix
618  , bool DF // Density flag
619  , typename ET > // Type of the element
620 inline bool tryDiv( const UniUpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
621 {
622  return tryMult( mat, i, j, value );
623 }
625 //*************************************************************************************************
626 
627 
628 //*************************************************************************************************
646 template< typename MT // Type of the adapted matrix
647  , bool SO // Storage order of the adapted matrix
648  , bool DF // Density flag
649  , typename ET > // Type of the element
651  tryDiv( const UniUpperMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
652 {
653  BLAZE_INTERNAL_ASSERT( row <= (~mat).rows(), "Invalid row access index" );
654  BLAZE_INTERNAL_ASSERT( column <= (~mat).columns(), "Invalid column access index" );
655  BLAZE_INTERNAL_ASSERT( row + m <= (~mat).rows(), "Invalid number of rows" );
656  BLAZE_INTERNAL_ASSERT( column + n <= (~mat).columns(), "Invalid number of columns" );
657 
658  UNUSED_PARAMETER( mat );
659 
660  return ( row >= column + n ) || ( column >= row + m ) || isOne( value );
661 }
663 //*************************************************************************************************
664 
665 
666 //*************************************************************************************************
682 template< typename MT // Type of the adapted matrix
683  , bool SO // Storage order of the adapted matrix
684  , bool DF // Density flag
685  , typename VT > // Type of the right-hand side dense vector
686 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
687  const DenseVector<VT,false>& rhs, size_t row, size_t column )
688 {
690 
691  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
692  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
693  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
694 
695  UNUSED_PARAMETER( lhs );
696 
697  if( column >= row + (~rhs).size() )
698  return true;
699 
700  const bool containsDiagonal( column >= row );
701  const size_t ibegin( ( !containsDiagonal )?( 0UL ):( column - row + 1UL ) );
702 
703  if( containsDiagonal && !isOne( (~rhs)[column-row] ) )
704  return false;
705 
706  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
707  if( !isDefault( (~rhs)[i] ) )
708  return false;
709  }
710 
711  return true;
712 }
714 //*************************************************************************************************
715 
716 
717 //*************************************************************************************************
733 template< typename MT // Type of the adapted matrix
734  , bool SO // Storage order of the adapted matrix
735  , bool DF // Density flag
736  , typename VT > // Type of the right-hand side dense vector
737 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
738  const DenseVector<VT,true>& rhs, size_t row, size_t column )
739 {
741 
742  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
743  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
744  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
745 
746  UNUSED_PARAMETER( lhs );
747 
748  if( row < column )
749  return true;
750 
751  const bool containsDiagonal( row < column + (~rhs).size() );
752  const size_t iend( min( row - column, (~rhs).size() ) );
753 
754  for( size_t i=0UL; i<iend; ++i ) {
755  if( !isDefault( (~rhs)[i] ) )
756  return false;
757  }
758 
759  if( containsDiagonal && !isOne( (~rhs)[iend] ) )
760  return false;
761 
762  return true;
763 }
765 //*************************************************************************************************
766 
767 
768 //*************************************************************************************************
786 template< typename MT // Type of the adapted matrix
787  , bool SO // Storage order of the adapted matrix
788  , bool DF // Density flag
789  , typename VT // Type of the right-hand side dense vector
790  , bool TF > // Transpose flag of the right-hand side dense vector
791 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
792  ptrdiff_t band, size_t row, size_t column )
793 {
795 
796  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
797  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
798  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
799  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
800 
801  UNUSED_PARAMETER( lhs, row, column );
802 
803  if( band == 0L ) {
804  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
805  if( !isOne( (~rhs)[i] ) )
806  return false;
807  }
808  }
809  else if( band < 0L ) {
810  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
811  if( !isDefault( (~rhs)[i] ) )
812  return false;
813  }
814  }
815 
816  return true;
817 }
819 //*************************************************************************************************
820 
821 
822 //*************************************************************************************************
838 template< typename MT // Type of the adapted matrix
839  , bool SO // Storage order of the adapted matrix
840  , bool DF // Density flag
841  , typename VT > // Type of the right-hand side sparse vector
842 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
843  const SparseVector<VT,false>& rhs, size_t row, size_t column )
844 {
846 
847  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
848  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
849  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
850 
851  UNUSED_PARAMETER( lhs );
852 
853  if( column >= row + (~rhs).size() )
854  return true;
855 
856  const bool containsDiagonal( column >= row );
857  const size_t index( ( containsDiagonal )?( column - row ):( 0UL ) );
858  const auto last( (~rhs).end() );
859  auto element( (~rhs).lowerBound( index ) );
860 
861  if( containsDiagonal ) {
862  if( element == last || element->index() != index || !isOne( element->value() ) )
863  return false;
864  ++element;
865  }
866 
867  for( ; element!=last; ++element ) {
868  if( !isDefault( element->value() ) )
869  return false;
870  }
871 
872  return true;
873 }
875 //*************************************************************************************************
876 
877 
878 //*************************************************************************************************
894 template< typename MT // Type of the adapted matrix
895  , bool SO // Storage order of the adapted matrix
896  , bool DF // Density flag
897  , typename VT > // Type of the right-hand side sparse vector
898 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
899  const SparseVector<VT,true>& rhs, size_t row, size_t column )
900 {
902 
903  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
904  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
905  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
906 
907  UNUSED_PARAMETER( lhs );
908 
909  if( row < column )
910  return true;
911 
912  const bool containsDiagonal( row < column + (~rhs).size() );
913  const size_t index( row - column );
914  const auto last( (~rhs).lowerBound( index ) );
915 
916  if( containsDiagonal ) {
917  if( last == (~rhs).end() || last->index() != index || !isOne( last->value() ) )
918  return false;
919  }
920 
921  for( auto element=(~rhs).begin(); element!=last; ++element ) {
922  if( !isDefault( element->value() ) )
923  return false;
924  }
925 
926  return true;
927 }
929 //*************************************************************************************************
930 
931 
932 //*************************************************************************************************
950 template< typename MT // Type of the adapted matrix
951  , bool SO // Storage order of the adapted matrix
952  , bool DF // Density flag
953  , typename VT // Type of the right-hand side sparse vector
954  , bool TF > // Transpose flag of the right-hand side sparse vector
955 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
956  ptrdiff_t band, size_t row, size_t column )
957 {
959 
960  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
961  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
962  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
963  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
964 
965  UNUSED_PARAMETER( lhs, row, column );
966 
967  if( band == 0L ) {
968  if( (~rhs).nonZeros() != (~rhs).size() )
969  return false;
970  for( const auto& element : ~rhs ) {
971  if( !isOne( element.value() ) )
972  return false;
973  }
974  }
975  else if( band < 0L ) {
976  for( const auto& element : ~rhs ) {
977  if( !isDefault( element.value() ) )
978  return false;
979  }
980  }
981 
982  return true;
983 }
985 //*************************************************************************************************
986 
987 
988 //*************************************************************************************************
1004 template< typename MT1 // Type of the adapted matrix
1005  , bool SO // Storage order of the adapted matrix
1006  , bool DF // Density flag
1007  , typename MT2 > // Type of the right-hand side dense matrix
1008 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1009  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
1010 {
1012 
1013  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1014  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1015  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1016  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1017 
1018  UNUSED_PARAMETER( lhs );
1019 
1020  const size_t M( (~rhs).rows() );
1021  const size_t N( (~rhs).columns() );
1022 
1023  if( column >= row + M )
1024  return true;
1025 
1026  const size_t ibegin( ( column < row )?( 0UL ):( column - row ) );
1027 
1028  for( size_t i=ibegin; i<M; ++i )
1029  {
1030  const size_t jend( min( row + i - column, N ) );
1031 
1032  for( size_t j=0UL; j<jend; ++j ) {
1033  if( !isDefault( (~rhs)(i,j) ) )
1034  return false;
1035  }
1036 
1037  const bool containsDiagonal( row + i < column + N );
1038 
1039  if( containsDiagonal && !isOne( (~rhs)(i,jend) ) )
1040  return false;
1041  }
1042 
1043  return true;
1044 }
1046 //*************************************************************************************************
1047 
1048 
1049 //*************************************************************************************************
1065 template< typename MT1 // Type of the adapted matrix
1066  , bool SO // Storage order of the adapted matrix
1067  , bool DF // Density flag
1068  , typename MT2 > // Type of the right-hand side dense matrix
1069 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1070  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
1071 {
1073 
1074  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1075  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1076  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1077  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1078 
1079  UNUSED_PARAMETER( lhs );
1080 
1081  const size_t M( (~rhs).rows() );
1082  const size_t N( (~rhs).columns() );
1083 
1084  if( column >= row + M )
1085  return true;
1086 
1087  const size_t jend( min( row + M - column, N ) );
1088 
1089  for( size_t j=0UL; j<jend; ++j )
1090  {
1091  const bool containsDiagonal( column + j >= row );
1092 
1093  if( containsDiagonal && !isOne( (~rhs)(column+j-row,j) ) )
1094  return false;
1095 
1096  const size_t ibegin( ( containsDiagonal )?( column + j - row + 1UL ):( 0UL ) );
1097 
1098  for( size_t i=ibegin; i<M; ++i ) {
1099  if( !isDefault( (~rhs)(i,j) ) )
1100  return false;
1101  }
1102  }
1103 
1104  return true;
1105 }
1107 //*************************************************************************************************
1108 
1109 
1110 //*************************************************************************************************
1126 template< typename MT1 // Type of the adapted matrix
1127  , bool SO // Storage order of the adapted matrix
1128  , bool DF // Density flag
1129  , typename MT2 > // Type of the right-hand side sparse matrix
1130 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1131  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
1132 {
1134 
1135  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1136  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1137  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1138  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1139 
1140  UNUSED_PARAMETER( lhs );
1141 
1142  const size_t M( (~rhs).rows() );
1143  const size_t N( (~rhs).columns() );
1144 
1145  if( column >= row + M )
1146  return true;
1147 
1148  const size_t ibegin( ( column < row )?( 0UL ):( column - row ) );
1149 
1150  for( size_t i=ibegin; i<M; ++i )
1151  {
1152  const bool containsDiagonal( row + i < column + N );
1153 
1154  const size_t index( row + i - column );
1155  const auto last( (~rhs).lowerBound( i, min( index, N ) ) );
1156 
1157  if( containsDiagonal ) {
1158  if( last == (~rhs).end(i) || ( last->index() != index ) || !isOne( last->value() ) )
1159  return false;
1160  }
1161 
1162  for( auto element=(~rhs).begin(i); element!=last; ++element ) {
1163  if( !isDefault( element->value() ) )
1164  return false;
1165  }
1166  }
1167 
1168  return true;
1169 }
1171 //*************************************************************************************************
1172 
1173 
1174 //*************************************************************************************************
1190 template< typename MT1 // Type of the adapted matrix
1191  , bool SO // Storage order of the adapted matrix
1192  , bool DF // Density flag
1193  , typename MT2 > // Type of the right-hand side sparse matrix
1194 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1195  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
1196 {
1198 
1199  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1200  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1201  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1202  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1203 
1204  UNUSED_PARAMETER( lhs );
1205 
1206  const size_t M( (~rhs).rows() );
1207  const size_t N( (~rhs).columns() );
1208 
1209  if( column >= row + M )
1210  return true;
1211 
1212  const size_t jend( min( row + M - column, N ) );
1213 
1214  for( size_t j=0UL; j<jend; ++j )
1215  {
1216  const bool containsDiagonal( column + j >= row );
1217  const size_t index( ( containsDiagonal )?( column + j - row ):( 0UL ) );
1218 
1219  const auto last( (~rhs).end(j) );
1220  auto element( (~rhs).lowerBound( index, j ) );
1221 
1222  if( containsDiagonal ) {
1223  if( element == last || ( element->index() != index ) || !isOne( element->value() ) )
1224  return false;
1225  ++element;
1226  }
1227 
1228  for( ; element!=last; ++element ) {
1229  if( !isDefault( element->value() ) )
1230  return false;
1231  }
1232  }
1233 
1234  return true;
1235 }
1237 //*************************************************************************************************
1238 
1239 
1240 //*************************************************************************************************
1257 template< typename MT // Type of the adapted matrix
1258  , bool SO // Storage order of the adapted matrix
1259  , bool DF // Density flag
1260  , typename VT > // Type of the right-hand side dense vector
1261 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1262  const DenseVector<VT,false>& rhs, size_t row, size_t column )
1263 {
1265 
1266  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1267  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1268  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1269 
1270  UNUSED_PARAMETER( lhs );
1271 
1272  const size_t ibegin( ( column <= row )?( 0UL ):( column - row ) );
1273 
1274  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
1275  if( !isDefault( (~rhs)[i] ) )
1276  return false;
1277  }
1278 
1279  return true;
1280 }
1282 //*************************************************************************************************
1283 
1284 
1285 //*************************************************************************************************
1302 template< typename MT // Type of the adapted matrix
1303  , bool SO // Storage order of the adapted matrix
1304  , bool DF // Density flag
1305  , typename VT > // Type of the right-hand side dense vector
1306 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1307  const DenseVector<VT,true>& rhs, size_t row, size_t column )
1308 {
1310 
1311  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1312  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1313  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1314 
1315  UNUSED_PARAMETER( lhs );
1316 
1317  if( row < column )
1318  return true;
1319 
1320  const size_t iend( min( row - column + 1UL, (~rhs).size() ) );
1321 
1322  for( size_t i=0UL; i<iend; ++i ) {
1323  if( !isDefault( (~rhs)[i] ) )
1324  return false;
1325  }
1326 
1327  return true;
1328 }
1330 //*************************************************************************************************
1331 
1332 
1333 //*************************************************************************************************
1350 template< typename MT // Type of the adapted matrix
1351  , bool SO // Storage order of the adapted matrix
1352  , bool DF // Density flag
1353  , typename VT // Type of the right-hand side dense vector
1354  , bool TF > // Transpose flag of the right-hand side dense vector
1355 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
1356  ptrdiff_t band, size_t row, size_t column )
1357 {
1359 
1360  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1361  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1362  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1363  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1364 
1365  UNUSED_PARAMETER( lhs, row, column );
1366 
1367  if( band <= 0L ) {
1368  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
1369  if( !isDefault( (~rhs)[i] ) )
1370  return false;
1371  }
1372  }
1373 
1374  return true;
1375 }
1377 //*************************************************************************************************
1378 
1379 
1380 //*************************************************************************************************
1397 template< typename MT // Type of the adapted matrix
1398  , bool SO // Storage order of the adapted matrix
1399  , bool DF // Density flag
1400  , typename VT > // Type of the right-hand side sparse vector
1401 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1402  const SparseVector<VT,false>& rhs, size_t row, size_t column )
1403 {
1405 
1406  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1407  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1408  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1409 
1410  UNUSED_PARAMETER( lhs );
1411 
1412  const auto last( (~rhs).end() );
1413  auto element( (~rhs).lowerBound( ( column <= row )?( 0UL ):( column - row ) ) );
1414 
1415  for( ; element!=last; ++element ) {
1416  if( !isDefault( element->value() ) )
1417  return false;
1418  }
1419 
1420  return true;
1421 }
1423 //*************************************************************************************************
1424 
1425 
1426 //*************************************************************************************************
1443 template< typename MT // Type of the adapted matrix
1444  , bool SO // Storage order of the adapted matrix
1445  , bool DF // Density flag
1446  , typename VT > // Type of the right-hand side sparse vector
1447 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1448  const SparseVector<VT,true>& rhs, size_t row, size_t column )
1449 {
1451 
1452  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1453  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1454  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1455 
1456  UNUSED_PARAMETER( lhs );
1457 
1458  if( row < column )
1459  return true;
1460 
1461  const auto last( (~rhs).lowerBound( row - column + 1UL ) );
1462 
1463  for( auto element=(~rhs).begin(); element!=last; ++element ) {
1464  if( !isDefault( element->value() ) )
1465  return false;
1466  }
1467 
1468  return true;
1469 }
1471 //*************************************************************************************************
1472 
1473 
1474 //*************************************************************************************************
1491 template< typename MT // Type of the adapted matrix
1492  , bool SO // Storage order of the adapted matrix
1493  , bool DF // Density flag
1494  , typename VT // Type of the right-hand side sparse vector
1495  , bool TF > // Transpose flag of the right-hand side sparse vector
1496 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
1497  ptrdiff_t band, size_t row, size_t column )
1498 {
1500 
1501  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1502  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1503  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1504  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1505 
1506  UNUSED_PARAMETER( lhs, row, column );
1507 
1508  if( band <= 0L ) {
1509  for( const auto& element : ~rhs ) {
1510  if( !isDefault( element.value() ) )
1511  return false;
1512  }
1513  }
1514 
1515  return true;
1516 }
1518 //*************************************************************************************************
1519 
1520 
1521 //*************************************************************************************************
1538 template< typename MT1 // Type of the adapted matrix
1539  , bool SO // Storage order of the adapted matrix
1540  , bool DF // Density flag
1541  , typename MT2 > // Type of the right-hand side dense matrix
1542 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1543  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
1544 {
1546 
1547  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1548  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1549  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1550  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1551 
1552  UNUSED_PARAMETER( lhs );
1553 
1554  const size_t M( (~rhs).rows() );
1555  const size_t N( (~rhs).columns() );
1556 
1557  if( column >= row + M )
1558  return true;
1559 
1560  const size_t ibegin( ( column <= row )?( 0UL ):( column - row ) );
1561 
1562  for( size_t i=ibegin; i<M; ++i )
1563  {
1564  const size_t jend( min( row + i - column + 1UL, N ) );
1565 
1566  for( size_t j=0UL; j<jend; ++j ) {
1567  if( !isDefault( (~rhs)(i,j) ) )
1568  return false;
1569  }
1570  }
1571 
1572  return true;
1573 }
1575 //*************************************************************************************************
1576 
1577 
1578 //*************************************************************************************************
1595 template< typename MT1 // Type of the adapted matrix
1596  , bool SO // Storage order of the adapted matrix
1597  , bool DF // Density flag
1598  , typename MT2 > // Type of the right-hand side dense matrix
1599 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1600  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
1601 {
1603 
1604  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1605  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1606  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1607  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1608 
1609  UNUSED_PARAMETER( lhs );
1610 
1611  const size_t M( (~rhs).rows() );
1612  const size_t N( (~rhs).columns() );
1613 
1614  if( column >= row + M )
1615  return true;
1616 
1617  const size_t jend( min( row + M - column, N ) );
1618 
1619  for( size_t j=0UL; j<jend; ++j )
1620  {
1621  const bool containsDiagonal( column + j >= row );
1622  const size_t ibegin( ( containsDiagonal )?( column + j - row ):( 0UL ) );
1623 
1624  for( size_t i=ibegin; i<M; ++i ) {
1625  if( !isDefault( (~rhs)(i,j) ) )
1626  return false;
1627  }
1628  }
1629 
1630  return true;
1631 }
1633 //*************************************************************************************************
1634 
1635 
1636 //*************************************************************************************************
1653 template< typename MT1 // Type of the adapted matrix
1654  , bool SO // Storage order of the adapted matrix
1655  , bool DF // Density flag
1656  , typename MT2 > // Type of the right-hand side sparse matrix
1657 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1658  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
1659 {
1661 
1662  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1663  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1664  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1665  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1666 
1667  UNUSED_PARAMETER( lhs );
1668 
1669  const size_t M( (~rhs).rows() );
1670  const size_t N( (~rhs).columns() );
1671 
1672  if( column >= row + M )
1673  return true;
1674 
1675  const size_t ibegin( ( column < row )?( 0UL ):( column - row ) );
1676 
1677  for( size_t i=ibegin; i<M; ++i )
1678  {
1679  const size_t index( row + i - column + 1UL );
1680  const auto last( (~rhs).lowerBound( i, min( index, N ) ) );
1681 
1682  for( auto element=(~rhs).begin(i); element!=last; ++element ) {
1683  if( !isDefault( element->value() ) )
1684  return false;
1685  }
1686  }
1687 
1688  return true;
1689 }
1691 //*************************************************************************************************
1692 
1693 
1694 //*************************************************************************************************
1711 template< typename MT1 // Type of the adapted matrix
1712  , bool SO // Storage order of the adapted matrix
1713  , bool DF // Density flag
1714  , typename MT2 > // Type of the right-hand side sparse matrix
1715 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1716  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
1717 {
1719 
1720  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1721  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1722  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1723  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1724 
1725  UNUSED_PARAMETER( lhs );
1726 
1727  const size_t M( (~rhs).rows() );
1728  const size_t N( (~rhs).columns() );
1729 
1730  if( column >= row + M )
1731  return true;
1732 
1733  const size_t jend( min( row + M - column, N ) );
1734 
1735  for( size_t j=0UL; j<jend; ++j )
1736  {
1737  const bool containsDiagonal( column + j >= row );
1738  const size_t index( ( containsDiagonal )?( column + j - row ):( 0UL ) );
1739 
1740  const auto last( (~rhs).end(j) );
1741  auto element( (~rhs).lowerBound( index, j ) );
1742 
1743  for( ; element!=last; ++element ) {
1744  if( !isDefault( element->value() ) )
1745  return false;
1746  }
1747  }
1748 
1749  return true;
1750 }
1752 //*************************************************************************************************
1753 
1754 
1755 //*************************************************************************************************
1772 template< typename MT // Type of the adapted matrix
1773  , bool SO // Storage order of the adapted matrix
1774  , bool DF // Density flag
1775  , typename VT // Type of the right-hand side vector
1776  , bool TF > // Transpose flag of the right-hand side vector
1777 inline bool trySubAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1778  const Vector<VT,TF>& rhs, size_t row, size_t column )
1779 {
1780  return tryAddAssign( lhs, ~rhs, row, column );
1781 }
1783 //*************************************************************************************************
1784 
1785 
1786 //*************************************************************************************************
1804 template< typename MT // Type of the adapted matrix
1805  , bool SO // Storage order of the adapted matrix
1806  , bool DF // Density flag
1807  , typename VT // Type of the right-hand side vector
1808  , bool TF > // Transpose flag of the right-hand side vector
1809 inline bool trySubAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
1810  ptrdiff_t band, size_t row, size_t column )
1811 {
1812  return tryAddAssign( lhs, ~rhs, band, row, column );
1813 }
1815 //*************************************************************************************************
1816 
1817 
1818 //*************************************************************************************************
1835 template< typename MT1 // Type of the adapted matrix
1836  , bool SO1 // Storage order of the adapted matrix
1837  , bool DF // Density flag
1838  , typename MT2 // Type of the right-hand side matrix
1839  , bool SO2 > // Storage order of the right-hand side matrix
1840 inline bool trySubAssign( const UniUpperMatrix<MT1,SO1,DF>& lhs,
1841  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1842 {
1843  return tryAddAssign( lhs, ~rhs, row, column );
1844 }
1846 //*************************************************************************************************
1847 
1848 
1849 //*************************************************************************************************
1866 template< typename MT // Type of the adapted matrix
1867  , bool SO // Storage order of the adapted matrix
1868  , bool DF // Density flag
1869  , typename VT > // Type of the right-hand side vector
1870 inline bool tryMultAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1871  const Vector<VT,false>& rhs, size_t row, size_t column )
1872 {
1874 
1875  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1876  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1877  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1878 
1879  UNUSED_PARAMETER( lhs );
1880 
1881  return ( column < row || (~rhs).size() <= column - row || isOne( (~rhs)[column-row] ) );
1882 }
1884 //*************************************************************************************************
1885 
1886 
1887 //*************************************************************************************************
1904 template< typename MT // Type of the adapted matrix
1905  , bool SO // Storage order of the adapted matrix
1906  , bool DF // Density flag
1907  , typename VT > // Type of the right-hand side vector
1908 inline bool tryMultAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1909  const Vector<VT,true>& rhs, size_t row, size_t column )
1910 {
1912 
1913  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1914  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1915  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1916 
1917  UNUSED_PARAMETER( lhs );
1918 
1919  return ( row < column || (~rhs).size() <= row - column || isOne( (~rhs)[row-column] ) );
1920 }
1922 //*************************************************************************************************
1923 
1924 
1925 //*************************************************************************************************
1942 template< typename MT // Type of the adapted matrix
1943  , bool SO // Storage order of the adapted matrix
1944  , bool DF // Density flag
1945  , typename VT // Type of the right-hand side dense vector
1946  , bool TF > // Transpose flag of the right-hand side dense vector
1947 inline bool tryMultAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
1948  ptrdiff_t band, size_t row, size_t column )
1949 {
1951 
1952  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1953  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1954  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
1955  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
1956 
1957  UNUSED_PARAMETER( lhs, row, column );
1958 
1959  if( band == 0L ) {
1960  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
1961  if( !isOne( (~rhs)[i] ) )
1962  return false;
1963  }
1964  }
1965 
1966  return true;
1967 }
1969 //*************************************************************************************************
1970 
1971 
1972 //*************************************************************************************************
1989 template< typename MT // Type of the adapted matrix
1990  , bool SO // Storage order of the adapted matrix
1991  , bool DF // Density flag
1992  , typename VT // Type of the right-hand side sparse vector
1993  , bool TF > // Transpose flag of the right-hand side sparse vector
1994 inline bool tryMultAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
1995  ptrdiff_t band, size_t row, size_t column )
1996 {
1998 
1999  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2000  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2001  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
2002  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
2003 
2004  UNUSED_PARAMETER( lhs, row, column );
2005 
2006  if( band == 0L ) {
2007  if( (~rhs).nonZeros() != (~rhs).size() )
2008  return false;
2009  for( const auto& element : ~rhs ) {
2010  if( !isOne( element.value() ) )
2011  return false;
2012  }
2013  }
2014 
2015  return true;
2016 }
2018 //*************************************************************************************************
2019 
2020 
2021 //*************************************************************************************************
2038 template< typename MT1 // Type of the adapted matrix
2039  , bool SO1 // Storage order of the adapted matrix
2040  , bool DF // Density flag
2041  , typename MT2 // Type of the right-hand side matrix
2042  , bool SO2 > // Storage order of the right-hand side matrix
2043 inline bool trySchurAssign( const UniUpperMatrix<MT1,SO1,DF>& lhs,
2044  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
2045 {
2047 
2048  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
2049  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
2050  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
2051  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
2052 
2053  UNUSED_PARAMETER( lhs );
2054 
2055  const size_t M( (~rhs).rows() );
2056  const size_t N( (~rhs).columns() );
2057 
2058  if( ( row >= column + N ) || ( column >= row + M ) )
2059  return true;
2060 
2061  size_t i( row < column ? column - row : 0UL );
2062  size_t j( column < row ? row - column : 0UL );
2063 
2064  for( ; i<M && j<N; ++i, ++j )
2065  {
2066  if( !isOne( (~rhs)(i,j) ) )
2067  return false;
2068  }
2069 
2070  return true;
2071 }
2073 //*************************************************************************************************
2074 
2075 
2076 //*************************************************************************************************
2092 template< typename MT // Type of the adapted matrix
2093  , bool SO // Storage order of the adapted matrix
2094  , bool DF // Density flag
2095  , typename VT // Type of the right-hand side vector
2096  , bool TF > // Transpose flag of the right-hand side vector
2097 inline bool tryDivAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
2098  const Vector<VT,TF>& rhs, size_t row, size_t column )
2099 {
2100  return tryMultAssign( lhs, ~rhs, row, column );
2101 }
2103 //*************************************************************************************************
2104 
2105 
2106 //*************************************************************************************************
2123 template< typename MT // Type of the adapted matrix
2124  , bool SO // Storage order of the adapted matrix
2125  , bool DF // Density flag
2126  , typename VT // Type of the right-hand side vector
2127  , bool TF > // Transpose flag of the right-hand side vector
2128 inline bool tryDivAssign( const UniUpperMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
2129  ptrdiff_t band, size_t row, size_t column )
2130 {
2131  return tryMultAssign( lhs, rhs, band, row, column );
2132 }
2134 //*************************************************************************************************
2135 
2136 
2137 //*************************************************************************************************
2151 template< typename MT // Type of the adapted matrix
2152  , bool SO // Storage order of the adapted matrix
2153  , bool DF > // Density flag
2154 inline MT& derestrict( UniUpperMatrix<MT,SO,DF>& m )
2155 {
2156  return m.matrix_;
2157 }
2159 //*************************************************************************************************
2160 
2161 
2162 
2163 
2164 //=================================================================================================
2165 //
2166 // SIZE SPECIALIZATIONS
2167 //
2168 //=================================================================================================
2169 
2170 //*************************************************************************************************
2172 template< typename MT, bool SO, bool DF >
2173 struct Size< UniUpperMatrix<MT,SO,DF>, 0UL >
2174  : public Size<MT,0UL>
2175 {};
2176 
2177 template< typename MT, bool SO, bool DF >
2178 struct Size< UniUpperMatrix<MT,SO,DF>, 1UL >
2179  : public Size<MT,1UL>
2180 {};
2182 //*************************************************************************************************
2183 
2184 
2185 
2186 
2187 //=================================================================================================
2188 //
2189 // MAXSIZE SPECIALIZATIONS
2190 //
2191 //=================================================================================================
2192 
2193 //*************************************************************************************************
2195 template< typename MT, bool SO, bool DF >
2196 struct MaxSize< UniUpperMatrix<MT,SO,DF>, 0UL >
2197  : public MaxSize<MT,0UL>
2198 {};
2199 
2200 template< typename MT, bool SO, bool DF >
2201 struct MaxSize< UniUpperMatrix<MT,SO,DF>, 1UL >
2202  : public MaxSize<MT,1UL>
2203 {};
2205 //*************************************************************************************************
2206 
2207 
2208 
2209 
2210 //=================================================================================================
2211 //
2212 // ISSQUARE SPECIALIZATIONS
2213 //
2214 //=================================================================================================
2215 
2216 //*************************************************************************************************
2218 template< typename MT, bool SO, bool DF >
2219 struct IsSquare< UniUpperMatrix<MT,SO,DF> >
2220  : public TrueType
2221 {};
2223 //*************************************************************************************************
2224 
2225 
2226 
2227 
2228 //=================================================================================================
2229 //
2230 // ISUNIUPPER SPECIALIZATIONS
2231 //
2232 //=================================================================================================
2233 
2234 //*************************************************************************************************
2236 template< typename MT, bool SO, bool DF >
2237 struct IsUniUpper< UniUpperMatrix<MT,SO,DF> >
2238  : public TrueType
2239 {};
2241 //*************************************************************************************************
2242 
2243 
2244 
2245 
2246 //=================================================================================================
2247 //
2248 // ISADAPTOR SPECIALIZATIONS
2249 //
2250 //=================================================================================================
2251 
2252 //*************************************************************************************************
2254 template< typename MT, bool SO, bool DF >
2255 struct IsAdaptor< UniUpperMatrix<MT,SO,DF> >
2256  : public TrueType
2257 {};
2259 //*************************************************************************************************
2260 
2261 
2262 
2263 
2264 //=================================================================================================
2265 //
2266 // ISRESTRICTED SPECIALIZATIONS
2267 //
2268 //=================================================================================================
2269 
2270 //*************************************************************************************************
2272 template< typename MT, bool SO, bool DF >
2273 struct IsRestricted< UniUpperMatrix<MT,SO,DF> >
2274  : public TrueType
2275 {};
2277 //*************************************************************************************************
2278 
2279 
2280 
2281 
2282 //=================================================================================================
2283 //
2284 // HASCONSTDATAACCESS SPECIALIZATIONS
2285 //
2286 //=================================================================================================
2287 
2288 //*************************************************************************************************
2290 template< typename MT, bool SO >
2291 struct HasConstDataAccess< UniUpperMatrix<MT,SO,true> >
2292  : public TrueType
2293 {};
2295 //*************************************************************************************************
2296 
2297 
2298 
2299 
2300 //=================================================================================================
2301 //
2302 // ISALIGNED SPECIALIZATIONS
2303 //
2304 //=================================================================================================
2305 
2306 //*************************************************************************************************
2308 template< typename MT, bool SO, bool DF >
2309 struct IsAligned< UniUpperMatrix<MT,SO,DF> >
2310  : public IsAligned<MT>
2311 {};
2313 //*************************************************************************************************
2314 
2315 
2316 
2317 
2318 //=================================================================================================
2319 //
2320 // ISCONTIGUOUS SPECIALIZATIONS
2321 //
2322 //=================================================================================================
2323 
2324 //*************************************************************************************************
2326 template< typename MT, bool SO, bool DF >
2327 struct IsContiguous< UniUpperMatrix<MT,SO,DF> >
2328  : public IsContiguous<MT>
2329 {};
2331 //*************************************************************************************************
2332 
2333 
2334 
2335 
2336 //=================================================================================================
2337 //
2338 // ISPADDED SPECIALIZATIONS
2339 //
2340 //=================================================================================================
2341 
2342 //*************************************************************************************************
2344 template< typename MT, bool SO, bool DF >
2345 struct IsPadded< UniUpperMatrix<MT,SO,DF> >
2346  : public IsPadded<MT>
2347 {};
2349 //*************************************************************************************************
2350 
2351 
2352 
2353 
2354 //=================================================================================================
2355 //
2356 // ISRESIZABLE SPECIALIZATIONS
2357 //
2358 //=================================================================================================
2359 
2360 //*************************************************************************************************
2362 template< typename MT, bool SO, bool DF >
2363 struct IsResizable< UniUpperMatrix<MT,SO,DF> >
2364  : public IsResizable<MT>
2365 {};
2367 //*************************************************************************************************
2368 
2369 
2370 
2371 
2372 //=================================================================================================
2373 //
2374 // ISSHRINKABLE SPECIALIZATIONS
2375 //
2376 //=================================================================================================
2377 
2378 //*************************************************************************************************
2380 template< typename MT, bool SO, bool DF >
2381 struct IsShrinkable< UniUpperMatrix<MT,SO,DF> >
2382  : public IsShrinkable<MT>
2383 {};
2385 //*************************************************************************************************
2386 
2387 
2388 
2389 
2390 //=================================================================================================
2391 //
2392 // REMOVEADAPTOR SPECIALIZATIONS
2393 //
2394 //=================================================================================================
2395 
2396 //*************************************************************************************************
2398 template< typename MT, bool SO, bool DF >
2399 struct RemoveAdaptor< UniUpperMatrix<MT,SO,DF> >
2400 {
2401  using Type = MT;
2402 };
2404 //*************************************************************************************************
2405 
2406 
2407 
2408 
2409 //=================================================================================================
2410 //
2411 // ADDTRAIT SPECIALIZATIONS
2412 //
2413 //=================================================================================================
2414 
2415 //*************************************************************************************************
2417 template< typename T1, typename T2 >
2418 struct AddTraitEval1< T1, T2
2419  , EnableIf_t< IsMatrix_v<T1> &&
2420  IsMatrix_v<T2> &&
2421  ( ( IsUniUpper_v<T1> && IsStrictlyUpper_v<T2> &&
2422  !( IsUniLower_v<T1> && IsStrictlyLower_v<T2> ) ) ||
2423  ( IsStrictlyUpper_v<T1> && IsUniUpper_v<T2> &&
2424  !( IsStrictlyLower_v<T1> && IsUniLower_v<T2> ) ) ) &&
2425  !( IsZero_v<T1> || IsZero_v<T2> ) > >
2426 {
2427  using Type = UniUpperMatrix< typename AddTraitEval2<T1,T2>::Type >;
2428 };
2430 //*************************************************************************************************
2431 
2432 
2433 
2434 
2435 //=================================================================================================
2436 //
2437 // SUBTRAIT SPECIALIZATIONS
2438 //
2439 //=================================================================================================
2440 
2441 //*************************************************************************************************
2443 template< typename T1, typename T2 >
2444 struct SubTraitEval1< T1, T2
2445  , EnableIf_t< IsMatrix_v<T1> &&
2446  IsMatrix_v<T2> &&
2447  ( IsUniUpper_v<T1> && IsStrictlyUpper_v<T2> &&
2448  !( IsUniLower_v<T1> && IsStrictlyLower_v<T2> ) ) &&
2449  !( IsZero_v<T1> || IsZero_v<T2> ) > >
2450 {
2451  using Type = UniUpperMatrix< typename SubTraitEval2<T1,T2>::Type >;
2452 };
2454 //*************************************************************************************************
2455 
2456 
2457 
2458 
2459 //=================================================================================================
2460 //
2461 // SCHURTRAIT SPECIALIZATIONS
2462 //
2463 //=================================================================================================
2464 
2465 //*************************************************************************************************
2467 template< typename T1, typename T2 >
2468 struct SchurTraitEval1< T1, T2
2469  , EnableIf_t< IsMatrix_v<T1> &&
2470  IsMatrix_v<T2> &&
2471  ( IsUniUpper_v<T1> && IsUniUpper_v<T2> ) &&
2472  !( IsDiagonal_v<T1> || IsDiagonal_v<T2> ) &&
2473  !( IsZero_v<T1> || IsZero_v<T2> ) > >
2474 {
2475  using Type = UniUpperMatrix< typename SchurTraitEval2<T1,T2>::Type >;
2476 };
2478 //*************************************************************************************************
2479 
2480 
2481 
2482 
2483 //=================================================================================================
2484 //
2485 // MULTTRAIT SPECIALIZATIONS
2486 //
2487 //=================================================================================================
2488 
2489 //*************************************************************************************************
2491 template< typename T1, typename T2 >
2492 struct MultTraitEval1< T1, T2
2493  , EnableIf_t< IsMatrix_v<T1> &&
2494  IsMatrix_v<T2> &&
2495  ( IsUniUpper_v<T1> && IsUniUpper_v<T2> ) &&
2496  !( IsIdentity_v<T1> || IsIdentity_v<T2> ) > >
2497 {
2498  using Type = UniUpperMatrix< typename MultTraitEval2<T1,T2>::Type >;
2499 };
2501 //*************************************************************************************************
2502 
2503 
2504 
2505 
2506 //=================================================================================================
2507 //
2508 // MAPTRAIT SPECIALIZATIONS
2509 //
2510 //=================================================================================================
2511 
2512 //*************************************************************************************************
2514 template< typename T, typename OP >
2515 struct UnaryMapTraitEval1< T, OP
2516  , EnableIf_t< YieldsUniUpper_v<OP,T> &&
2517  !YieldsIdentity_v<OP,T> > >
2518 {
2519  using Type = UniUpperMatrix< typename UnaryMapTraitEval2<T,OP>::Type, StorageOrder_v<T> >;
2520 };
2522 //*************************************************************************************************
2523 
2524 
2525 //*************************************************************************************************
2527 template< typename T1, typename T2, typename OP >
2528 struct BinaryMapTraitEval1< T1, T2, OP
2529  , EnableIf_t< YieldsUniUpper_v<OP,T1,T2> &&
2530  !YieldsIdentity_v<OP,T1,T2> > >
2531 {
2532  using Type = UniUpperMatrix< typename BinaryMapTraitEval2<T1,T2,OP>::Type >;
2533 };
2535 //*************************************************************************************************
2536 
2537 
2538 
2539 
2540 //=================================================================================================
2541 //
2542 // DECLSYMTRAIT SPECIALIZATIONS
2543 //
2544 //=================================================================================================
2545 
2546 //*************************************************************************************************
2548 template< typename MT, bool SO, bool DF >
2549 struct DeclSymTrait< UniUpperMatrix<MT,SO,DF> >
2550 {
2551  using Type = IdentityMatrix< ElementType_t<MT>, SO >;
2552 };
2554 //*************************************************************************************************
2555 
2556 
2557 
2558 
2559 //=================================================================================================
2560 //
2561 // DECLHERMTRAIT SPECIALIZATIONS
2562 //
2563 //=================================================================================================
2564 
2565 //*************************************************************************************************
2567 template< typename MT, bool SO, bool DF >
2568 struct DeclHermTrait< UniUpperMatrix<MT,SO,DF> >
2569 {
2570  using Type = IdentityMatrix< ElementType_t<MT>, SO >;
2571 };
2573 //*************************************************************************************************
2574 
2575 
2576 
2577 
2578 //=================================================================================================
2579 //
2580 // DECLLOWTRAIT SPECIALIZATIONS
2581 //
2582 //=================================================================================================
2583 
2584 //*************************************************************************************************
2586 template< typename MT, bool SO, bool DF >
2587 struct DeclLowTrait< UniUpperMatrix<MT,SO,DF> >
2588 {
2589  using Type = IdentityMatrix< ElementType_t<MT>, SO >;
2590 };
2592 //*************************************************************************************************
2593 
2594 
2595 
2596 
2597 //=================================================================================================
2598 //
2599 // DECLUPPTRAIT SPECIALIZATIONS
2600 //
2601 //=================================================================================================
2602 
2603 //*************************************************************************************************
2605 template< typename MT, bool SO, bool DF >
2606 struct DeclUppTrait< UniUpperMatrix<MT,SO,DF> >
2607 {
2608  using Type = UniUpperMatrix<MT,SO,DF>;
2609 };
2611 //*************************************************************************************************
2612 
2613 
2614 
2615 
2616 //=================================================================================================
2617 //
2618 // DECLDIAGTRAIT SPECIALIZATIONS
2619 //
2620 //=================================================================================================
2621 
2622 //*************************************************************************************************
2624 template< typename MT, bool SO, bool DF >
2625 struct DeclDiagTrait< UniUpperMatrix<MT,SO,DF> >
2626 {
2627  using Type = IdentityMatrix< ElementType_t<MT>, SO >;
2628 };
2630 //*************************************************************************************************
2631 
2632 
2633 
2634 
2635 //=================================================================================================
2636 //
2637 // HIGHTYPE SPECIALIZATIONS
2638 //
2639 //=================================================================================================
2640 
2641 //*************************************************************************************************
2643 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2644 struct HighType< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2645 {
2646  using Type = UniUpperMatrix< typename HighType<MT1,MT2>::Type >;
2647 };
2649 //*************************************************************************************************
2650 
2651 
2652 
2653 
2654 //=================================================================================================
2655 //
2656 // LOWTYPE SPECIALIZATIONS
2657 //
2658 //=================================================================================================
2659 
2660 //*************************************************************************************************
2662 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2663 struct LowType< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2664 {
2665  using Type = UniUpperMatrix< typename LowType<MT1,MT2>::Type >;
2666 };
2668 //*************************************************************************************************
2669 
2670 
2671 
2672 
2673 //=================================================================================================
2674 //
2675 // SUBMATRIXTRAIT SPECIALIZATIONS
2676 //
2677 //=================================================================================================
2678 
2679 //*************************************************************************************************
2681 template< typename MT, size_t I, size_t N >
2682 struct SubmatrixTraitEval1< MT, I, I, N, N
2683  , EnableIf_t< IsUniUpper_v<MT> &&
2684  !IsIdentity_v<MT> > >
2685 {
2686  using Type = UniUpperMatrix< typename SubmatrixTraitEval2<MT,I,I,N,N>::Type >;
2687 };
2689 //*************************************************************************************************
2690 
2691 } // namespace blaze
2692 
2693 #endif
BoolConstant< false > FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: FalseType.h:61
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 IsUniUpper_v
Auxiliary variable template for the IsUniUpper type trait.The IsUniUpper_v variable template provides...
Definition: IsUniUpper.h:172
Header file for the UNUSED_PARAMETER function template.
Header file for the IsUniUpper type trait.
Header file for the subtraction trait.
Flag for the inversion of a diagonal matrix.
Definition: InversionFlag.h:115
Flag for the inversion of a general matrix (same as byLU).
Definition: InversionFlag.h:108
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.The IsMatrix_v variable template provides a c...
Definition: IsMatrix.h:139
Header file for the declherm trait.
Flag for the inversion of a upper unitriangular matrix.
Definition: InversionFlag.h:114
Flag for the inversion of a lower unitriangular matrix.
Definition: InversionFlag.h:112
Header file for the IsDiagonal type trait.
Header file for the dense matrix inversion flags.
UniUpperMatrix specialization for sparse matrices.
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
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 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: TrueType.h:61
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Constraint on the data type.
Header file for the IsUniLower type trait.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is an identity matrix.
Definition: DenseMatrix.h:1644
Constraint on the data type.
Header file for the IsMatrix type trait.
Header file for the IsSquare type trait.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:775
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.
Header file for all forward declarations of the math module.
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:1147
Header file for the decllow trait.
void lu(const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO1 > &L, DenseMatrix< MT3, SO1 > &U, Matrix< MT4, SO2 > &P)
LU decomposition of the given dense matrix.
Definition: LU.h:221
constexpr bool YieldsUniUpper_v
Auxiliary variable template for the YieldsUniUpper type trait.The YieldsUniUpper_v variable template ...
Definition: YieldsUniUpper.h:125
Header file for the IsAligned type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type...
Definition: Upper.h:81
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:738
MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:438
Header file for the RemoveAdaptor type trait.
Constraint on the data type.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:611
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:135
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:75
Header file for the declupp trait.
Matrix adapter for upper unitriangular matrices.
Definition: BaseTemplate.h:576
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
Header file for run time assertion macros.
Header file for the addition trait.
Header file for the submatrix trait.
Constraint on the data type.
Header file for the IsContiguous type trait.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
Header file for the IsZero type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
Header file for the declsym trait.
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:693
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:281
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
#define BLAZE_CONSTRAINT_MUST_BE_BLAS_COMPATIBLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a BLAS compatible data type (i...
Definition: BLASCompatible.h:61
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
UniUpperMatrix specialization for dense matrices.
Header file for the StorageOrder type trait.
Header file for the map trait.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:631
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
Header file for the YieldsUniUpper type trait.
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
Header file for the Size type trait.
InversionFlag
Inversion flag.The InversionFlag type enumeration represents the different types of matrix inversion ...
Definition: InversionFlag.h:101
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the implementation of the base template of the UniUpperMatrix.
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.