|
NOX Development
|
A simple linear solver for use by NOX::LAPACK::Group. More...
#include <NOX_LAPACK_LinearSolver.H>

Public Member Functions | |
| LinearSolver (int n) | |
| Constructor. | |
| LinearSolver (const LinearSolver< T > &s) | |
| Copy constructor. | |
| ~LinearSolver () | |
| Destructor. | |
| LinearSolver & | operator= (const LinearSolver< T > &s) |
| Assignment. | |
| Matrix< T > & | getMatrix () |
| Return matrix. | |
| const Matrix< T > & | getMatrix () const |
| Return matrix. | |
| void | reset () |
| Reset. | |
| void | apply (bool trans, int ncols, const T *input, T *output) const |
| Apply matrix. | |
| bool | solve (bool trans, int ncols, T *output) |
| Solve inverse. | |
Protected Types | |
| typedef Teuchos::ScalarTraits< T >::magnitudeType | MT |
Protected Attributes | |
| Matrix< T > | mat |
| Matrix. | |
| Matrix< T > | lu |
| LU factorization of matrix. | |
| std::vector< int > | pivots |
| Pivots. | |
| bool | isValidLU |
| Is LU factorization valid. | |
| Teuchos::BLAS< int, T > | blas |
| BLAS wrappers. | |
| Teuchos::LAPACK< int, T > | lapack |
| LAPACK wrappers. | |
| int | lwork |
| Work array size for GELSS if linear solve fails. | |
| int | rank |
| Rank param for GELSS if linear solve fails. | |
| Teuchos::ArrayRCP< MT > | sv |
| Singular values for GELSS if linear solve fails. | |
| Teuchos::ArrayRCP< T > | work |
| Work array for GELSS if linear solve fails. | |
| Teuchos::ArrayRCP< MT > | rwork |
| Magnitude work array for complex-valued GELSS. | |
A simple linear solver for use by NOX::LAPACK::Group.
This class provides a simple linear solver class that stores a NOX::LAPACK::Matrix and provides routines to apply the matrix and solve it using BLAS and LAPACK routines. It is templated so that it can be used to solve both real and complex matrices. It also stores an LU factorization of the matrix so repeated solves are more efficient. The group should signal that the matrix has changed by calling reset().
| NOX::LAPACK::LinearSolver< T >::LinearSolver | ( | int | n | ) |
| NOX::LAPACK::LinearSolver< T >::LinearSolver | ( | const LinearSolver< T > & | s | ) |
| void NOX::LAPACK::LinearSolver< T >::apply | ( | bool | trans, |
| int | ncols, | ||
| const T * | input, | ||
| T * | output ) const |
Apply matrix.
Set trans to true to apply the transpose. ncols is the number of columns in input and output, which should be stored column-wise.
References blas, mat, and NOX::LAPACK::Matrix< T >::numRows().
| NOX::LAPACK::Matrix< T > & NOX::LAPACK::LinearSolver< T >::getMatrix | ( | ) |
Return matrix.
References mat.
Referenced by LOCA::LAPACK::Group::getJacobianMatrix(), LOCA::LAPACK::Group::getJacobianMatrix(), LOCA::LAPACK::Group::getShiftedMatrix(), and LOCA::LAPACK::Group::getShiftedMatrix().
| const NOX::LAPACK::Matrix< T > & NOX::LAPACK::LinearSolver< T >::getMatrix | ( | ) | const |
Return matrix.
References mat.
| NOX::LAPACK::LinearSolver< T > & NOX::LAPACK::LinearSolver< T >::operator= | ( | const LinearSolver< T > & | s | ) |
| void NOX::LAPACK::LinearSolver< T >::reset | ( | ) |
| bool NOX::LAPACK::LinearSolver< T >::solve | ( | bool | trans, |
| int | ncols, | ||
| T * | output ) |
Solve inverse.
Set trans to true to solve the transpose. ncols is the number of columns in output, which should be stored column- wise. The right-hand-side is passed through output, which is then overwritten with the result.
References isValidLU, lapack, lu, lwork, mat, pivots, rank, rwork, sv, and work.
|
protected |
BLAS wrappers.
Referenced by apply(), LinearSolver(), and LinearSolver().
|
protected |
Is LU factorization valid.
Referenced by LinearSolver(), LinearSolver(), operator=(), reset(), and solve().
|
protected |
LAPACK wrappers.
Referenced by LinearSolver(), LinearSolver(), and solve().
|
protected |
LU factorization of matrix.
Referenced by LinearSolver(), LinearSolver(), operator=(), and solve().
|
protected |
Work array size for GELSS if linear solve fails.
Referenced by LinearSolver(), LinearSolver(), operator=(), and solve().
|
protected |
Referenced by apply(), getMatrix(), getMatrix(), LinearSolver(), LinearSolver(), operator=(), and solve().
|
protected |
Pivots.
Referenced by LinearSolver(), LinearSolver(), operator=(), and solve().
|
protected |
Rank param for GELSS if linear solve fails.
Referenced by solve().
|
protected |
Magnitude work array for complex-valued GELSS.
Referenced by solve().
|
protected |
Singular values for GELSS if linear solve fails.
Referenced by LinearSolver(), LinearSolver(), operator=(), and solve().
|
protected |
Work array for GELSS if linear solve fails.
Referenced by LinearSolver(), LinearSolver(), operator=(), and solve().