gmres Interface

public interface gmres

Description

Solve a square linear system of equations

using the Generalized Minimum RESidual (GMRES) method.

References

  • Saad Y. and Schultz M. H. "GMRES: A generalized minimal residual algorithm for solving nonsymmetric linear systems." SIAM Journal on Scientific and Statistical Computing, 7(3), 1986.

Syntax

    call gmres(A, b, x, info [, rtol] [, atol] [, preconditioner] [, options] [, transpose])

Arguments

A : Linear operator derived from one of the abstract_linop provided by the AbstractLinops module. It is an intent(in) argument.

b : Right-hand side vector derived from one the abstract_vector types provided by the AbstractVectors module. It needs to have the same type and kind as A. It is an intent(in) argument.

x : On entry, initial guess for the solution. On exit, the solution computed by gmres. It is a vector derived from one the abstract_vector types provided by the AbstractVectors module. It needs to have the same type and kind as A. It is an intent(inout) argument.

info : integer information flag.

rtol (optional) : real relative tolerance for the solver.

atol (optional) : real absolute tolerance for the solver.

preconditioner (optional) : Right preconditioner used to solve the system. It needs to be consistent with the abstract_preconditioner interface. It is an intent(in) argument.

options (optional) : Container for the gmres options given by the gmres_opts type. It is an intent(in) argument.

transpose (optional) : logical flag controlling whether or is being solver.


Module Procedures

public subroutine gmres_rsp(A, b, x, info, rtol, atol, preconditioner, options, transpose)

Arguments

Type IntentOptional Attributes Name
class(abstract_linop_rsp), intent(in) :: A

Linear operator to be inverted.

class(abstract_vector_rsp), intent(in) :: b

Right-hand side vector.

class(abstract_vector_rsp), intent(inout) :: x

Solution vector.

integer, intent(out) :: info

Information flag.

real(kind=sp), intent(in), optional :: rtol

Relative solver tolerance

real(kind=sp), intent(in), optional :: atol

Absolute solver tolerance

class(abstract_precond_rsp), intent(in), optional :: preconditioner

Preconditioner (optional).

class(abstract_opts), intent(in), optional :: options

GMRES options.

logical, intent(in), optional :: transpose

Whether or is being used.

public subroutine gmres_rdp(A, b, x, info, rtol, atol, preconditioner, options, transpose)

Arguments

Type IntentOptional Attributes Name
class(abstract_linop_rdp), intent(in) :: A

Linear operator to be inverted.

class(abstract_vector_rdp), intent(in) :: b

Right-hand side vector.

class(abstract_vector_rdp), intent(inout) :: x

Solution vector.

integer, intent(out) :: info

Information flag.

real(kind=dp), intent(in), optional :: rtol

Relative solver tolerance

real(kind=dp), intent(in), optional :: atol

Absolute solver tolerance

class(abstract_precond_rdp), intent(in), optional :: preconditioner

Preconditioner (optional).

class(abstract_opts), intent(in), optional :: options

GMRES options.

logical, intent(in), optional :: transpose

Whether or is being used.

public subroutine gmres_csp(A, b, x, info, rtol, atol, preconditioner, options, transpose)

Arguments

Type IntentOptional Attributes Name
class(abstract_linop_csp), intent(in) :: A

Linear operator to be inverted.

class(abstract_vector_csp), intent(in) :: b

Right-hand side vector.

class(abstract_vector_csp), intent(inout) :: x

Solution vector.

integer, intent(out) :: info

Information flag.

real(kind=sp), intent(in), optional :: rtol

Relative solver tolerance

real(kind=sp), intent(in), optional :: atol

Absolute solver tolerance

class(abstract_precond_csp), intent(in), optional :: preconditioner

Preconditioner (optional).

class(abstract_opts), intent(in), optional :: options

GMRES options.

logical, intent(in), optional :: transpose

Whether or is being used.

public subroutine gmres_cdp(A, b, x, info, rtol, atol, preconditioner, options, transpose)

Arguments

Type IntentOptional Attributes Name
class(abstract_linop_cdp), intent(in) :: A

Linear operator to be inverted.

class(abstract_vector_cdp), intent(in) :: b

Right-hand side vector.

class(abstract_vector_cdp), intent(inout) :: x

Solution vector.

integer, intent(out) :: info

Information flag.

real(kind=dp), intent(in), optional :: rtol

Relative solver tolerance

real(kind=dp), intent(in), optional :: atol

Absolute solver tolerance

class(abstract_precond_cdp), intent(in), optional :: preconditioner

Preconditioner (optional).

class(abstract_opts), intent(in), optional :: options

GMRES options.

logical, intent(in), optional :: transpose

Whether or is being used.