Belos Version of the Day
Public Types | Public Member Functions | Public Attributes
Belos::details::ProjectedLeastSquaresProblem< Scalar > Class Template Reference

"Container" for the GMRES projected least-squares problem. More...

#include <BelosProjectedLeastSquaresSolver.hpp>

List of all members.

Public Types

typedef Scalar scalar_type
 The type of the entries in the projected least-squares problem.
typedef Teuchos::ScalarTraits
< Scalar >::magnitudeType 
magnitude_type
 The type of the magnitude of scalar_type values.

Public Member Functions

 ProjectedLeastSquaresProblem (const int maxNumIterations)
 Constructor.
void reset (const typename Teuchos::ScalarTraits< Scalar >::magnitudeType beta)
 Reset the projected least-squares problem.
void reallocateAndReset (const typename Teuchos::ScalarTraits< Scalar >::magnitudeType beta, const int maxNumIterations)
 (Re)allocate and reset the projected least-squares problem.

Public Attributes

Teuchos::SerialDenseMatrix
< int, Scalar > 
H
 The upper Hessenberg matrix from GMRES.
Teuchos::SerialDenseMatrix
< int, Scalar > 
R
 Upper triangular factor from the QR factorization of H.
Teuchos::SerialDenseMatrix
< int, Scalar > 
y
 Current solution of the projected least-squares problem.
Teuchos::SerialDenseMatrix
< int, Scalar > 
z
 Current right-hand side of the projected least-squares problem.
Teuchos::Array< Scalar > theCosines
 Array of cosines from the computed Givens rotations.
Teuchos::Array< Scalar > theSines
 Array of sines from the computed Givens rotations.

Detailed Description

template<class Scalar>
class Belos::details::ProjectedLeastSquaresProblem< Scalar >

"Container" for the GMRES projected least-squares problem.

Author:
Mark Hoemmen

See the documentation of ProjectedLeastSquaresSolver to learn how to use this class in a GMRES-type iterative solver.

Definition at line 158 of file BelosProjectedLeastSquaresSolver.hpp.


Member Typedef Documentation

template<class Scalar>
Belos::details::ProjectedLeastSquaresProblem< Scalar >::scalar_type

The type of the entries in the projected least-squares problem.

Definition at line 162 of file BelosProjectedLeastSquaresSolver.hpp.

The type of the magnitude of scalar_type values.

Definition at line 165 of file BelosProjectedLeastSquaresSolver.hpp.


Constructor & Destructor Documentation

template<class Scalar>
Belos::details::ProjectedLeastSquaresProblem< Scalar >::ProjectedLeastSquaresProblem ( const int  maxNumIterations) [inline]

Constructor.

Reserve space for a projected least-squares problem of dimension at most (maxNumIterations+1) by maxNumIterations. "Iterations" refers to GMRES iterations. We assume that after the first iteration (not counting the computation of the initial residual as an iteration), the projected least-squares problem has dimension 2 by 1.

Definition at line 236 of file BelosProjectedLeastSquaresSolver.hpp.


Member Function Documentation

template<class Scalar>
void Belos::details::ProjectedLeastSquaresProblem< Scalar >::reset ( const typename Teuchos::ScalarTraits< Scalar >::magnitudeType  beta) [inline]

Reset the projected least-squares problem.

"Reset" means that the right-hand side of the projected least-squares problem is restored to $\beta e_1$. The value $\beta$ is typically the norm of the initial or restarted residual vector.

This method does not reallocate or resize any of the matrices or vectors. Since this class keeps the original upper Hessenberg matrix, the application may choose to recompute its QR factorization up to the desired point and apply the resulting Givens rotations to the right-hand size z resulting from this reset operation. Alternately, the application may simply overwrite the upper Hessenberg matrix's entries with new data.

Parameters:
beta[in] The initial residual norm of the (non-projected) linear system $Ax=b$.

Definition at line 264 of file BelosProjectedLeastSquaresSolver.hpp.

template<class Scalar>
void Belos::details::ProjectedLeastSquaresProblem< Scalar >::reallocateAndReset ( const typename Teuchos::ScalarTraits< Scalar >::magnitudeType  beta,
const int  maxNumIterations 
) [inline]

(Re)allocate and reset the projected least-squares problem.

"(Re)allocate" means to (re)size H, R, y, and z to their appropriate maximum dimensions, given the maximum number of iterations that GMRES may execute. "Reset" means to do what the reset() method does. Reallocation happens first, then reset.

Parameters:
beta[in] The initial residual norm of the (non-projected) linear system $Ax=b$.
maxNumIterations[in] The maximum number of iterations that GMRES may execute.

Definition at line 291 of file BelosProjectedLeastSquaresSolver.hpp.


Member Data Documentation

template<class Scalar>
Teuchos::SerialDenseMatrix<int,Scalar> Belos::details::ProjectedLeastSquaresProblem< Scalar >::H

The upper Hessenberg matrix from GMRES.

This matrix's number of rows is one more than its number of columns. The updating methods never modify H; they just copy out the relevant data into R. This allows GMRES implementations to implement features like backtracking (throwing away iterations).

Definition at line 174 of file BelosProjectedLeastSquaresSolver.hpp.

template<class Scalar>
Teuchos::SerialDenseMatrix<int,Scalar> Belos::details::ProjectedLeastSquaresProblem< Scalar >::R

Upper triangular factor from the QR factorization of H.

R is a matrix with the same dimensions as H. It is used for computing and storing the incrementally computed upper triangular factor from the QR factorization of H. R must have the same dimensions as H (the number of rows is one more than the number of columns).

H[0:k, 0:k-1] (inclusive zero-based index ranges) is the upper Hessenberg matrix for the first k iterations of GMRES (where k = 0, 1, 2, ...).

Definition at line 187 of file BelosProjectedLeastSquaresSolver.hpp.

template<class Scalar>
Teuchos::SerialDenseMatrix<int,Scalar> Belos::details::ProjectedLeastSquaresProblem< Scalar >::y

Current solution of the projected least-squares problem.

The vector (matrix with one column) y has the same number of rows as H. It is used to store the solution of the projected least-squares problem at each step. The vector should have one more entry than necessary for the solution, because of the way we solve the least-squares problem. (Most of the methods require copying the right-hand side vector into y, and the right-hand side has one more entry than the solution.)

Definition at line 199 of file BelosProjectedLeastSquaresSolver.hpp.

template<class Scalar>
Teuchos::SerialDenseMatrix<int,Scalar> Belos::details::ProjectedLeastSquaresProblem< Scalar >::z

Current right-hand side of the projected least-squares problem.

The vector (one-column matrix) z has the same number of rows as H. It stores the current right-hand side of the projected least-squares problem. The z vector may be updated either progressively (if a Givens rotation method is used) or all at once (if an LAPACK factorization method is used).

Definition at line 209 of file BelosProjectedLeastSquaresSolver.hpp.

template<class Scalar>
Teuchos::Array<Scalar> Belos::details::ProjectedLeastSquaresProblem< Scalar >::theCosines

Array of cosines from the computed Givens rotations.

This array is only filled in if a Givens rotation method is used for updating the least-squares problem.

In the complex-arithmetic case, it is possible to compute entirely real-valued cosines. However, we choose to represent them as the original scalar type, rather than the magnitude type.

Definition at line 220 of file BelosProjectedLeastSquaresSolver.hpp.

template<class Scalar>
Teuchos::Array<Scalar> Belos::details::ProjectedLeastSquaresProblem< Scalar >::theSines

Array of sines from the computed Givens rotations.

This array is only filled in if a Givens rotation method is used for updating the least-squares problem.

Definition at line 226 of file BelosProjectedLeastSquaresSolver.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines