class
QRSolver
(Return to index)
Least-square solution of systems of linear equations.
Given an m by n matrix A, an n by n diagonal matrix D,
and an m-vector B, two problem can be solved:
-
Solve the the system A*X = B in the least squares sense.
The first step to solve this problem is:
QRSolver solver(A, pivot);
The second step is then
solver.solveR(X);
-
Solve the the two systems A*X = B, D*X = 0 in the least squares sense.
The first step to solve this problem is
QRSolver solver(A, pivot);
The second step is
solver.solveS(D, X);
The second step can be repeated as many times as required for different
diagonal matrices D .
In both cases, the method
solver.getColNorm(C);
can be called to return the original column norms of A .
Type: |
Instantiable |
Include file: |
./Algebra/QRSolver.hh |
Synopsis (including inherited members):
- Public members:
-
QRSolver
(const Matrix<double>&,const Vector<double>&,bool)
;
-
~QRSolver
()
;
-
void solveR
(Vector<double>&)const
;
-
void solveS
(const Array1D<double>&,double,Vector<double>&)
;
-
void solveRT
(Vector<double>&)const
;
-
void solveST
(Vector<double>&)const
;
-
void getColNorm
(Array1D<double>&)const
;
Documentation:
- Public members:
-
QRSolver
(const Matrix<double>&,const Vector<double>&,bool)
;
- Constructor.
Determine the QR-factorisation A = Q*R of the matrix A
and transform the right-hand side B . If pivot is
true, then pivot search is done.
This method uses Householder transformations with optional column
pivoting to compute a QR-factorization of the m-by-n matrix A .
It determines an orthogonal matrix Q , a permutation matrix P ,
and an upper trapezoidal matrix R with diagonal elements of
nonincreasing magnitude, such that A*P = Q*R . The Householder
transformation for column k is of the form I - (1/U(k))*U*UT ,
where U has zeros in the first k-1 positions.
The form of this transformation and the method of pivoting first
appeared in the corresponding LINPACK subroutine.
-
void getColNorm
(Array1D<double>&)const
;
- Return the original column norms of the matrix A .
-
void solveR
(Vector<double>&)const
;
- Solution of A*X = B in the least-squares sense.
-
void solveRT
(Vector<double>&)const
;
- Pre-multiply the vector V by R.transpose()-1 .
-
void solveS
(const Array1D<double>&,double,Vector<double>&)
;
- Solution of A*X = B, D*X = 0 in the least-squares sense.
-
void solveST
(Vector<double>&)const
;
- Pre-multiply the vector V by S.transpose()-1 .
Requires prior execution of solveS.
Documentation generated by fci on Mon Feb 7 12:30:05 2000