#include <LOCA_BorderedSolver_HouseholderQR.H>
Public Member Functions | |
HouseholderQR (const Teuchos::RCP< LOCA::GlobalData > &global_data) | |
Constructor. | |
virtual | ~HouseholderQR () |
Destructor. | |
void | computeQR (const NOX::Abstract::MultiVector::DenseMatrix &C, const NOX::Abstract::MultiVector &B, bool use_c_transpose, NOX::Abstract::MultiVector::DenseMatrix &Y1, NOX::Abstract::MultiVector &Y2, NOX::Abstract::MultiVector::DenseMatrix &T, NOX::Abstract::MultiVector::DenseMatrix &R) |
Compute QR factorization as described above. | |
void | applyCompactWY (const NOX::Abstract::MultiVector::DenseMatrix &Y1, const NOX::Abstract::MultiVector &Y2, const NOX::Abstract::MultiVector::DenseMatrix &T, NOX::Abstract::MultiVector::DenseMatrix &X1, NOX::Abstract::MultiVector &X2, bool isZeroX1, bool isZeroX2, bool useTranspose) const |
Applies the operator Q as described above overwriting x and y . If either of x or y are zero on input, set the corresponding isZeroX or isZeroY flags. Set\ useTranspose to true to instead apply the transpose of Q. | |
void | applyCompactWY (const NOX::Abstract::MultiVector::DenseMatrix &Y1, const NOX::Abstract::MultiVector &Y2, const NOX::Abstract::MultiVector::DenseMatrix &T, const NOX::Abstract::MultiVector::DenseMatrix *input1, const NOX::Abstract::MultiVector *input2, NOX::Abstract::MultiVector::DenseMatrix &result1, NOX::Abstract::MultiVector &result2, bool useTranspose) const |
Another version of applyCompactWY() that does not overwrite its inputs. If either input is zero, set the corresponding pointer to NULL. | |
Protected Member Functions | |
void | computeHouseholderVector (int col, const NOX::Abstract::MultiVector::DenseMatrix &A1, const NOX::Abstract::MultiVector &A2, NOX::Abstract::MultiVector::DenseMatrix &V1, NOX::Abstract::MultiVector &V2, double &beta) |
Computes the Householder vector V1 , V2 for column col of A1 and A2 , starting at row col of A1. | |
void | applyHouseholderVector (const NOX::Abstract::MultiVector::DenseMatrix &V1, const NOX::Abstract::MultiVector &V2, double beta, NOX::Abstract::MultiVector::DenseMatrix &A1, NOX::Abstract::MultiVector &A2) |
Applies the Householder vector V1 , V2 to the matrix sub-block represented by A1 and A2. | |
Protected Attributes | |
Teuchos::RCP< LOCA::GlobalData > | globalData |
Global data object. | |
Teuchos::BLAS< int, double > | dblas |
BLAS Wrappers. | |
Private Member Functions | |
HouseholderQR (const HouseholderQR &) | |
Private to prohibit copying. | |
HouseholderQR & | operator= (const HouseholderQR &) |
Private to prohibit copying. |
This class computes the QR factorization
where is an
matrix,
is an
matrix,
is an
matrix,
is an
matrix, and
represents either the identity operation or the transpose. The matrix
is represented by a NOX::Abstract::MultiVector::DenseMatrix while
is a NOX::Abstract::MultiVector. Given
and
, this class computes
and
with
returned as NOX::Abstract::MultiVector::DenseMatrix. The operator
is generated using the standard Householder QR algorithm (Algorithm 5.2.1, G. Golub and C. Van Loan, "Matrix Computations," 3rd Edition, Johns Hopkins, Baltimore, 1996) and is stored using the compact WY representation:
(see R. Schreiver and C. Van Loan, "A Storage-Efficient WY Represntation for Products of Householder Transformations," SIAM J. Sci. Stat. Comput., Vol. 10, No. 1, pp. 53-57, January 1989).
Definition at line 92 of file LOCA_BorderedSolver_HouseholderQR.H.
LOCA::BorderedSolver::HouseholderQR::HouseholderQR | ( | const Teuchos::RCP< LOCA::GlobalData > & | global_data | ) |
Constructor.
global_data | [in] Global data object |
Definition at line 46 of file LOCA_BorderedSolver_HouseholderQR.C.
LOCA::BorderedSolver::HouseholderQR::~HouseholderQR | ( | ) | [virtual] |
LOCA::BorderedSolver::HouseholderQR::HouseholderQR | ( | const HouseholderQR & | ) | [private] |
Private to prohibit copying.
void LOCA::BorderedSolver::HouseholderQR::computeQR | ( | const NOX::Abstract::MultiVector::DenseMatrix & | C, | |
const NOX::Abstract::MultiVector & | B, | |||
bool | use_c_transpose, | |||
NOX::Abstract::MultiVector::DenseMatrix & | Y1, | |||
NOX::Abstract::MultiVector & | Y2, | |||
NOX::Abstract::MultiVector::DenseMatrix & | T, | |||
NOX::Abstract::MultiVector::DenseMatrix & | R | |||
) |
Compute QR factorization as described above.
Set use_c_transpose
to true if the transpose of is required.
Definition at line 58 of file LOCA_BorderedSolver_HouseholderQR.C.
References applyHouseholderVector(), NOX::Abstract::MultiVector::clone(), computeHouseholderVector(), dblas, NOX::Abstract::MultiVector::multiply(), NOX::Abstract::MultiVector::numVectors(), and NOX::Abstract::MultiVector::subView().
Referenced by LOCA::BorderedSolver::EpetraHouseholder::initForSolve(), and LOCA::BorderedSolver::EpetraHouseholder::initForTransposeSolve().
void LOCA::BorderedSolver::HouseholderQR::applyCompactWY | ( | const NOX::Abstract::MultiVector::DenseMatrix & | Y1, | |
const NOX::Abstract::MultiVector & | Y2, | |||
const NOX::Abstract::MultiVector::DenseMatrix & | T, | |||
NOX::Abstract::MultiVector::DenseMatrix & | X1, | |||
NOX::Abstract::MultiVector & | X2, | |||
bool | isZeroX1, | |||
bool | isZeroX2, | |||
bool | useTranspose | |||
) | const |
Applies the operator Q as described above overwriting x
and y
. If either of x
or y
are zero on input, set the corresponding isZeroX
or isZeroY
flags. Set\ useTranspose
to true
to instead apply the transpose of Q.
Definition at line 230 of file LOCA_BorderedSolver_HouseholderQR.C.
References dblas, NOX::Abstract::MultiVector::init(), NOX::Abstract::MultiVector::multiply(), NOX::Abstract::MultiVector::numVectors(), and NOX::Abstract::MultiVector::update().
Referenced by applyCompactWY(), LOCA::BorderedSolver::EpetraHouseholder::solve(), and LOCA::BorderedSolver::EpetraHouseholder::solveTranspose().
void LOCA::BorderedSolver::HouseholderQR::applyCompactWY | ( | const NOX::Abstract::MultiVector::DenseMatrix & | Y1, | |
const NOX::Abstract::MultiVector & | Y2, | |||
const NOX::Abstract::MultiVector::DenseMatrix & | T, | |||
const NOX::Abstract::MultiVector::DenseMatrix * | input1, | |||
const NOX::Abstract::MultiVector * | input2, | |||
NOX::Abstract::MultiVector::DenseMatrix & | result1, | |||
NOX::Abstract::MultiVector & | result2, | |||
bool | useTranspose | |||
) | const |
Another version of applyCompactWY() that does not overwrite its inputs. If either input is zero, set the corresponding pointer to NULL.
Definition at line 287 of file LOCA_BorderedSolver_HouseholderQR.C.
References applyCompactWY().
void LOCA::BorderedSolver::HouseholderQR::computeHouseholderVector | ( | int | col, | |
const NOX::Abstract::MultiVector::DenseMatrix & | A1, | |||
const NOX::Abstract::MultiVector & | A2, | |||
NOX::Abstract::MultiVector::DenseMatrix & | V1, | |||
NOX::Abstract::MultiVector & | V2, | |||
double & | beta | |||
) | [protected] |
Computes the Householder vector V1
, V2
for column col
of A1
and A2
, starting at row col
of A1.
The algorithm implemented here is essentially algorithm 5.1.1 of Golub and Van Loan.
Definition at line 169 of file LOCA_BorderedSolver_HouseholderQR.C.
References NOX::Abstract::MultiVector::scale().
Referenced by computeQR().
void LOCA::BorderedSolver::HouseholderQR::applyHouseholderVector | ( | const NOX::Abstract::MultiVector::DenseMatrix & | V1, | |
const NOX::Abstract::MultiVector & | V2, | |||
double | beta, | |||
NOX::Abstract::MultiVector::DenseMatrix & | A1, | |||
NOX::Abstract::MultiVector & | A2 | |||
) | [protected] |
Applies the Householder vector V1
, V2
to the matrix sub-block represented by A1
and A2.
Definition at line 206 of file LOCA_BorderedSolver_HouseholderQR.C.
References NOX::Abstract::MultiVector::multiply(), NOX::Abstract::MultiVector::numVectors(), and NOX::Abstract::MultiVector::update().
Referenced by computeQR().
HouseholderQR& LOCA::BorderedSolver::HouseholderQR::operator= | ( | const HouseholderQR & | ) | [private] |
Private to prohibit copying.
Teuchos::RCP<LOCA::GlobalData> LOCA::BorderedSolver::HouseholderQR::globalData [protected] |
Teuchos::BLAS<int,double> LOCA::BorderedSolver::HouseholderQR::dblas [protected] |
BLAS Wrappers.
Definition at line 190 of file LOCA_BorderedSolver_HouseholderQR.H.
Referenced by applyCompactWY(), and computeQR().