last update 20 Sep 2009 |
#include <cvrQrDecomposition.h>
Classes | |
class | parameters |
The parameters for the class qrDecomposition. More... | |
Public Member Functions | |
qrDecomposition () | |
qrDecomposition (const parameters &par) | |
qrDecomposition (const qrDecomposition &other) | |
virtual | ~qrDecomposition () |
bool | apply (matrix< T > &arh, vector< T > &tau, vector< integer > &p) const |
bool | apply (const matrix< T > &a, matrix< T > &rh, vector< T > &tau, vector< integer > &p) const |
bool | apply (matrix< T > &arh, vector< T > &tau) const |
bool | apply (const matrix< T > &a, matrix< T > &rh, vector< T > &tau) const |
bool | extractR (const matrix< T > &rh, matrix< T > &r) const |
bool | computeQ (const matrix< T > &rh, vector< T > &tau, matrix< T > &q) const |
void | buildPermutationMatrix (const vector< integer > &pv, matrix< T > &pm) const |
bool | apply (const matrix< T > &A, matrix< T > &Q, matrix< T > &R) const |
qrDecomposition & | copy (const qrDecomposition &other) |
qrDecomposition & | operator= (const qrDecomposition &other) |
const std::string & | name () const |
virtual qrDecomposition< T > * | clone () const |
virtual qrDecomposition< T > * | newInstance () const |
const parameters & | getParameters () const |
A = Q * R
Where R is an upper triangular m x m Matrix and Q is a m x n orthogonal matrix, i.e. the transposed matrix of Q multiplied with Q itself is the identity matrix.
If LAPACK is not used or not available, A must be of full rank!
matrix<float> src(3,3); float data[] = {1,2,3,4,5,6,7,8,9}; src.fill(data); matrix<float> q,r; qrDecomposition<float> qrd; qrd.apply(src,q,r); matrix<float> result; result.multiply(q,r); std::cout << "Q:\n" << q << "\n"; std::cout << "R:\n" << r << "\n"; // should be identical to src std::cout << "A = Q * R:\n"<< result << "\n";
cvr::qrDecomposition< T >::qrDecomposition | ( | ) |
Default constructor.
cvr::qrDecomposition< T >::qrDecomposition | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
cvr::qrDecomposition< T >::qrDecomposition | ( | const qrDecomposition< T > & | other | ) |
virtual cvr::qrDecomposition< T >::~qrDecomposition | ( | ) | [virtual] |
Destructor.
bool cvr::qrDecomposition< T >::apply | ( | const matrix< T > & | A, | |
matrix< T > & | Q, | |||
matrix< T > & | R | |||
) | const |
Computes the QR decomposition.
A | input m x n matrix. | |
Q | Q is a m x n orthogonal matrix. | |
R | R is an upper triangular m x m matrix. |
true
if successful or false
otherwise. bool cvr::qrDecomposition< T >::apply | ( | const matrix< T > & | a, | |
matrix< T > & | rh, | |||
vector< T > & | tau | |||
) | const |
Apply QR (on copy).
a | The source matrix on input | |
rh | The compact representation (R + elementary reflectors) on output | |
tau | The beta components on output |
bool cvr::qrDecomposition< T >::apply | ( | matrix< T > & | arh, | |
vector< T > & | tau | |||
) | const |
Apply QR (in place).
arh | The source matrix on input, and on output the compact representation (R + elementary reflectors) | |
tau | The beta components on output |
bool cvr::qrDecomposition< T >::apply | ( | matrix< T > & | arh, | |
vector< T > & | tau, | |||
vector< integer > & | p | |||
) | const |
void cvr::qrDecomposition< T >::buildPermutationMatrix | ( | const vector< integer > & | pv, | |
matrix< T > & | pm | |||
) | const |
virtual qrDecomposition<T>* cvr::qrDecomposition< T >::clone | ( | ) | const [virtual] |
bool cvr::qrDecomposition< T >::computeQ | ( | const matrix< T > & | rh, | |
vector< T > & | tau, | |||
matrix< T > & | q | |||
) | const |
Compute Q from RH and tau.
rh | The compact representation (R + elementary reflectors) on input | |
tau | The beta components on input | |
q | Q on output |
qrDecomposition& cvr::qrDecomposition< T >::copy | ( | const qrDecomposition< T > & | other | ) |
bool cvr::qrDecomposition< T >::extractR | ( | const matrix< T > & | rh, | |
matrix< T > & | r | |||
) | const |
Extract R from RH.
rh | The compact representation (R + elementary reflectors) on input | |
r | R on output |
const parameters& cvr::qrDecomposition< T >::getParameters | ( | ) | const |
const std::string& cvr::qrDecomposition< T >::name | ( | ) | const [virtual] |
virtual qrDecomposition<T>* cvr::qrDecomposition< T >::newInstance | ( | ) | const [virtual] |
qrDecomposition& cvr::qrDecomposition< T >::operator= | ( | const qrDecomposition< T > & | other | ) |