OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Member Functions | Private Member Functions | Private Attributes | List of all members
QRSolver Class Reference

Least-square solution of systems of linear equations. More...

#include <QRSolver.h>

Collaboration diagram for QRSolver:
Collaboration graph
[legend]

Public Member Functions

 QRSolver (const Matrix< double > &A, const Vector< double > &B, bool pivot)
 Constructor. More...
 
 ~QRSolver ()
 
void solveR (Vector< double > &X) const
 Solution of $A*X = B$ in the least-squares sense. More...
 
void solveS (const Array1D< double > &D, double p, Vector< double > &X)
 Solution of $A*X = B, D*X = 0$ in the least-squares sense. More...
 
void solveRT (Vector< double > &V) const
 Pre-multiply the vector $V$ by $R.transpose()^{-1}$. More...
 
void solveST (Vector< double > &V) const
 Pre-multiply the vector $V$ by $S.transpose()^{-1}$. More...
 
void getColNorm (Array1D< double > &) const
 Return the original column norms of the matrix $A$. More...
 

Private Member Functions

void R_to_S (const Matrix< double > &R, const Array1D< double > &D, Matrix< double > &S, Vector< double > &Z)
 
void solve (const Matrix< double > &R, const Vector< double > &QtB, Vector< double > &X) const
 
void solveT (const Matrix< double > &R, Vector< double > &V) const
 

Private Attributes

int n
 
int m
 
Array2D< double > Q
 
Matrix< double > R
 
Vector< double > QtB
 
Matrix< double > S
 
Array1D< double > column_norm
 
Array1D< int > piv_col
 

Detailed Description

Least-square solution of systems of linear equations.

Definition at line 60 of file QRSolver.h.

Constructor & Destructor Documentation

QRSolver::QRSolver ( const Matrix< double > &  A,
const Vector< double > &  B,
bool  pivot 
)

Constructor.

Definition at line 64 of file QRSolver.cpp.

References dot(), min(), Hypervolume::n, Attrib::Distribution::R, Array1D< T >::size(), sqrt(), and sum().

Here is the call graph for this function:

QRSolver::~QRSolver ( )

Definition at line 144 of file QRSolver.cpp.

Member Function Documentation

void QRSolver::getColNorm ( Array1D< double > &  norms) const

Return the original column norms of the matrix $A$.

Definition at line 174 of file QRSolver.cpp.

References column_norm.

Referenced by LMDif::execute().

void QRSolver::R_to_S ( const Matrix< double > &  R,
const Array1D< double > &  D,
Matrix< double > &  S,
Vector< double > &  Z 
)
private

Definition at line 179 of file QRSolver.cpp.

References Physics::c, n, piv_col, QtB, R, S, Array1D< T >::size(), and sqrt().

Referenced by solveS().

Here is the call graph for this function:

void QRSolver::solve ( const Matrix< double > &  R,
const Vector< double > &  QtB,
Vector< double > &  X 
) const
private

Definition at line 228 of file QRSolver.cpp.

References n, piv_col, R, sum(), and X.

Referenced by solveR(), and solveS().

Here is the call graph for this function:

void QRSolver::solveR ( Vector< double > &  X) const

Solution of $A*X = B$ in the least-squares sense.

Definition at line 148 of file QRSolver.cpp.

References QtB, R, and solve().

Referenced by LMDif::lmpar().

Here is the call graph for this function:

void QRSolver::solveRT ( Vector< double > &  V) const

Pre-multiply the vector $V$ by $R.transpose()^{-1}$.

Definition at line 164 of file QRSolver.cpp.

References R, and solveT().

Here is the call graph for this function:

void QRSolver::solveS ( const Array1D< double > &  D,
double  p,
Vector< double > &  X 
)

Solution of $A*X = B, D*X = 0$ in the least-squares sense.

Definition at line 153 of file QRSolver.cpp.

References m, n, R, R_to_S(), S, solve(), and sqrt().

Referenced by LMDif::lmpar().

Here is the call graph for this function:

void QRSolver::solveST ( Vector< double > &  V) const

Pre-multiply the vector $V$ by $S.transpose()^{-1}$.

Definition at line 169 of file QRSolver.cpp.

References S, and solveT().

Referenced by LMDif::lmpar().

Here is the call graph for this function:

void QRSolver::solveT ( const Matrix< double > &  R,
Vector< double > &  V 
) const
private

Definition at line 257 of file QRSolver.cpp.

References n, piv_col, R, Array1D< T >::size(), and X.

Referenced by solveRT(), and solveST().

Here is the call graph for this function:

Member Data Documentation

Array1D<double> QRSolver::column_norm
private

Definition at line 132 of file QRSolver.h.

Referenced by getColNorm().

int QRSolver::m
private

Definition at line 116 of file QRSolver.h.

Referenced by solveS().

int QRSolver::n
private

Definition at line 115 of file QRSolver.h.

Referenced by R_to_S(), solve(), solveS(), and solveT().

Array1D<int> QRSolver::piv_col
private

Definition at line 136 of file QRSolver.h.

Referenced by R_to_S(), solve(), and solveT().

Array2D<double> QRSolver::Q
private

Definition at line 120 of file QRSolver.h.

Vector<double> QRSolver::QtB
private

Definition at line 126 of file QRSolver.h.

Referenced by R_to_S(), and solveR().

Matrix<double> QRSolver::R
private

Definition at line 123 of file QRSolver.h.

Referenced by R_to_S(), solve(), solveR(), solveRT(), solveS(), and solveT().

Matrix<double> QRSolver::S
private

Definition at line 129 of file QRSolver.h.

Referenced by R_to_S(), solveS(), and solveST().


The documentation for this class was generated from the following files: