UpperMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_UPPERMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_UPPERMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
54 #include <blaze/math/Exception.h>
55 #include <blaze/math/Forward.h>
103 #include <blaze/util/Assert.h>
104 #include <blaze/util/EnableIf.h>
105 #include <blaze/util/TrueType.h>
107 #include <blaze/util/Unused.h>
108 
109 
110 namespace blaze {
111 
112 //=================================================================================================
113 //
114 // UPPERMATRIX OPERATORS
115 //
116 //=================================================================================================
117 
118 //*************************************************************************************************
121 template< typename MT, bool SO, bool DF >
122 void reset( UpperMatrix<MT,SO,DF>& m );
123 
124 template< typename MT, bool SO, bool DF >
125 void reset( UpperMatrix<MT,SO,DF>& m, size_t i );
126 
127 template< typename MT, bool SO, bool DF >
128 void clear( UpperMatrix<MT,SO,DF>& m );
129 
130 template< bool RF, typename MT, bool SO, bool DF >
131 bool isDefault( const UpperMatrix<MT,SO,DF>& m );
132 
133 template< typename MT, bool SO, bool DF >
134 bool isIntact( const UpperMatrix<MT,SO,DF>& m );
135 
136 template< typename MT, bool SO, bool DF >
137 void swap( UpperMatrix<MT,SO,DF>& a, UpperMatrix<MT,SO,DF>& b ) noexcept;
139 //*************************************************************************************************
140 
141 
142 //*************************************************************************************************
149 template< typename MT // Type of the adapted matrix
150  , bool SO // Storage order of the adapted matrix
151  , bool DF > // Density flag
152 inline void reset( UpperMatrix<MT,SO,DF>& m )
153 {
154  m.reset();
155 }
156 //*************************************************************************************************
157 
158 
159 //*************************************************************************************************
172 template< typename MT // Type of the adapted matrix
173  , bool SO // Storage order of the adapted matrix
174  , bool DF > // Density flag
175 inline void reset( UpperMatrix<MT,SO,DF>& m, size_t i )
176 {
177  m.reset( i );
178 }
179 //*************************************************************************************************
180 
181 
182 //*************************************************************************************************
189 template< typename MT // Type of the adapted matrix
190  , bool SO // Storage order of the adapted matrix
191  , bool DF > // Density flag
192 inline void clear( UpperMatrix<MT,SO,DF>& m )
193 {
194  m.clear();
195 }
196 //*************************************************************************************************
197 
198 
199 //*************************************************************************************************
227 template< bool RF // Relaxation flag
228  , typename MT // Type of the adapted matrix
229  , bool SO // Storage order of the adapted matrix
230  , bool DF > // Density flag
231 inline bool isDefault( const UpperMatrix<MT,SO,DF>& m )
232 {
233  return isDefault<RF>( m.matrix_ );
234 }
235 //*************************************************************************************************
236 
237 
238 //*************************************************************************************************
259 template< typename MT // Type of the adapted matrix
260  , bool SO // Storage order of the adapted matrix
261  , bool DF > // Density flag
262 inline bool isIntact( const UpperMatrix<MT,SO,DF>& m )
263 {
264  return m.isIntact();
265 }
266 //*************************************************************************************************
267 
268 
269 //*************************************************************************************************
277 template< typename MT // Type of the adapted matrix
278  , bool SO // Storage order of the adapted matrix
279  , bool DF > // Density flag
280 inline void swap( UpperMatrix<MT,SO,DF>& a, UpperMatrix<MT,SO,DF>& b ) noexcept
281 {
282  a.swap( b );
283 }
284 //*************************************************************************************************
285 
286 
287 //*************************************************************************************************
310 template< InversionFlag IF // Inversion algorithm
311  , typename MT // Type of the dense matrix
312  , bool SO > // Storage order of the dense matrix
313 inline void invert( UpperMatrix<MT,SO,true>& m )
314 {
316 
317  if( IF == asUniLower ) {
318  BLAZE_INTERNAL_ASSERT( isIdentity( m ), "Violation of preconditions detected" );
319  return;
320  }
321 
322  constexpr InversionFlag flag( ( IF == byLU || IF == asGeneral || IF == asUpper )
323  ? ( asUpper )
324  : ( ( IF == asUniUpper )
325  ?( asUniUpper )
326  :( asDiagonal ) ) );
327 
328  invert<flag>( derestrict( m ) );
329 
330  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
331 }
333 //*************************************************************************************************
334 
335 
336 //*************************************************************************************************
355 template< typename MT1, bool SO1, typename MT2, typename MT3, typename MT4, bool SO2 >
356 inline void lu( const UpperMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
357  DenseMatrix<MT3,SO1>& U, Matrix<MT4,SO2>& P )
358 {
359  BLAZE_CONSTRAINT_MUST_BE_BLAS_COMPATIBLE_TYPE( ElementType_t<MT1> );
360 
365 
370 
371  using ET2 = ElementType_t<MT2>;
372  using ET4 = ElementType_t<MT4>;
373 
374  const size_t n( (~A).rows() );
375 
376  decltype(auto) L2( derestrict( ~L ) );
377 
378  (~U) = A;
379 
380  resize( ~L, n, n );
381  reset( L2 );
382 
383  resize( ~P, n, n );
384  reset( ~P );
385 
386  for( size_t i=0UL; i<n; ++i ) {
387  L2(i,i) = ET2(1);
388  (~P)(i,i) = ET4(1);
389  }
390 }
392 //*************************************************************************************************
393 
394 
395 //*************************************************************************************************
411 template< typename MT // Type of the adapted matrix
412  , bool SO // Storage order of the adapted matrix
413  , bool DF // Density flag
414  , typename ET > // Type of the element
415 inline bool trySet( const UpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
416 {
417  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
418  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
419 
420  UNUSED_PARAMETER( mat );
421 
422  return ( i <= j || isDefault( value ) );
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 tryAdd( const UpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
449 {
450  return trySet( mat, i, j, value );
451 }
453 //*************************************************************************************************
454 
455 
456 //*************************************************************************************************
472 template< typename MT // Type of the adapted matrix
473  , bool SO // Storage order of the adapted matrix
474  , bool DF // Density flag
475  , typename ET > // Type of the element
476 inline bool trySub( const UpperMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
477 {
478  return trySet( mat, i, j, value );
479 }
481 //*************************************************************************************************
482 
483 
484 //*************************************************************************************************
500 template< typename MT // Type of the adapted matrix
501  , bool SO // Storage order of the adapted matrix
502  , bool DF // Density flag
503  , typename VT > // Type of the right-hand side dense vector
504 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs,
505  const DenseVector<VT,false>& rhs, size_t row, size_t column )
506 {
508 
509  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
510  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
511  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
512 
513  UNUSED_PARAMETER( lhs );
514 
515  const size_t ibegin( ( column < row )?( 0UL ):( column - row + 1UL ) );
516 
517  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
518  if( !isDefault( (~rhs)[i] ) )
519  return false;
520  }
521 
522  return true;
523 }
525 //*************************************************************************************************
526 
527 
528 //*************************************************************************************************
544 template< typename MT // Type of the adapted matrix
545  , bool SO // Storage order of the adapted matrix
546  , bool DF // Density flag
547  , typename VT > // Type of the right-hand side dense vector
548 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs,
549  const DenseVector<VT,true>& rhs, size_t row, size_t column )
550 {
552 
553  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
554  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
555  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
556 
557  UNUSED_PARAMETER( lhs );
558 
559  if( row <= column )
560  return true;
561 
562  const size_t iend( min( row - column, (~rhs).size() ) );
563 
564  for( size_t i=0UL; i<iend; ++i ) {
565  if( !isDefault( (~rhs)[i] ) )
566  return false;
567  }
568 
569  return true;
570 }
572 //*************************************************************************************************
573 
574 
575 //*************************************************************************************************
593 template< typename MT // Type of the adapted matrix
594  , bool SO // Storage order of the adapted matrix
595  , bool DF // Density flag
596  , typename VT // Type of the right-hand side dense vector
597  , bool TF > // Transpose flag of the right-hand side dense vector
598 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
599  ptrdiff_t band, size_t row, size_t column )
600 {
602 
603  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
604  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
605  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
606  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
607 
608  UNUSED_PARAMETER( lhs, row, column );
609 
610  if( band < 0L ) {
611  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
612  if( !isDefault( (~rhs)[i] ) )
613  return false;
614  }
615  }
616 
617  return true;
618 }
620 //*************************************************************************************************
621 
622 
623 //*************************************************************************************************
639 template< typename MT // Type of the adapted matrix
640  , bool SO // Storage order of the adapted matrix
641  , bool DF // Density flag
642  , typename VT > // Type of the right-hand side sparse vector
643 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs,
644  const SparseVector<VT,false>& rhs, size_t row, size_t column )
645 {
647 
648  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
649  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
650  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
651 
652  UNUSED_PARAMETER( lhs );
653 
654  const auto last( (~rhs).end() );
655  auto element( (~rhs).lowerBound( ( column < row )?( 0UL ):( column - row + 1UL ) ) );
656 
657  for( ; element!=last; ++element ) {
658  if( !isDefault( element->value() ) )
659  return false;
660  }
661 
662  return true;
663 }
665 //*************************************************************************************************
666 
667 
668 //*************************************************************************************************
684 template< typename MT // Type of the adapted matrix
685  , bool SO // Storage order of the adapted matrix
686  , bool DF // Density flag
687  , typename VT > // Type of the right-hand side sparse vector
688 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs,
689  const SparseVector<VT,true>& rhs, size_t row, size_t column )
690 {
692 
693  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
694  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
695  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
696 
697  UNUSED_PARAMETER( lhs );
698 
699  if( row <= column )
700  return true;
701 
702  const auto last( (~rhs).lowerBound( row - column ) );
703 
704  for( auto element=(~rhs).begin(); element!=last; ++element ) {
705  if( !isDefault( element->value() ) )
706  return false;
707  }
708 
709  return true;
710 }
712 //*************************************************************************************************
713 
714 
715 //*************************************************************************************************
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 sparse vector
737  , bool TF > // Transpose flag of the right-hand side sparse vector
738 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
739  ptrdiff_t band, size_t row, size_t column )
740 {
742 
743  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
744  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
745  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
746  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
747 
748  UNUSED_PARAMETER( lhs, row, column );
749 
750  if( band < 0L ) {
751  for( const auto& element : ~rhs ) {
752  if( !isDefault( element.value() ) )
753  return false;
754  }
755  }
756 
757  return true;
758 }
760 //*************************************************************************************************
761 
762 
763 //*************************************************************************************************
779 template< typename MT1 // Type of the adapted matrix
780  , bool SO // Storage order of the adapted matrix
781  , bool DF // Density flag
782  , typename MT2 > // Type of the right-hand side dense matrix
783 inline bool tryAssign( const UpperMatrix<MT1,SO,DF>& lhs,
784  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
785 {
787 
788  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
789  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
790  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
791  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
792 
793  UNUSED_PARAMETER( lhs );
794 
795  const size_t M( (~rhs).rows() );
796  const size_t N( (~rhs).columns() );
797 
798  if( column + 1UL >= row + M )
799  return true;
800 
801  const size_t ibegin( ( column < row )?( 0UL ):( column - row + 1UL ) );
802 
803  for( size_t i=ibegin; i<M; ++i )
804  {
805  const size_t jend( min( row + i - column, N ) );
806 
807  for( size_t j=0UL; j<jend; ++j ) {
808  if( !isDefault( (~rhs)(i,j) ) )
809  return false;
810  }
811  }
812 
813  return true;
814 }
816 //*************************************************************************************************
817 
818 
819 //*************************************************************************************************
835 template< typename MT1 // Type of the adapted matrix
836  , bool SO // Storage order of the adapted matrix
837  , bool DF // Density flag
838  , typename MT2 > // Type of the right-hand side dense matrix
839 inline bool tryAssign( const UpperMatrix<MT1,SO,DF>& lhs,
840  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
841 {
843 
844  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
845  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
846  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
847  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
848 
849  UNUSED_PARAMETER( lhs );
850 
851  const size_t M( (~rhs).rows() );
852  const size_t N( (~rhs).columns() );
853 
854  if( column + 1UL >= row + M )
855  return true;
856 
857  const size_t jend( min( row + M - column - 1UL, N ) );
858 
859  for( size_t j=0UL; j<jend; ++j )
860  {
861  const bool containsDiagonal( column + j >= row );
862  const size_t ibegin( ( containsDiagonal )?( column + j - row + 1UL ):( 0UL ) );
863 
864  for( size_t i=ibegin; i<M; ++i ) {
865  if( !isDefault( (~rhs)(i,j) ) )
866  return false;
867  }
868  }
869 
870  return true;
871 }
873 //*************************************************************************************************
874 
875 
876 //*************************************************************************************************
892 template< typename MT1 // Type of the adapted matrix
893  , bool SO // Storage order of the adapted matrix
894  , bool DF // Density flag
895  , typename MT2 > // Type of the right-hand side sparse matrix
896 inline bool tryAssign( const UpperMatrix<MT1,SO,DF>& lhs,
897  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
898 {
900 
901  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
902  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
903  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
904  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
905 
906  UNUSED_PARAMETER( lhs );
907 
908  const size_t M( (~rhs).rows() );
909  const size_t N( (~rhs).columns() );
910 
911  if( column + 1UL >= row + M )
912  return true;
913 
914  const size_t ibegin( ( column < row )?( 0UL ):( column - row + 1UL ) );
915 
916  for( size_t i=ibegin; i<M; ++i )
917  {
918  const size_t index( row + i - column );
919  const auto last( (~rhs).lowerBound( i, min( index, N ) ) );
920 
921  for( auto element=(~rhs).begin(i); element!=last; ++element ) {
922  if( !isDefault( element->value() ) )
923  return false;
924  }
925  }
926 
927  return true;
928 }
930 //*************************************************************************************************
931 
932 
933 //*************************************************************************************************
949 template< typename MT1 // Type of the adapted matrix
950  , bool SO // Storage order of the adapted matrix
951  , bool DF // Density flag
952  , typename MT2 > // Type of the right-hand side sparse matrix
953 inline bool tryAssign( const UpperMatrix<MT1,SO,DF>& lhs,
954  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
955 {
957 
958  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
959  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
960  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
961  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
962 
963  UNUSED_PARAMETER( lhs );
964 
965  const size_t M( (~rhs).rows() );
966  const size_t N( (~rhs).columns() );
967 
968  if( column + 1UL >= row + M )
969  return true;
970 
971  const size_t jend( min( row + M - column - 1UL, N ) );
972 
973  for( size_t j=0UL; j<jend; ++j )
974  {
975  const bool containsDiagonal( column + j >= row );
976  const size_t index( ( containsDiagonal )?( column + j - row + 1UL ):( 0UL ) );
977 
978  const auto last( (~rhs).end(j) );
979  auto element( (~rhs).lowerBound( index, j ) );
980 
981  for( ; element!=last; ++element ) {
982  if( !isDefault( element->value() ) )
983  return false;
984  }
985  }
986 
987  return true;
988 }
990 //*************************************************************************************************
991 
992 
993 //*************************************************************************************************
1009 template< typename MT // Type of the adapted matrix
1010  , bool SO // Storage order of the adapted matrix
1011  , bool DF // Density flag
1012  , typename VT // Type of the right-hand side vector
1013  , bool TF > // Transpose flag of the right-hand side vector
1014 inline bool tryAddAssign( const UpperMatrix<MT,SO,DF>& lhs,
1015  const Vector<VT,TF>& rhs, size_t row, size_t column )
1016 {
1017  return tryAssign( lhs, ~rhs, row, column );
1018 }
1020 //*************************************************************************************************
1021 
1022 
1023 //*************************************************************************************************
1041 template< typename MT // Type of the adapted matrix
1042  , bool SO // Storage order of the adapted matrix
1043  , bool DF // Density flag
1044  , typename VT // Type of the right-hand side vector
1045  , bool TF > // Transpose flag of the right-hand side vector
1046 inline bool tryAddAssign( const UpperMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
1047  ptrdiff_t band, size_t row, size_t column )
1048 {
1049  return tryAssign( lhs, ~rhs, band, row, column );
1050 }
1052 //*************************************************************************************************
1053 
1054 
1055 //*************************************************************************************************
1071 template< typename MT1 // Type of the adapted matrix
1072  , bool SO1 // Storage order of the adapted matrix
1073  , bool DF // Density flag
1074  , typename MT2 // Type of the right-hand side matrix
1075  , bool SO2 > // Storage order of the right-hand side matrix
1076 inline bool tryAddAssign( const UpperMatrix<MT1,SO1,DF>& lhs,
1077  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1078 {
1079  return tryAssign( lhs, ~rhs, row, column );
1080 }
1082 //*************************************************************************************************
1083 
1084 
1085 //*************************************************************************************************
1101 template< typename MT // Type of the adapted matrix
1102  , bool SO // Storage order of the adapted matrix
1103  , bool DF // Density flag
1104  , typename VT // Type of the right-hand side vector
1105  , bool TF > // Transpose flag of the right-hand side vector
1106 inline bool trySubAssign( const UpperMatrix<MT,SO,DF>& lhs,
1107  const Vector<VT,TF>& rhs, size_t row, size_t column )
1108 {
1109  return tryAssign( lhs, ~rhs, row, column );
1110 }
1112 //*************************************************************************************************
1113 
1114 
1115 //*************************************************************************************************
1133 template< typename MT // Type of the adapted matrix
1134  , bool SO // Storage order of the adapted matrix
1135  , bool DF // Density flag
1136  , typename VT // Type of the right-hand side vector
1137  , bool TF > // Transpose flag of the right-hand side vector
1138 inline bool trySubAssign( const UpperMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
1139  ptrdiff_t band, size_t row, size_t column )
1140 {
1141  return tryAssign( lhs, ~rhs, band, row, column );
1142 }
1144 //*************************************************************************************************
1145 
1146 
1147 //*************************************************************************************************
1163 template< typename MT1 // Type of the adapted matrix
1164  , bool SO1 // Storage order of the adapted matrix
1165  , bool DF // Density flag
1166  , typename MT2 // Type of the right-hand side matrix
1167  , bool SO2 > // Storage order of the right-hand side matrix
1168 inline bool trySubAssign( const UpperMatrix<MT1,SO1,DF>& lhs,
1169  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1170 {
1171  return tryAssign( lhs, ~rhs, row, column );
1172 }
1174 //*************************************************************************************************
1175 
1176 
1177 //*************************************************************************************************
1191 template< typename MT // Type of the adapted matrix
1192  , bool SO // Storage order of the adapted matrix
1193  , bool DF > // Density flag
1194 inline MT& derestrict( UpperMatrix<MT,SO,DF>& m )
1195 {
1196  return m.matrix_;
1197 }
1199 //*************************************************************************************************
1200 
1201 
1202 
1203 
1204 //=================================================================================================
1205 //
1206 // SIZE SPECIALIZATIONS
1207 //
1208 //=================================================================================================
1209 
1210 //*************************************************************************************************
1212 template< typename MT, bool SO, bool DF >
1213 struct Size< UpperMatrix<MT,SO,DF>, 0UL >
1214  : public Size<MT,0UL>
1215 {};
1216 
1217 template< typename MT, bool SO, bool DF >
1218 struct Size< UpperMatrix<MT,SO,DF>, 1UL >
1219  : public Size<MT,1UL>
1220 {};
1222 //*************************************************************************************************
1223 
1224 
1225 
1226 
1227 //=================================================================================================
1228 //
1229 // MAXSIZE SPECIALIZATIONS
1230 //
1231 //=================================================================================================
1232 
1233 //*************************************************************************************************
1235 template< typename MT, bool SO, bool DF >
1236 struct MaxSize< UpperMatrix<MT,SO,DF>, 0UL >
1237  : public MaxSize<MT,0UL>
1238 {};
1239 
1240 template< typename MT, bool SO, bool DF >
1241 struct MaxSize< UpperMatrix<MT,SO,DF>, 1UL >
1242  : public MaxSize<MT,1UL>
1243 {};
1245 //*************************************************************************************************
1246 
1247 
1248 
1249 
1250 //=================================================================================================
1251 //
1252 // ISSQUARE SPECIALIZATIONS
1253 //
1254 //=================================================================================================
1255 
1256 //*************************************************************************************************
1258 template< typename MT, bool SO, bool DF >
1259 struct IsSquare< UpperMatrix<MT,SO,DF> >
1260  : public TrueType
1261 {};
1263 //*************************************************************************************************
1264 
1265 
1266 
1267 
1268 //=================================================================================================
1269 //
1270 // ISUNIFORM SPECIALIZATIONS
1271 //
1272 //=================================================================================================
1273 
1274 //*************************************************************************************************
1276 template< typename MT, bool SO, bool DF >
1277 struct IsUniform< UpperMatrix<MT,SO,DF> >
1278  : public IsUniform<MT>
1279 {};
1281 //*************************************************************************************************
1282 
1283 
1284 
1285 
1286 //=================================================================================================
1287 //
1288 // ISSYMMETRIC SPECIALIZATIONS
1289 //
1290 //=================================================================================================
1291 
1292 //*************************************************************************************************
1294 template< typename MT, bool SO, bool DF >
1295 struct IsSymmetric< UpperMatrix<MT,SO,DF> >
1296  : public IsZero<MT>
1297 {};
1299 //*************************************************************************************************
1300 
1301 
1302 
1303 
1304 //=================================================================================================
1305 //
1306 // ISHERMITIAN SPECIALIZATIONS
1307 //
1308 //=================================================================================================
1309 
1310 //*************************************************************************************************
1312 template< typename MT, bool SO, bool DF >
1313 struct IsHermitian< UpperMatrix<MT,SO,DF> >
1314  : public IsZero<MT>
1315 {};
1317 //*************************************************************************************************
1318 
1319 
1320 
1321 
1322 //=================================================================================================
1323 //
1324 // ISSTRICLYLOWER SPECIALIZATIONS
1325 //
1326 //=================================================================================================
1327 
1328 //*************************************************************************************************
1330 template< typename MT, bool SO, bool DF >
1331 struct IsStrictlyLower< UpperMatrix<MT,SO,DF> >
1332  : public IsZero<MT>
1333 {};
1335 //*************************************************************************************************
1336 
1337 
1338 
1339 
1340 //=================================================================================================
1341 //
1342 // ISUPPER SPECIALIZATIONS
1343 //
1344 //=================================================================================================
1345 
1346 //*************************************************************************************************
1348 template< typename MT, bool SO, bool DF >
1349 struct IsUpper< UpperMatrix<MT,SO,DF> >
1350  : public TrueType
1351 {};
1353 //*************************************************************************************************
1354 
1355 
1356 
1357 
1358 //=================================================================================================
1359 //
1360 // ISSTRICLYUPPER SPECIALIZATIONS
1361 //
1362 //=================================================================================================
1363 
1364 //*************************************************************************************************
1366 template< typename MT, bool SO, bool DF >
1367 struct IsStrictlyUpper< UpperMatrix<MT,SO,DF> >
1368  : public IsZero<MT>
1369 {};
1371 //*************************************************************************************************
1372 
1373 
1374 
1375 
1376 //=================================================================================================
1377 //
1378 // ISADAPTOR SPECIALIZATIONS
1379 //
1380 //=================================================================================================
1381 
1382 //*************************************************************************************************
1384 template< typename MT, bool SO, bool DF >
1385 struct IsAdaptor< UpperMatrix<MT,SO,DF> >
1386  : public TrueType
1387 {};
1389 //*************************************************************************************************
1390 
1391 
1392 
1393 
1394 //=================================================================================================
1395 //
1396 // ISRESTRICTED SPECIALIZATIONS
1397 //
1398 //=================================================================================================
1399 
1400 //*************************************************************************************************
1402 template< typename MT, bool SO, bool DF >
1403 struct IsRestricted< UpperMatrix<MT,SO,DF> >
1404  : public TrueType
1405 {};
1407 //*************************************************************************************************
1408 
1409 
1410 
1411 
1412 //=================================================================================================
1413 //
1414 // HASCONSTDATAACCESS SPECIALIZATIONS
1415 //
1416 //=================================================================================================
1417 
1418 //*************************************************************************************************
1420 template< typename MT, bool SO >
1421 struct HasConstDataAccess< UpperMatrix<MT,SO,true> >
1422  : public TrueType
1423 {};
1425 //*************************************************************************************************
1426 
1427 
1428 
1429 
1430 //=================================================================================================
1431 //
1432 // ISALIGNED SPECIALIZATIONS
1433 //
1434 //=================================================================================================
1435 
1436 //*************************************************************************************************
1438 template< typename MT, bool SO, bool DF >
1439 struct IsAligned< UpperMatrix<MT,SO,DF> >
1440  : public IsAligned<MT>
1441 {};
1443 //*************************************************************************************************
1444 
1445 
1446 
1447 
1448 //=================================================================================================
1449 //
1450 // ISCONTIGUOUS SPECIALIZATIONS
1451 //
1452 //=================================================================================================
1453 
1454 //*************************************************************************************************
1456 template< typename MT, bool SO, bool DF >
1457 struct IsContiguous< UpperMatrix<MT,SO,DF> >
1458  : public IsContiguous<MT>
1459 {};
1461 //*************************************************************************************************
1462 
1463 
1464 
1465 
1466 //=================================================================================================
1467 //
1468 // ISPADDED SPECIALIZATIONS
1469 //
1470 //=================================================================================================
1471 
1472 //*************************************************************************************************
1474 template< typename MT, bool SO, bool DF >
1475 struct IsPadded< UpperMatrix<MT,SO,DF> >
1476  : public IsPadded<MT>
1477 {};
1479 //*************************************************************************************************
1480 
1481 
1482 
1483 
1484 //=================================================================================================
1485 //
1486 // ISRESIZABLE SPECIALIZATIONS
1487 //
1488 //=================================================================================================
1489 
1490 //*************************************************************************************************
1492 template< typename MT, bool SO, bool DF >
1493 struct IsResizable< UpperMatrix<MT,SO,DF> >
1494  : public IsResizable<MT>
1495 {};
1497 //*************************************************************************************************
1498 
1499 
1500 
1501 
1502 //=================================================================================================
1503 //
1504 // ISSHRINKABLE SPECIALIZATIONS
1505 //
1506 //=================================================================================================
1507 
1508 //*************************************************************************************************
1510 template< typename MT, bool SO, bool DF >
1511 struct IsShrinkable< UpperMatrix<MT,SO,DF> >
1512  : public IsShrinkable<MT>
1513 {};
1515 //*************************************************************************************************
1516 
1517 
1518 
1519 
1520 //=================================================================================================
1521 //
1522 // REMOVEADAPTOR SPECIALIZATIONS
1523 //
1524 //=================================================================================================
1525 
1526 //*************************************************************************************************
1528 template< typename MT, bool SO, bool DF >
1529 struct RemoveAdaptor< UpperMatrix<MT,SO,DF> >
1530 {
1531  using Type = MT;
1532 };
1534 //*************************************************************************************************
1535 
1536 
1537 
1538 
1539 //=================================================================================================
1540 //
1541 // ADDTRAIT SPECIALIZATIONS
1542 //
1543 //=================================================================================================
1544 
1545 //*************************************************************************************************
1547 template< typename T1, typename T2 >
1548 struct AddTraitEval1< T1, T2
1549  , EnableIf_t< IsMatrix_v<T1> &&
1550  IsMatrix_v<T2> &&
1551  ( ( IsUpper_v<T1> && IsUpper_v<T2> ) ||
1552  ( IsUpper_v<T1> && IsDiagonal_v<T2> ) ||
1553  ( IsDiagonal_v<T1> && IsUpper_v<T2> ) ) &&
1554  !( IsUniUpper_v<T1> && IsStrictlyUpper_v<T2> ) &&
1555  !( IsStrictlyUpper_v<T1> && ( IsUniUpper_v<T2> || IsStrictlyUpper_v<T2> ) ) &&
1556  !( IsDiagonal_v<T1> && IsDiagonal_v<T2> ) &&
1557  !( IsUniform_v<T1> && IsUniform_v<T2> ) &&
1558  !( IsZero_v<T1> || IsZero_v<T2> ) > >
1559 {
1560  using Type = UpperMatrix< typename AddTraitEval2<T1,T2>::Type >;
1561 };
1563 //*************************************************************************************************
1564 
1565 
1566 
1567 
1568 //=================================================================================================
1569 //
1570 // SUBTRAIT SPECIALIZATIONS
1571 //
1572 //=================================================================================================
1573 
1574 //*************************************************************************************************
1576 template< typename T1, typename T2 >
1577 struct SubTraitEval1< T1, T2
1578  , EnableIf_t< IsMatrix_v<T1> &&
1579  IsMatrix_v<T2> &&
1580  ( ( IsUpper_v<T1> && IsUpper_v<T2> ) ||
1581  ( IsUpper_v<T1> && IsDiagonal_v<T2> ) ||
1582  ( IsDiagonal_v<T1> && IsUpper_v<T2> ) ) &&
1583  !( IsUniUpper_v<T1> && IsStrictlyUpper_v<T2> ) &&
1584  !( IsUniUpper_v<T1> && IsUniUpper_v<T2> ) &&
1585  !( IsStrictlyUpper_v<T1> && IsStrictlyUpper_v<T2> ) &&
1586  !( IsDiagonal_v<T1> && IsDiagonal_v<T2> ) &&
1587  !( IsZero_v<T1> || IsZero_v<T2> ) > >
1588 {
1589  using Type = UpperMatrix< typename SubTraitEval2<T1,T2>::Type >;
1590 };
1592 //*************************************************************************************************
1593 
1594 
1595 
1596 
1597 //=================================================================================================
1598 //
1599 // SCHURTRAIT SPECIALIZATIONS
1600 //
1601 //=================================================================================================
1602 
1603 //*************************************************************************************************
1605 template< typename T1, typename T2 >
1606 struct SchurTraitEval1< T1, T2
1607  , EnableIf_t< IsMatrix_v<T1> &&
1608  IsMatrix_v<T2> &&
1609  ( ( IsUpper_v<T1> && !IsLower_v<T2> ) ||
1610  ( !IsLower_v<T1> && IsUpper_v<T2> ) ) &&
1611  !( IsUniUpper_v<T1> && IsUniUpper_v<T2> ) &&
1612  !( IsStrictlyUpper_v<T1> || IsStrictlyUpper_v<T2> ) &&
1613  !( IsDiagonal_v<T1> || IsDiagonal_v<T2> ) &&
1614  !( IsZero_v<T1> || IsZero_v<T2> ) > >
1615 {
1616  using Type = UpperMatrix< typename SchurTraitEval2<T1,T2>::Type >;
1617 };
1619 //*************************************************************************************************
1620 
1621 
1622 
1623 
1624 //=================================================================================================
1625 //
1626 // MULTTRAIT SPECIALIZATIONS
1627 //
1628 //=================================================================================================
1629 
1630 //*************************************************************************************************
1632 template< typename T1, typename T2 >
1633 struct MultTraitEval1< T1, T2
1634  , EnableIf_t< IsMatrix_v<T1> &&
1635  IsNumeric_v<T2> &&
1636  ( IsUpper_v<T1> && !IsStrictlyUpper_v<T1> &&
1637  !IsDiagonal_v<T1> && !IsUniform_v<T1> ) > >
1638 {
1639  using Type = UpperMatrix< typename MultTraitEval2<T1,T2>::Type >;
1640 };
1641 
1642 template< typename T1, typename T2 >
1643 struct MultTraitEval1< T1, T2
1644  , EnableIf_t< IsNumeric_v<T1> &&
1645  IsMatrix_v<T2> &&
1646  ( IsUpper_v<T2> && !IsStrictlyUpper_v<T2> &&
1647  !IsDiagonal_v<T2> && !IsUniform_v<T2> ) > >
1648 {
1649  using Type = UpperMatrix< typename MultTraitEval2<T1,T2>::Type >;
1650 };
1651 
1652 template< typename T1, typename T2 >
1653 struct MultTraitEval1< T1, T2
1654  , EnableIf_t< IsMatrix_v<T1> &&
1655  IsMatrix_v<T2> &&
1656  ( IsUpper_v<T1> && IsUpper_v<T2> ) &&
1657  !( IsUniUpper_v<T1> && IsUniUpper_v<T2> ) &&
1658  !( IsStrictlyUpper_v<T1> && IsUpper_v<T2> ) &&
1659  !( IsUpper_v<T1> && IsStrictlyUpper_v<T2> ) &&
1660  !( IsDiagonal_v<T1> && IsDiagonal_v<T2> ) &&
1661  !( IsIdentity_v<T1> || IsIdentity_v<T2> ) &&
1662  !( IsZero_v<T1> || IsZero_v<T2> ) > >
1663 {
1664  using Type = UpperMatrix< typename MultTraitEval2<T1,T2>::Type >;
1665 };
1667 //*************************************************************************************************
1668 
1669 
1670 
1671 
1672 //=================================================================================================
1673 //
1674 // DIVTRAIT SPECIALIZATIONS
1675 //
1676 //=================================================================================================
1677 
1678 //*************************************************************************************************
1680 template< typename T1, typename T2 >
1681 struct DivTraitEval1< T1, T2
1682  , EnableIf_t< IsUpper_v<T1> &&
1683  !IsStrictlyUpper_v<T1> &&
1684  !IsDiagonal_v<T1> &&
1685  IsNumeric_v<T2> > >
1686 {
1687  using Type = UpperMatrix< typename DivTraitEval2<T1,T2>::Type >;
1688 };
1690 //*************************************************************************************************
1691 
1692 
1693 
1694 
1695 //=================================================================================================
1696 //
1697 // MAPTRAIT SPECIALIZATIONS
1698 //
1699 //=================================================================================================
1700 
1701 //*************************************************************************************************
1703 template< typename T, typename OP >
1704 struct UnaryMapTraitEval1< T, OP
1705  , EnableIf_t< YieldsUpper_v<OP,T> &&
1706  !YieldsUniUpper_v<OP,T> &&
1707  !YieldsStrictlyUpper_v<OP,T> &&
1708  !YieldsDiagonal_v<OP,T> > >
1709 {
1710  using Type = UpperMatrix< typename UnaryMapTraitEval2<T,OP>::Type, StorageOrder_v<T> >;
1711 };
1713 //*************************************************************************************************
1714 
1715 
1716 //*************************************************************************************************
1718 template< typename T1, typename T2, typename OP >
1719 struct BinaryMapTraitEval1< T1, T2, OP
1720  , EnableIf_t< YieldsUpper_v<OP,T1,T2> &&
1721  !YieldsUniUpper_v<OP,T1,T2> &&
1722  !YieldsStrictlyUpper_v<OP,T1,T2> &&
1723  !YieldsDiagonal_v<OP,T1,T2> > >
1724 {
1725  using Type = UpperMatrix< typename BinaryMapTraitEval2<T1,T2,OP>::Type >;
1726 };
1728 //*************************************************************************************************
1729 
1730 
1731 
1732 
1733 //=================================================================================================
1734 //
1735 // DECLSYMTRAIT SPECIALIZATIONS
1736 //
1737 //=================================================================================================
1738 
1739 //*************************************************************************************************
1741 template< typename MT, bool SO, bool DF >
1742 struct DeclSymTrait< UpperMatrix<MT,SO,DF> >
1743 {
1744  using Type = DiagonalMatrix<MT>;
1745 };
1747 //*************************************************************************************************
1748 
1749 
1750 
1751 
1752 //=================================================================================================
1753 //
1754 // DECLHERMTRAIT SPECIALIZATIONS
1755 //
1756 //=================================================================================================
1757 
1758 //*************************************************************************************************
1760 template< typename MT, bool SO, bool DF >
1761 struct DeclHermTrait< UpperMatrix<MT,SO,DF> >
1762 {
1763  using Type = HermitianMatrix<MT>;
1764 };
1766 //*************************************************************************************************
1767 
1768 
1769 
1770 
1771 //=================================================================================================
1772 //
1773 // DECLLOWTRAIT SPECIALIZATIONS
1774 //
1775 //=================================================================================================
1776 
1777 //*************************************************************************************************
1779 template< typename MT, bool SO, bool DF >
1780 struct DeclLowTrait< UpperMatrix<MT,SO,DF> >
1781 {
1782  using Type = DiagonalMatrix<MT>;
1783 };
1785 //*************************************************************************************************
1786 
1787 
1788 
1789 
1790 //=================================================================================================
1791 //
1792 // DECLUPPTRAIT SPECIALIZATIONS
1793 //
1794 //=================================================================================================
1795 
1796 //*************************************************************************************************
1798 template< typename MT, bool SO, bool DF >
1799 struct DeclUppTrait< UpperMatrix<MT,SO,DF> >
1800 {
1801  using Type = UpperMatrix<MT,SO,DF>;
1802 };
1804 //*************************************************************************************************
1805 
1806 
1807 
1808 
1809 //=================================================================================================
1810 //
1811 // DECLDIAGTRAIT SPECIALIZATIONS
1812 //
1813 //=================================================================================================
1814 
1815 //*************************************************************************************************
1817 template< typename MT, bool SO, bool DF >
1818 struct DeclDiagTrait< UpperMatrix<MT,SO,DF> >
1819 {
1820  using Type = DiagonalMatrix<MT>;
1821 };
1823 //*************************************************************************************************
1824 
1825 
1826 
1827 
1828 //=================================================================================================
1829 //
1830 // HIGHTYPE SPECIALIZATIONS
1831 //
1832 //=================================================================================================
1833 
1834 //*************************************************************************************************
1836 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1837 struct HighType< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1838 {
1839  using Type = UpperMatrix< typename HighType<MT1,MT2>::Type >;
1840 };
1842 //*************************************************************************************************
1843 
1844 
1845 
1846 
1847 //=================================================================================================
1848 //
1849 // LOWTYPE SPECIALIZATIONS
1850 //
1851 //=================================================================================================
1852 
1853 //*************************************************************************************************
1855 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1856 struct LowType< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1857 {
1858  using Type = UpperMatrix< typename LowType<MT1,MT2>::Type >;
1859 };
1861 //*************************************************************************************************
1862 
1863 
1864 
1865 
1866 //=================================================================================================
1867 //
1868 // SUBMATRIXTRAIT SPECIALIZATIONS
1869 //
1870 //=================================================================================================
1871 
1872 //*************************************************************************************************
1874 template< typename MT, size_t I, size_t N >
1875 struct SubmatrixTraitEval1< MT, I, I, N, N
1876  , EnableIf_t< IsUpper_v<MT> &&
1877  !IsUniUpper_v<MT> &&
1878  !IsStrictlyUpper_v<MT> &&
1879  !IsDiagonal_v<MT> > >
1880 {
1881  using Type = UpperMatrix< typename SubmatrixTraitEval2<MT,I,I,N,N>::Type >;
1882 };
1884 //*************************************************************************************************
1885 
1886 } // namespace blaze
1887 
1888 #endif
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.
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.
UpperMatrix specialization for dense 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
UpperMatrix specialization for sparse matrices.
#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.
constexpr bool IsUpper_v
Auxiliary variable template for the IsUpper type trait.The IsUpper_v variable template provides a con...
Definition: IsUpper.h:174
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 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: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.
Header file for the IsUniform type trait.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
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.
Header file for the YieldsStrictlyUpper type trait.
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h: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 IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.The IsNumeric_v variable template provides a...
Definition: IsNumeric.h:143
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
Header file for the exception macros of the math module.
#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.
Matrix adapter for upper triangular matrices.
Definition: BaseTemplate.h:553
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
Constraint on the data type.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
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, 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 division 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 YieldsUpper type trait.
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.
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
Header file for the YieldsDiagonal type trait.
constexpr bool YieldsUpper_v
Auxiliary variable template for the YieldsUpper type trait.The YieldsUpper_v variable template provid...
Definition: YieldsUpper.h:126
Header file for the isDivisor shim.
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 IsUpper type trait.
Header file for the YieldsUniUpper type trait.
Header file for the implementation of the base template of the UpperMatrix.
Header file for the IsHermitian type trait.
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
Header file for the Size type trait.
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 HighType type trait.
Header file for the TrueType type/value trait base class.