SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse.solver.iterative.nonstationary
Class GeneralizedMinimalResidualSolver

java.lang.Object
  extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse.solver.iterative.nonstationary.GeneralizedMinimalResidualSolver
All Implemented Interfaces:
IterativeSolver

public class GeneralizedMinimalResidualSolver
extends java.lang.Object
implements IterativeSolver

The Generalized Minimal Residual method (GMRES) is useful for solving non-symmetric n-by-n linear systems. It computes a sequence of orthogonal vectors (like MINRES, and combines these through a least-squares solve and update. However, unlike MINRES (and CG) it requires storing the whole sequence, so that a large amount of storage is needed. For this reason, restarted versions of this method are used. In restarted versions, computation and storage costs are limited by specifying a fixed number of vectors to be generated.

In addition, this implementation uses a Givens rotation to transform the intermediate Hessenberg matrix into an upper triangular matrix, such that convergence can be determined as soon as the residual norm at each sub-step is small enough.

Only left preconditioning is supported in this implementation.

See Also:
"Yousef Saad, “GMRES,” in Iterative Methods for Sparse Linear Systems, 2nd ed. 2000, ch. 6, sec. 6.5, p. 157-172."

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse.solver.iterative.IterativeSolver
IterativeSolver.ConvergenceFailure, IterativeSolver.Problem
 
Constructor Summary
GeneralizedMinimalResidualSolver()
          CreateMatrix a full GMRES solver.
GeneralizedMinimalResidualSolver(int m)
          CreateMatrix a restart version of GMRES solver with the restart parameter m.
 
Method Summary
 Vector solve(IterativeSolver.Problem problem)
          Solve iteratively Ax = b until the solution is close enough, i.e., the norm of residual (b - Ax) is less than or equal to the specified iteration.
 Vector solve(IterativeSolver.Problem problem, IterationMonitor monitor)
          Solve iteratively Ax = b until the solution is close enough, i.e., the norm of residual (b - Ax) is less than or equal to the specified iteration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneralizedMinimalResidualSolver

public GeneralizedMinimalResidualSolver()
CreateMatrix a full GMRES solver.


GeneralizedMinimalResidualSolver

public GeneralizedMinimalResidualSolver(int m)
CreateMatrix a restart version of GMRES solver with the restart parameter m.

From a practical viewpoint, as m increases, the computational cost increases at least as O(m2)n because of the Gram-Schmidt orthogonalization. The memory cost increases as O(mn).

Parameters:
m - the restart parameter
Method Detail

solve

public Vector solve(IterativeSolver.Problem problem)
             throws IterativeSolver.ConvergenceFailure
Description copied from interface: IterativeSolver
Solve iteratively
Ax = b
until the solution is close enough, i.e., the norm of residual (b - Ax) is less than or equal to the specified iteration.

Specified by:
solve in interface IterativeSolver
Parameters:
problem - the problem of solving Ax = b
Returns:
the computed solution for the problem
Throws:
IterativeSolver.ConvergenceFailure - if the algorithm fails to converge

solve

public Vector solve(IterativeSolver.Problem problem,
                    IterationMonitor monitor)
             throws IterativeSolver.ConvergenceFailure
Description copied from interface: IterativeSolver
Solve iteratively
Ax = b
until the solution is close enough, i.e., the norm of residual (b - Ax) is less than or equal to the specified iteration.

In each iteration, the newly computed iterate is added to the IterationMonitor for statistics or diagnostic purpose.

Specified by:
solve in interface IterativeSolver
Parameters:
problem - the problem of solving Ax = b
monitor - an IterationMonitor instance
Returns:
the computed solution for the problem
Throws:
IterativeSolver.ConvergenceFailure - if the algorithm fails to converge

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.