Stokhos  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Types | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Teuchos::SerialQRDenseSolver< OrdinalType, Sacado::MP::Vector< Storage > > Class Template Reference
Inheritance diagram for Teuchos::SerialQRDenseSolver< OrdinalType, Sacado::MP::Vector< Storage > >:
Inheritance graph
[legend]
Collaboration diagram for Teuchos::SerialQRDenseSolver< OrdinalType, Sacado::MP::Vector< Storage > >:
Collaboration graph
[legend]

Public Types

typedef Sacado::MP::Vector
< Storage > 
ScalarType
 
typedef ScalarTraits
< ScalarType >::magnitudeType 
MagnitudeType
 

Public Member Functions

Constructor/Destructor Methods
 SerialQRDenseSolver ()
 Default constructor; matrix should be set using setMatrix(), LHS and RHS set with setVectors().
 
virtual ~SerialQRDenseSolver ()
 SerialQRDenseSolver destructor.
 
Set Methods
int setMatrix (const RCP< SerialDenseMatrix< OrdinalType, ScalarType > > &A)
 Sets the pointers for coefficient matrix. More...
 
int setVectors (const RCP< SerialDenseMatrix< OrdinalType, ScalarType > > &X, const RCP< SerialDenseMatrix< OrdinalType, ScalarType > > &B)
 Sets the pointers for left and right hand side vector(s). More...
 
Strategy Modifying Methods
void factorWithEquilibration (bool flag)
 Causes equilibration to be called just before the matrix factorization as part of the call to factor. More...
 
void solveWithTranspose (bool flag)
 If flag is true, causes all subsequent function calls to work with the adjoint of this matrix, otherwise not.
 
void solveWithTransposeFlag (Teuchos::ETransp trans)
 All subsequent function calls will work with the transpose-type set by this method (Teuchos::NO_TRANS or Teuchos::CONJ_TRANS).
 
Factor/Solve/Invert Methods
int factor ()
 Computes the in-place QR factorization of the matrix using the LAPACK routine _GETRF or the Eigen class HouseholderQR. More...
 
int solve ()
 Computes the solution X to AX = B for the this matrix and the B provided to SetVectors().. More...
 
int computeEquilibrateScaling ()
 Determines if this matrix should be scaled. More...
 
int equilibrateMatrix ()
 Equilibrates the this matrix. More...
 
int equilibrateRHS ()
 Equilibrates the current RHS. More...
 
int unequilibrateLHS ()
 Unscales the solution vectors if equilibration was used to solve the system. More...
 
int formQ ()
 Explicitly forms the unitary matrix Q. More...
 
int formR ()
 Explicitly forms the upper triangular matrix R. More...
 
int multiplyQ (ETransp transq, SerialDenseMatrix< OrdinalType, ScalarType > &C)
 Left multiply the input matrix by the unitary matrix Q or its adjoint. More...
 
int solveR (ETransp transr, SerialDenseMatrix< OrdinalType, ScalarType > &C)
 Solve input matrix on the left with the upper triangular matrix R or its adjoint. More...
 
Query methods
bool transpose ()
 Returns true if adjoint of this matrix has and will be used.
 
bool factored ()
 Returns true if matrix is factored (factor available via getFactoredMatrix()).
 
bool equilibratedA ()
 Returns true if factor is equilibrated (factor available via getFactoredMatrix()).
 
bool equilibratedB ()
 Returns true if RHS is equilibrated (RHS available via getRHS()).
 
bool shouldEquilibrate ()
 Returns true if the LAPACK general rules for equilibration suggest you should equilibrate the system.
 
bool solved ()
 Returns true if the current set of vectors has been solved.
 
bool formedQ ()
 Returns true if Q has been formed explicitly.
 
bool formedR ()
 Returns true if R has been formed explicitly.
 
Data Accessor methods
RCP< SerialDenseMatrix
< OrdinalType, ScalarType > > 
getMatrix () const
 Returns pointer to current matrix.
 
RCP< SerialDenseMatrix
< OrdinalType, ScalarType > > 
getFactoredMatrix () const
 Returns pointer to factored matrix (assuming factorization has been performed).
 
RCP< SerialDenseMatrix
< OrdinalType, ScalarType > > 
getQ () const
 Returns pointer to Q (assuming factorization has been performed).
 
RCP< SerialDenseMatrix
< OrdinalType, ScalarType > > 
getR () const
 Returns pointer to R (assuming factorization has been performed).
 
RCP< SerialDenseMatrix
< OrdinalType, ScalarType > > 
getLHS () const
 Returns pointer to current LHS.
 
RCP< SerialDenseMatrix
< OrdinalType, ScalarType > > 
getRHS () const
 Returns pointer to current RHS.
 
OrdinalType numRows () const
 Returns row dimension of system.
 
OrdinalType numCols () const
 Returns column dimension of system.
 
std::vector< ScalarTypetau () const
 Returns pointer to pivot vector (if factorization has been computed), zero otherwise.
 
MagnitudeType ANORM () const
 Returns the absolute value of the largest element of this matrix (returns -1 if not yet computed).
 
I/O methods
void Print (std::ostream &os) const
 Print service methods; defines behavior of ostream << operator.
 

Protected Types

typedef ScalarType::value_type BaseScalarType
 
typedef SerialQRDenseSolver
< OrdinalType, BaseScalarType > 
BaseQRType
 
typedef SerialDenseMatrix
< OrdinalType, BaseScalarType > 
BaseMatrixType
 
typedef SerialDenseMatrix
< OrdinalType, ScalarType
MatrixType
 

Protected Member Functions

void resetMatrix ()
 
void resetVectors ()
 
RCP< BaseMatrixType > createBaseMatrix (const RCP< MatrixType > &mat) const
 
RCP< MatrixType > createMatrix (const RCP< BaseMatrixType > &base_mat) const
 

Protected Attributes

BaseQRType base_QR_
 
OrdinalType M_
 
OrdinalType N_
 
OrdinalType SacadoSize_
 
RCP< MatrixType > Matrix_
 
RCP< MatrixType > LHS_
 
RCP< MatrixType > RHS_
 
RCP< MatrixType > Factor_
 
RCP< MatrixType > FactorQ_
 
RCP< MatrixType > FactorR_
 
RCP< BaseMatrixType > Base_Matrix_
 
RCP< BaseMatrixType > Base_LHS_
 
RCP< BaseMatrixType > Base_RHS_
 
RCP< BaseMatrixType > Base_Factor_
 
RCP< BaseMatrixType > Base_FactorQ_
 
RCP< BaseMatrixType > Base_FactorR_
 

Member Function Documentation

template<typename OrdinalType , typename Storage >
int Teuchos::SerialQRDenseSolver< OrdinalType, Sacado::MP::Vector< Storage > >::computeEquilibrateScaling ( )
inline

Determines if this matrix should be scaled.

Returns
Integer error code, set to 0 if successful.
template<typename OrdinalType , typename Storage >
int Teuchos::SerialQRDenseSolver< OrdinalType, Sacado::MP::Vector< Storage > >::equilibrateMatrix ( )
inline

Equilibrates the this matrix.

Note
This method will be called automatically in solve() method if factorWithEquilibration( true ) is called.
Returns
Integer error code, set to 0 if successful.
template<typename OrdinalType , typename Storage >
int Teuchos::SerialQRDenseSolver< OrdinalType, Sacado::MP::Vector< Storage > >::equilibrateRHS ( )
inline

Equilibrates the current RHS.

Note
This method will be called automatically in solve() method if factorWithEquilibration( true ) is called.
Returns
Integer error code, set to 0 if successful.
template<typename OrdinalType , typename Storage >
int Teuchos::SerialQRDenseSolver< OrdinalType, Sacado::MP::Vector< Storage > >::factor ( )
inline

Computes the in-place QR factorization of the matrix using the LAPACK routine _GETRF or the Eigen class HouseholderQR.

Returns
Integer error code, set to 0 if successful.
template<typename OrdinalType , typename Storage >
void Teuchos::SerialQRDenseSolver< OrdinalType, Sacado::MP::Vector< Storage > >::factorWithEquilibration ( bool  flag)
inline

Causes equilibration to be called just before the matrix factorization as part of the call to factor.

Note
This method must be called before the factorization is performed, otherwise it will have no effect.
template<typename OrdinalType , typename Storage >
int Teuchos::SerialQRDenseSolver< OrdinalType, Sacado::MP::Vector< Storage > >::formQ ( )

Explicitly forms the unitary matrix Q.

Returns
Integer error code, set to 0 if successful.
template<typename OrdinalType , typename Storage >
int Teuchos::SerialQRDenseSolver< OrdinalType, Sacado::MP::Vector< Storage > >::formR ( )

Explicitly forms the upper triangular matrix R.

Returns
Integer error code, set to 0 if successful.
template<typename OrdinalType , typename Storage >
int Teuchos::SerialQRDenseSolver< OrdinalType, Sacado::MP::Vector< Storage > >::multiplyQ ( ETransp  transq,
SerialDenseMatrix< OrdinalType, ScalarType > &  C 
)

Left multiply the input matrix by the unitary matrix Q or its adjoint.

Returns
Integer error code, set to 0 if successful.
template<typename OrdinalType , typename Storage >
int Teuchos::SerialQRDenseSolver< OrdinalType, Sacado::MP::Vector< Storage > >::setMatrix ( const RCP< SerialDenseMatrix< OrdinalType, ScalarType > > &  A)

Sets the pointers for coefficient matrix.

Row dimension of A must be greater than or equal to the column dimension of A.

template<typename OrdinalType , typename Storage >
int Teuchos::SerialQRDenseSolver< OrdinalType, Sacado::MP::Vector< Storage > >::setVectors ( const RCP< SerialDenseMatrix< OrdinalType, ScalarType > > &  X,
const RCP< SerialDenseMatrix< OrdinalType, ScalarType > > &  B 
)

Sets the pointers for left and right hand side vector(s).

Row dimension of X must match column dimension of matrix A, row dimension of B must match row dimension of A.

template<typename OrdinalType , typename Storage >
int Teuchos::SerialQRDenseSolver< OrdinalType, Sacado::MP::Vector< Storage > >::solve ( void  )
inline

Computes the solution X to AX = B for the this matrix and the B provided to SetVectors()..

Returns
Integer error code, set to 0 if successful.
template<typename OrdinalType , typename Storage >
int Teuchos::SerialQRDenseSolver< OrdinalType, Sacado::MP::Vector< Storage > >::solveR ( ETransp  transr,
SerialDenseMatrix< OrdinalType, ScalarType > &  C 
)

Solve input matrix on the left with the upper triangular matrix R or its adjoint.

Returns
Integer error code, set to 0 if successful.
template<typename OrdinalType , typename Storage >
int Teuchos::SerialQRDenseSolver< OrdinalType, Sacado::MP::Vector< Storage > >::unequilibrateLHS ( )
inline

Unscales the solution vectors if equilibration was used to solve the system.

Note
This method will be called automatically in solve() method if factorWithEquilibration( true ) is called.
Returns
Integer error code, set to 0 if successful.

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