|
tesseract++ 0.0.1
N-dimensional tensor library for embedded systems
|
Least squares solve: min ‖Ax - b‖² via QR decomposition. More...
#include "config.h"#include "utilities/expected.h"#include "matrix_traits.h"#include "fused/fused_matrix.h"#include "fused/fused_vector.h"#include "algorithms/decomposition/qr.h"#include "algorithms/solvers/triangular_solve.h"
Go to the source code of this file.
Namespaces | |
| namespace | matrix_algorithms |
Functions | |
| template<typename T , my_size_t M, my_size_t N> | |
| Expected< FusedVector< T, N >, MatrixStatus > | matrix_algorithms::least_squares (const FusedMatrix< T, M, N > &A, const FusedVector< T, M > &b) |
| Solve the least squares problem min ‖Ax - b‖² via QR. | |
Least squares solve: min ‖Ax - b‖² via QR decomposition.
For an overdetermined system A (M×N, M≥N) and vector b (M), finds x (N) that minimizes the 2-norm of the residual.
The residual norm is ‖c₂‖ where c₂ = c(N:M-1).
Complexity: O(2MN² - 2N³/3) for QR + O(N²) for back substitution.