equation_solver Derived Type

type, public, abstract :: equation_solver

A base class for various solvers of nonlinear systems of equations.


Contents


Type-Bound Procedures

procedure, public :: get_fcn_tolerance => es_get_fcn_tol

  • private pure function es_get_fcn_tol(this) result(x)

    Gets the convergence on function value tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(in) :: this

    The equation_solver object.

    Return Value real(kind=real64)

    The tolerance value.

procedure, public :: get_gradient_tolerance => es_get_grad_tol

  • private pure function es_get_grad_tol(this) result(x)

    Gets the convergence on slope of the gradient vector tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(in) :: this

    The equation_solver object.

    Return Value real(kind=real64)

    The tolerance value.

procedure, public :: get_max_fcn_evals => es_get_max_eval

  • private pure function es_get_max_eval(this) result(n)

    Gets the maximum number of function evaluations allowed during a single solve.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(in) :: this

    The equation_solver object.

    Return Value integer(kind=int32)

    The maximum number of function evaluations.

procedure, public :: get_print_status => es_get_print_status

  • private pure function es_get_print_status(this) result(x)

    Gets a logical value determining if iteration status should be printed.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(in) :: this

    The equation_solver object.

    Return Value logical

    True if the iteration status should be printed; else, false.

procedure, public :: get_var_tolerance => es_get_var_tol

  • private pure function es_get_var_tol(this) result(x)

    Gets the convergence on change in variable tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(in) :: this

    The equation_solver object.

    Return Value real(kind=real64)

    The tolerance value.

procedure, public :: set_fcn_tolerance => es_set_fcn_tol

  • private subroutine es_set_fcn_tol(this, x)

    Sets the convergence on function value tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(inout) :: this

    The equation_solver object.

    real(kind=real64), intent(in) :: x

    The tolerance value.

procedure, public :: set_gradient_tolerance => es_set_grad_tol

  • private subroutine es_set_grad_tol(this, x)

    Sets the convergence on slope of the gradient vector tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(inout) :: this

    The equation_solver object.

    real(kind=real64), intent(in) :: x

    The tolerance value.

procedure, public :: set_max_fcn_evals => es_set_max_eval

  • private subroutine es_set_max_eval(this, n)

    Sets the maximum number of function evaluations allowed during a single solve.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(inout) :: this

    The equation_solver object.

    integer(kind=int32), intent(in) :: n

    The maximum number of function evaluations.

procedure, public :: set_print_status => es_set_print_status

  • private subroutine es_set_print_status(this, x)

    Sets a logical value determining if iteration status should be printed.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(inout) :: this

    The equation_solver object.

    logical, intent(in) :: x

    True if the iteration status should be printed; else, false.

procedure, public :: set_var_tolerance => es_set_var_tol

  • private subroutine es_set_var_tol(this, x)

    Sets the convergence on change in variable tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(inout) :: this

    The equation_solver object.

    real(kind=real64), intent(in) :: x

    The tolerance value.

procedure(nonlin_solver), public, deferred, pass :: solve

  • subroutine nonlin_solver(this, fcn, x, fvec, ib, err) Prototype

    Describes the interface of a nonlinear equation solver.

    Arguments

    Type IntentOptional Attributes Name
    class(equation_solver), intent(inout) :: this

    The equation_solver-based object.

    class(vecfcn_helper), intent(in) :: fcn

    The vecfcn_helper object containing the equations to solve.

    real(kind=real64), intent(inout), dimension(:) :: x

    On input, an N-element array containing an initial estimate to the solution. On output, the updated solution estimate. N is the number of variables.

    real(kind=real64), intent(out), dimension(:) :: fvec

    An M-element array that, on output, will contain the values of each equation as evaluated at the variable values given in x.

    type(iteration_behavior), optional :: ib

    An optional output, that if provided, allows the caller to obtain iteration performance statistics.

    class(errors), intent(inout), optional, target :: err

    An error handling object.