>
>#include <rw/dco.h> // DoubleCODecomp #include <rw/fco.h> // FloatCODecomp #include <rw/cdo.h> // DComplexCODecomp DoubleCODecomp QTZ(A); // A is an RWGenMat<double>
The classes {TYPE}CODecomp encapsulate 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.
>This decomposition is commonly used in the solution of least squares problems. The implementation of the LAPACK class group {TYPE}LeastSqQR uses the complete orthogonal transformation.
#include <iostream.h> #include <rw/dco.h> main() { RWGenMat<double> A; cin >> A; DoubleCODecomp co(A); cout << "Input matrix: " << A << endl; cout << "Permutation: " << co.P() << endl; cout << "Q: " << co.Q() << endl; cout << "Z: " << co.Z() << endl; cout << "T: " << co.T() << endl; }>
DoubleCODecomp(); FloatCODecomp(); DComplexCODecomp();
Default constructor. Builds a decomposition of size 0 x 0.
DoubleCODecomp(const DoubleCODecomp& A); FloatCODecomp(const FloatCODecomp& A); DComplexCODecomp(const DComplexCODecomp& A);
Copy constructor. References the data in the original decomposition for efficiency.
DoubleCODecomp(const DoubleQRDecomp& A, double tol=0); FloatCODecomp(const FloatQRDecomp& A, double tol=0); DComplexCODecomp(const DComplexQRDecomp& 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.
DoubleCODecomp(const RWGenMat<double>& A, double tol=0); FloatCODecomp(const RWGenMat<float>& A, double tol=0); DComplexCODecomp(const RWGenMat<DComplex>& 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 FloatCODecomp::cols(); unsigned DoubleCODecomp::cols(); unsigned DComplexCODecomp::cols();
Returns the number of columns in the matrix that the decomposition represents.
void DoubleCODecomp::factor(const DoubleQRDecomp& A, double tol=0); void FloatCODecomp::factor(const FloatQRDecomp& A, double tol=0); void DComplexCODecomp::factor(const DComplexQRDecomp& 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.
void DoubleCODecomp::factor(const RWGenMat<double>& A, double tol=0); void FloatCODecomp::factor(const RWGenMat<float>& A, double tol=0); void DComplexCODecomp::factor(const RWGenMat<DComplex>& 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.
RWGenMat<float> FloatCODecomp::P(); RWGenMat<double> DoubleCODecomp::P(); RWGenMat<DComplex> DComplexCODecomp::P();
Computes an explicit representation of the permutation matrix.
RWMathVec<float> FloatCODecomp::Px(const RWMathVec<float>& x); RWMathVec<float> FloatCODecomp::PTx(const RWMathVec<float>& x); RWMathVec<double> DoubleCODecomp::Px(const RWMathVec<double>& x); RWMathVec<double> DoubleCODecomp::PTx(const RWMathVec<double>& x); RWMathVec<DComplex> DComplexCODecomp::Px(const RWMathVec<DComplex>& x); RWMathVec<DComplex> DComplexCODecomp::PTx(const RWMathVec<DComplex>& x);
Computes the inner product of the permutation, or its transpose, and the vector x.
RWGenMat<float> FloatCODecomp::Q(); RWGenMat<double> DoubleCODecomp::Q(); RWGenMat<DComplex> DComplexCODecomp::Q();
Computes an explicit representation of the orthogonal matrix Q.
RWMathVec<float> FloatCODecomp::Qx(const RWMathVec<float>& x); RWMathVec<float> FloatCODecomp::QTx(const RWMathVec<float>& x); RWMathVec<double> DoubleCODecomp::Qx(const RWMathVec<double>& x); RWMathVec<double> DoubleCODecomp::QTx(const RWMathVec<double>& x); RWMathVec<DComplex> DComplexCODecomp::Qx(const RWMathVec<DComplex>& x); RWMathVec<DComplex> DComplexCODecomp::QTx(const RWMathVec<DComplex>& x);
Computes the inner product of the orthogonal matrix Q, or its (conjugate) transpose, and the vector x.
unsigned FloatCODecomp::rank(); unsigned DoubleCODecomp::rank(); unsigned DComplexCODecomp::rank();
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 FloatCODecomp::rows(); unsigned DoubleCODecomp::rows(); unsigned DComplexCODecomp::rows();
Returns the number of rows in the matrix that the decomposition represents.
RWGenMat<float> FloatCODecomp::T(); RWGenMat<double> DoubleCODecomp::T(); RWGenMat<DComplex> DComplexCODecomp::T();
Returns an explicit representation of the triangular matrix T.
RWMathVec<float> FloatCODecomp::Tx(const RWMathVec<float>& x); RWMathVec<float> FloatCODecomp::TTx(const RWMathVec<float>& x); RWMathVec<float> FloatCODecomp::Tinvx(const RWMathVec<float>& x); RWMathVec<float> FloatCODecomp::TTinvx(const RWMathVec<float>& x); RWMathVec<double> DoubleCODecomp::Tx(const RWMathVec<double>& x); RWMathVec<double> DoubleCODecomp::TTx(const RWMathVec<double>& x); RWMathVec<double> DoubleCODecomp::Tinvx(const RWMathVec<double>& x); RWMathVec<double> DoubleCODecomp::TTinvx(const RWMathVec<double>& x); RWMathVec<DComplex> DComplexCODecomp::Tx(const RWMathVec<DComplex>& x); RWMathVec<DComplex> DComplexCODecomp::TTx(const RWMathVec<DComplex>& x); RWMathVec<DComplex> DComplexCODecomp::Tinvx(const RWMathVec<DComplex>& x); RWMathVec<DComplex> DComplexCODecomp::TTinvx(const RWMathVec<DComplex>& x);
Computes the inner product of the matrix T, its (conjugate) transpose, its inverse, or its (conjugate) transpose inverse, and the vector x.
RWGenMat<float> FloatCODecomp::Z(); RWGenMat<double> DoubleCODecomp::Z(); RWGenMat<DComplex> DComplexCODecomp::Z();
Computes an explicit representation of the orthogonal matrix Z.
RWMathVec<float> FloatCODecomp::Zx(const RWMathVec<float>& x); RWMathVec<float> FloatCODecomp::ZTx(const RWMathVec<float>& x); RWMathVec<double> DoubleCODecomp::Zx(const RWMathVec<double>& x); RWMathVec<double> DoubleCODecomp::ZTx(const RWMathVec<double>& x); RWMathVec<DComplex> DComplexCODecomp::Zx(const RWMathVec<DComplex>& x); RWMathVec<DComplex> DComplexCODecomp::ZTx(const RWMathVec<DComplex>& x);
Computes the inner product of the orthogonal matrix Z, or its (conjugate) transpose, and the vector x.
©Copyright 1999, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.