latest version v1.9 - last update 10 Apr 2010 |
This functor computes a QRDecomposition of a given rectangular m x n Matrix A of the Form:. More...
#include <ltiQrDecomposition.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 () |
virtual const char * | getTypeName () const |
bool | apply (matrix< T > &srcdest, matrix< T > &r) const |
bool | apply (const matrix< T > &src, matrix< T > &q, matrix< T > &r) const |
qrDecomposition & | copy (const qrDecomposition &other) |
qrDecomposition & | operator= (const qrDecomposition &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
This functor computes a QRDecomposition of a given rectangular m x n Matrix A of the Form:.
A = Q * R
Where R is an upper triangular m x m Matrix and Q is a m x n orthogonal matrix. Transpose of Q muliplied with Q itself is the identity Matrix.
If LAPACK is not used or not available, A must be of full rang!
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";
lti::qrDecomposition< T >::qrDecomposition | ( | ) |
Default constructor.
lti::qrDecomposition< T >::qrDecomposition | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
lti::qrDecomposition< T >::qrDecomposition | ( | const qrDecomposition< T > & | other | ) |
Copy constructor.
other | the object to be copied |
virtual lti::qrDecomposition< T >::~qrDecomposition | ( | ) | [virtual] |
Destructor.
bool lti::qrDecomposition< T >::apply | ( | const matrix< T > & | src, | |
matrix< T > & | q, | |||
matrix< T > & | r | |||
) | const |
operates on a copy of the given parameters.
src | matrix<T> with the source data. | |
q | matrix<T> where Q will be left. | |
r | matrix<T> where R will be left. |
bool lti::qrDecomposition< T >::apply | ( | matrix< T > & | srcdest, | |
matrix< T > & | r | |||
) | const |
operates on the given parameter.
srcdest | matrix<T> with the source data. The resulting Q will be left here too. | |
r | matrix<T> where R will be left. |
virtual functor* lti::qrDecomposition< T >::clone | ( | ) | const [virtual] |
Returns a pointer to a clone of this functor.
Implements lti::functor.
qrDecomposition& lti::qrDecomposition< T >::copy | ( | const qrDecomposition< T > & | other | ) |
Copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
Referenced by lti::qrDecomposition< T >::parameters::copy(), lti::qrDecomposition< T >::parameters::operator=(), and lti::qrDecomposition< T >::parameters::parameters().
const parameters& lti::qrDecomposition< T >::getParameters | ( | ) | const |
Returns used parameters.
Reimplemented from lti::functor.
virtual const char* lti::qrDecomposition< T >::getTypeName | ( | ) | const [virtual] |
Returns the name of this type ("qrDecomposition").
Reimplemented from lti::linearAlgebraFunctor.
qrDecomposition& lti::qrDecomposition< T >::operator= | ( | const qrDecomposition< T > & | other | ) |