SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Encapsulates a complete orthogonal decomposition. More...
#include <rw/lapack/co.h>
Public Member Functions | |
RWCODecomp () | |
RWCODecomp (const RWCODecomp< TypeT, QRCalc > &A) | |
RWCODecomp (const RWQRDecomp< TypeT, QRCalc > &A, double tol=0) | |
RWCODecomp (const RWGenMat< TypeT > &A, double tol=0) | |
void | factor (const RWQRDecomp< TypeT, QRCalc > &A, double tol=0) |
void | factor (const RWGenMat< TypeT > &A, double tol=0) |
unsigned | rows () const |
unsigned | cols () const |
RWGenMat< TypeT > | P () const |
RWMathVec< TypeT > | Px (const RWMathVec< TypeT > &x) const |
RWMathVec< TypeT > | PTx (const RWMathVec< TypeT > &x) const |
RWMathVec< TypeT > | Qx (const RWMathVec< TypeT > &x) const |
RWMathVec< TypeT > | QTx (const RWMathVec< TypeT > &x) const |
RWGenMat< TypeT > | Q () const |
unsigned | rank () const |
RWUpperTriMat< TypeT > | T () const |
RWGenMat< TypeT > | Z () const |
RWMathVec< TypeT > | Tx (const RWMathVec< TypeT > &x) const |
RWMathVec< TypeT > | TTx (const RWMathVec< TypeT > &x) const |
RWMathVec< TypeT > | Tinvx (const RWMathVec< TypeT > &x) const |
RWMathVec< TypeT > | TTinvx (const RWMathVec< TypeT > &x) const |
RWMathVec< TypeT > | Zx (const RWMathVec< TypeT > &x) const |
RWMathVec< TypeT > | ZTx (const RWMathVec< TypeT > &x) const |
The class RWCODecomp<T,QRCalc> encapsulates a complete orthogonal decomposition. A complete orthogonal decomposition decomposes a general rectangular matrix A into the form:
where P is a permutation, Q and Z are orthogonal matrices, and T is an upper triangular matrix. This transformation is closely related to the QR transformation. The difference is that an extra orthogonal transformation, Z, is applied to zero out the columns to the right of T.
#include <rw/lapack/qrcalc3.h> #include <rw/lapack/co.h> RWCODecomp<double, RWQRCalcP3<double> > QTZ(A); // A is an RWGenMat<double>
This decomposition is commonly used in the solution of least squares problems. The implementation of the Linear Algebra Module class RWLeastSqQR<T> uses the complete orthogonal transformation.
#include <rw/lapack/qrcalc3.h> #include <iostream> #include <rw/lapack/co.h> int main() { RWGenMat<double> A; std::cin >> A; RWCODecomp<double, RWQRCalcP3<double> > co(A); std::cout << "Input matrix: " << A << endl; std::cout << "Permutation: " << co.P() << std::endl; std::cout << "Q: " << co.Q() << endl; std::cout << "Z: " << co.Z() << endl; std::cout << "T: " << co.T() << endl; return 0; }
RWCODecomp< TypeT, QRCalc >::RWCODecomp | ( | ) |
Default constructor. Builds a decomposition of size 0 x 0.
RWCODecomp< TypeT, QRCalc >::RWCODecomp | ( | const RWCODecomp< TypeT, QRCalc > & | A | ) |
Copy constructor. References the data in the original decomposition for efficiency.
RWCODecomp< TypeT, QRCalc >::RWCODecomp | ( | const RWQRDecomp< TypeT, QRCalc > & | A, | |
double | tol = 0 | |||
) |
Builds a complete orthogonal representation of the matrix represented by the QR decomposition. Entries along the diagonal of the R factor of the QR decomposition that are smaller in magnitude than tol are treated as 0.
RWCODecomp< TypeT, QRCalc >::RWCODecomp | ( | const RWGenMat< TypeT > & | A, | |
double | tol = 0 | |||
) |
Builds a complete orthogonal decomposition of A. Entries along the diagonal of T that would be smaller in magnitude than tol are treated as 0.
unsigned RWCODecomp< TypeT, QRCalc >::cols | ( | ) | const [inline] |
Returns the number of columns in the matrix that the decomposition represents.
void RWCODecomp< TypeT, QRCalc >::factor | ( | const RWGenMat< TypeT > & | A, | |
double | tol = 0 | |||
) |
Builds a complete orthogonal decomposition of A. Entries along the diagonal of T that would be smaller in magnitude than tol are treated as 0. The current contents of the decomposition are lost.
void RWCODecomp< TypeT, QRCalc >::factor | ( | const RWQRDecomp< TypeT, QRCalc > & | A, | |
double | tol = 0 | |||
) |
Builds a complete orthogonal representation of the matrix represented by the QR decomposition. Entries along the diagonal of the R factor of the QR decomposition that are smaller in magnitude than tol are treated as 0. The current contents of the decomposition are lost.
RWGenMat<TypeT> RWCODecomp< TypeT, QRCalc >::P | ( | ) | const [inline] |
Computes an explicit representation of the permutation matrix.
RWMathVec<TypeT> RWCODecomp< TypeT, QRCalc >::PTx | ( | const RWMathVec< TypeT > & | x | ) | const [inline] |
Computes the inner product of the permutation, or its transpose, and the vector x.
RWMathVec<TypeT> RWCODecomp< TypeT, QRCalc >::Px | ( | const RWMathVec< TypeT > & | x | ) | const [inline] |
Computes the inner product of the permutation, or its transpose, and the vector x.
RWGenMat<TypeT> RWCODecomp< TypeT, QRCalc >::Q | ( | ) | const [inline] |
Computes an explicit representation of the orthogonal matrix Q
.
RWMathVec<TypeT> RWCODecomp< TypeT, QRCalc >::QTx | ( | const RWMathVec< TypeT > & | x | ) | const [inline] |
Computes the inner product of the orthogonal matrix Q
, or its (conjugate) transpose, and the vector x.
RWMathVec<TypeT> RWCODecomp< TypeT, QRCalc >::Qx | ( | const RWMathVec< TypeT > & | x | ) | const [inline] |
Computes the inner product of the orthogonal matrix Q
, or its (conjugate) transpose, and the vector x.
unsigned RWCODecomp< TypeT, QRCalc >::rank | ( | ) | const [inline] |
Returns the rank of the matrix that the decomposition represents. The rank is also the number of rows and columns in the factor T.
unsigned RWCODecomp< TypeT, QRCalc >::rows | ( | ) | const [inline] |
Returns the number of rows in the matrix that the decomposition represents.
RWUpperTriMat<TypeT> RWCODecomp< TypeT, QRCalc >::T | ( | ) | const |
Returns an explicit representation of the triangular matrix T
.
RWMathVec<TypeT> RWCODecomp< TypeT, QRCalc >::Tinvx | ( | const RWMathVec< TypeT > & | x | ) | const |
Computes the inner product of the matrix T
, its (conjugate) transpose, its inverse, or its (conjugate) transpose inverse, and the vector x.
RWMathVec<TypeT> RWCODecomp< TypeT, QRCalc >::TTinvx | ( | const RWMathVec< TypeT > & | x | ) | const |
Computes the inner product of the matrix T
, its (conjugate) transpose, its inverse, or its (conjugate) transpose inverse, and the vector x.
RWMathVec<TypeT> RWCODecomp< TypeT, QRCalc >::TTx | ( | const RWMathVec< TypeT > & | x | ) | const |
Computes the inner product of the matrix T
, its (conjugate) transpose, its inverse, or its (conjugate) transpose inverse, and the vector x.
RWMathVec<TypeT> RWCODecomp< TypeT, QRCalc >::Tx | ( | const RWMathVec< TypeT > & | x | ) | const |
Computes the inner product of the matrix T
, its (conjugate) transpose, its inverse, or its (conjugate) transpose inverse, and the vector x.
RWGenMat<TypeT> RWCODecomp< TypeT, QRCalc >::Z | ( | ) | const |
Computes an explicit representation of the orthogonal matrix Z
.
RWMathVec<TypeT> RWCODecomp< TypeT, QRCalc >::ZTx | ( | const RWMathVec< TypeT > & | x | ) | const |
Computes the inner product of the orthogonal matrix Z
, or its (conjugate) transpose, and the vector x.
RWMathVec<TypeT> RWCODecomp< TypeT, QRCalc >::Zx | ( | const RWMathVec< TypeT > & | x | ) | const |
Computes the inner product of the orthogonal matrix Z
, or its (conjugate) transpose, and the vector x.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.