Public Member Functions | |
Householder () | |
template<typename number2 > | |
Householder (const FullMatrix< number2 > &) | |
template<typename number2 > | |
void | initialize (const FullMatrix< number2 > &) |
template<typename number2 > | |
double | least_squares (Vector< number2 > &dst, const Vector< number2 > &src) const |
Private Attributes | |
std::vector< number > | diagonal |
Whenever an object of this class is created, it copies the matrix given and computes its QR-decomposition by Householder algorithm. Then, the function least_squares() can be used to compute the vector x minimizing ||Ax-b|| for a given vector b.
<float> and <double>
; others can be generated in application programs (see the section on Template instantiations in the manual).Householder< number >::Householder | ( | ) |
Create an empty object.
Householder< number >::Householder | ( | const FullMatrix< number2 > & | ) | [inline] |
Create an object holding the QR-decomposition of a matrix.
void Householder< number >::initialize | ( | const FullMatrix< number2 > & | ) | [inline] |
Compute the QR-decomposition of another matrix.
double Householder< number >::least_squares | ( | Vector< number2 > & | dst, | |
const Vector< number2 > & | src | |||
) | const [inline] |
Solve the least-squares problem for the right hand side src
. The return value is the Euclidean norm of the approximation error.
dst
contains the solution of the least squares problem on return.src
contains the right hand side b of the least squares problem. It will be changed during the algorithm and is unusable on return.
std::vector<number> Householder< number >::diagonal [private] |
Storage for the diagonal elements of the orthogonal transformation.