|
akreon-linalg
Fixed-size linear algebra and numerical methods in C++26.
|
Factors A = Q R using Householder reflections. More...
#include <qr.hpp>
Public Types | |
| using | T = matrix_scalar_t< Mat > |
| using | ScalarT = real_type_t< T > |
Public Member Functions | |
| constexpr | QR (const Mat &A) |
| Factor A using Householder reflections. | |
| constexpr | QR (const Mat &A, const config::FactorConfig< ScalarT > &config_in) |
| Factor A with an explicit solve configuration. | |
| constexpr auto | Q () const |
| Reconstruct the full orthogonal or unitary factor. | |
| constexpr auto | R () const |
| Extract the upper-trapezoidal factor. | |
| constexpr auto | rank (ScalarT tol=1e-6) const |
| Estimate rank from the diagonal of R. | |
| constexpr auto | solve (const Vector< T, Rows > &b) const |
| Solve A x = b in the least-squares sense. | |
Static Public Attributes | |
| static constexpr std::size_t | Rows = mat_rows_v<Mat> |
| static constexpr std::size_t | Cols = mat_cols_v<Mat> |
Factors A = Q R using Householder reflections.
Successive reflections eliminate each column below its diagonal. The upper triangle stores R; reflector tails and coefficients reconstruct the full orthogonal or unitary Q. For wide matrices, factor A^* to obtain an LQ form.
| Mat | Input matrix type with at least as many rows as columns. |
| using linalg::QR< Mat >::ScalarT = real_type_t<T> |
| using linalg::QR< Mat >::T = matrix_scalar_t<Mat> |
|
inlineconstexpr |
Factor A using Householder reflections.
| [in] | A | Input matrix with Rows >= Cols. |
Definition at line 41 of file qr.hpp.
References linalg::mat_rows_v.
|
inlineconstexpr |
Factor A with an explicit solve configuration.
| [in] | A | Input matrix with Rows >= Cols. |
| [in] | config_in | Factorization settings and triangular pivot floor. |
Definition at line 49 of file qr.hpp.
References linalg::mat_rows_v.
|
inlineconstexpr |
Reconstruct the full orthogonal or unitary factor.
Definition at line 59 of file qr.hpp.
Referenced by linalg::QR< Mat >::solve().
|
inlineconstexpr |
Extract the upper-trapezoidal factor.
Definition at line 66 of file qr.hpp.
References linalg::get_upper_right_triangular_matrix().
Referenced by linalg::QR< Mat >::rank(), and linalg::QR< Mat >::solve().
|
inlineconstexpr |
Estimate rank from the diagonal of R.
| [in] | tol | Absolute threshold for counting nonzero diagonal entries. |
Definition at line 74 of file qr.hpp.
References linalg::QR< Mat >::Cols, linalg::mat_rows_v, linalg::QR< Mat >::R(), linalg::QR< Mat >::rank(), and linalg::QR< Mat >::Rows.
Referenced by linalg::QR< Mat >::rank().
|
inlineconstexpr |
Solve A x = b in the least-squares sense.
Project c = Q^* b, then back-substitute through the leading block of R.
| [in] | b | Right-hand side with Rows entries. |
Definition at line 91 of file qr.hpp.
References linalg::conjugate_transpose(), linalg::mat_rows_v, linalg::QR< Mat >::Q(), linalg::QR< Mat >::R(), and linalg::transpose().
|
staticconstexpr |
Definition at line 31 of file qr.hpp.
Referenced by linalg::QR< Mat >::rank().
|
staticconstexpr |
Definition at line 30 of file qr.hpp.
Referenced by linalg::QR< Mat >::rank().