PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <LeastSquaresSolver.hpp>
Public Member Functions | |
LeastSquaresSolver (const Matrix< Type, M, N > &A) | |
Class calculates QR decomposition which can be used for linear least squares. More... | |
Vector< Type, M > | qtb (const Vector< Type, M > &b) |
qtb Calculate Q^T * b More... | |
Vector< Type, N > | solve (const Vector< Type, M > &b) |
Solve Ax=b for x. More... | |
Private Attributes | |
Matrix< Type, M, N > | _A |
Vector< Type, N > | _tau |
Definition at line 22 of file LeastSquaresSolver.hpp.
|
inline |
Class calculates QR decomposition which can be used for linear least squares.
A | Matrix of size MxN |
Initialize the class with a MxN matrix. The constructor starts the QR decomposition. This class does not check the rank of the matrix. The user needs to make sure that rank(A) = N and M >= N.
Definition at line 35 of file LeastSquaresSolver.hpp.
References matrix::LeastSquaresSolver< Type, M, N >::_A, matrix::LeastSquaresSolver< Type, M, N >::_tau, and matrix::sqrt().
|
inline |
qtb Calculate Q^T * b
b |
This function calculates Q^T * b. This is useful for the solver because R*x = Q^T*b.
Definition at line 85 of file LeastSquaresSolver.hpp.
References matrix::LeastSquaresSolver< Type, M, N >::_A, and matrix::LeastSquaresSolver< Type, M, N >::_tau.
Referenced by matrix::LeastSquaresSolver< Type, M, N >::solve().
|
inline |
Solve Ax=b for x.
b |
Find x in the equation Ax = b. A is provided in the initializer of the class.
Definition at line 115 of file LeastSquaresSolver.hpp.
References matrix::LeastSquaresSolver< Type, M, N >::_A, matrix::isEqualF(), and matrix::LeastSquaresSolver< Type, M, N >::qtb().
Referenced by test_4x3(), test_4x4(), and test_div_zero().
|
private |
Definition at line 139 of file LeastSquaresSolver.hpp.
Referenced by matrix::LeastSquaresSolver< Type, M, N >::LeastSquaresSolver(), matrix::LeastSquaresSolver< Type, M, N >::qtb(), and matrix::LeastSquaresSolver< Type, M, N >::solve().
|
private |
Definition at line 140 of file LeastSquaresSolver.hpp.
Referenced by matrix::LeastSquaresSolver< Type, M, N >::LeastSquaresSolver(), and matrix::LeastSquaresSolver< Type, M, N >::qtb().