last update 20 Sep 2009 |
#include <cvrLinearLeastSquares.h>
Classes | |
class | parameters |
The parameters for the class linearLeastSquares. More... | |
Public Types | |
enum | eAlgorithm { QR, CompleteFactorization, SVD, DCSVD } |
Public Member Functions | |
linearLeastSquares () | |
linearLeastSquares (const parameters &par) | |
linearLeastSquares (const linearLeastSquares &other) | |
virtual | ~linearLeastSquares () |
bool | apply (const fmatrix &A, const fvector &b, fvector &x) const |
bool | apply (const dmatrix &A, const dvector &b, dvector &x) const |
bool | apply (const fmatrix &A, const fmatrix &b, fmatrix &x) const |
bool | apply (const dmatrix &A, const dmatrix &b, dmatrix &x) const |
linearLeastSquares & | copy (const linearLeastSquares &other) |
linearLeastSquares & | operator= (const linearLeastSquares &other) |
virtual const std::string & | name () const |
virtual linearLeastSquares * | clone () const |
virtual linearLeastSquares * | newInstance () const |
const parameters & | getParameters () const |
Solving the linear least squares problem means to find a solution for
by minimizing the Euclidean norm squared of the residual . Here is a m x n matrix, with m>n, is an n-dimensional vector, and is a m-dimensional vector.
This class is usually used to solve an over-determined system of linear equations, where there is more equations than variables. If the LAPACK library is used, this method can also be employed to solve under-determined system, choosing the solution of minimal norm.
If LAPACK is enabled, the functor provides several algorithms for the same task, which vary in speed and robustness against the ill-conditionness of the matrix A. Please refer to the LAPACK documentation for more details:
cvr::linearLeastSquares::linearLeastSquares | ( | ) |
Default constructor.
cvr::linearLeastSquares::linearLeastSquares | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
cvr::linearLeastSquares::linearLeastSquares | ( | const linearLeastSquares & | other | ) |
virtual cvr::linearLeastSquares::~linearLeastSquares | ( | ) | [virtual] |
Destructor.
Find the solution for
.
A | matrix A | |
b | each column is a vector b | |
x | each column is a vector x where the solution is stored for the corresponding column in b. |
b
and the number of rows of A must be identical. The resulting dimension of x
will be identical to the number of columns of A.
The internal state of the class will store the decomposition of the matrix A, so that the other apply methods with other b
vectors can be used.
Find the solution for
.
A | matrix A | |
b | each column is a vector b | |
x | each column is a vector x where the solution is stored for the corresponding column in b. |
b
and the number of rows of A must be identical. The resulting dimension of x
will be identical to the number of columns of A.
The internal state of the class will store the decomposition of the matrix A, so that the other apply methods with other b
vectors can be used.
Find the solution for
.
The dimension of
b
and the number of rows of A must be identical. The resulting dimension of x
will be identical to the number of columns of A.
The internal state of the class will store the decomposition of the matrix A, so that the other apply methods with other b
vectors can be used.
Find the solution for
.
The dimension of
b
and the number of rows of A must be identical. The resulting dimension of x
will be identical to the number of columns of A.
The internal state of the class will store the decomposition of the matrix A, so that the other apply methods with other b
vectors can be used.
virtual linearLeastSquares* cvr::linearLeastSquares::clone | ( | ) | const [virtual] |
linearLeastSquares& cvr::linearLeastSquares::copy | ( | const linearLeastSquares & | other | ) |
const parameters& cvr::linearLeastSquares::getParameters | ( | ) | const |
virtual const std::string& cvr::linearLeastSquares::name | ( | ) | const [virtual] |
virtual linearLeastSquares* cvr::linearLeastSquares::newInstance | ( | ) | const [virtual] |
linearLeastSquares& cvr::linearLeastSquares::operator= | ( | const linearLeastSquares & | other | ) |