line_search Derived Type

type, public :: line_search

Defines a type capable of performing an inexact, backtracking line search to find a point as far along the specified direction vector that is usable for unconstrained minimization problems.

See Also:


Contents


Type-Bound Procedures

procedure, public :: get_distance_factor => ls_get_dist

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

    Gets a distance factor defining the minimum distance along the search direction vector is practical.

    Arguments

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

    The line_search object.

    Return Value real(kind=real64)

    The distance factor. A value of 1 indicates the full length of the vector.

procedure, public :: get_max_fcn_evals => ls_get_max_eval

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

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

    Arguments

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

    The line_search object.

    Return Value integer(kind=int32)

    The maximum number of function evaluations.

procedure, public :: get_scaling_factor => ls_get_scale

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

    Gets the scaling of the product of the gradient and direction vectors such that , where is the search direction vector, is the gradient vector, and is the scaling factor.

    Arguments

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

    The line_search object.

    Return Value real(kind=real64)

    The scaling factor.

procedure, public, :: ls_search_mimo

  • private subroutine ls_search_mimo(this, fcn, xold, grad, dir, x, fvec, fold, fx, ib, err)

    Utilizes an inexact, backtracking line search to find a point as far along the specified direction vector that is usable for unconstrained minimization problems.

    Arguments

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

    The line_search object.

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

    A vecfcn_helper object containing the system of equations.

    real(kind=real64), intent(in), dimension(:) :: xold

    An N-element array defining the initial point, where N is the number of variables.

    real(kind=real64), intent(in), dimension(:) :: grad

    An N-element array defining the gradient of fcn evaluated at xold.

    real(kind=real64), intent(in), dimension(:) :: dir

    An N-element array defining the search direction.

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

    An N-element array where the updated solution point will be written.

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

    An M-element array containing the M equation values evaluated at x, where M is the number of equations.

    real(kind=real64), intent(in), optional :: fold

    An optional input that provides the value resulting from: . If not provided, fcn is evalauted at xold, and the aforementioned relationship is computed.

    real(kind=real64), intent(out), optional :: fx

    The result of the operation: .

    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.

procedure, public, :: ls_search_miso

  • private subroutine ls_search_miso(this, fcn, xold, grad, dir, x, fold, fx, ib, err)

    Utilizes an inexact, backtracking line search to find a point as far along the specified direction vector that is usable for unconstrained minimization problems.

    Arguments

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

    The line_search object.

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

    A fcnnvar_helper object containing the system of equations.

    real(kind=real64), intent(in), dimension(:) :: xold

    An N-element array defining the initial point, where N is the number of variables.

    real(kind=real64), intent(in), dimension(:) :: grad

    An N-element array defining the gradient of fcn evaluated at xold.

    real(kind=real64), intent(in), dimension(:) :: dir

    An N-element array defining the search direction.

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

    An N-element array where the updated solution point will be written.

    real(kind=real64), intent(in), optional :: fold

    An optional input that provides the function value at xold. If not provided, fcn is evalauted at xold.

    real(kind=real64), intent(out), optional :: fx

    The value of the function as evaluated at 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.

generic, public :: search => ls_search_mimo, ls_search_miso

  • private subroutine ls_search_mimo(this, fcn, xold, grad, dir, x, fvec, fold, fx, ib, err)

    Utilizes an inexact, backtracking line search to find a point as far along the specified direction vector that is usable for unconstrained minimization problems.

    Arguments

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

    The line_search object.

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

    A vecfcn_helper object containing the system of equations.

    real(kind=real64), intent(in), dimension(:) :: xold

    An N-element array defining the initial point, where N is the number of variables.

    real(kind=real64), intent(in), dimension(:) :: grad

    An N-element array defining the gradient of fcn evaluated at xold.

    real(kind=real64), intent(in), dimension(:) :: dir

    An N-element array defining the search direction.

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

    An N-element array where the updated solution point will be written.

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

    An M-element array containing the M equation values evaluated at x, where M is the number of equations.

    real(kind=real64), intent(in), optional :: fold

    An optional input that provides the value resulting from: . If not provided, fcn is evalauted at xold, and the aforementioned relationship is computed.

    real(kind=real64), intent(out), optional :: fx

    The result of the operation: .

    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.

  • private subroutine ls_search_miso(this, fcn, xold, grad, dir, x, fold, fx, ib, err)

    Utilizes an inexact, backtracking line search to find a point as far along the specified direction vector that is usable for unconstrained minimization problems.

    Arguments

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

    The line_search object.

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

    A fcnnvar_helper object containing the system of equations.

    real(kind=real64), intent(in), dimension(:) :: xold

    An N-element array defining the initial point, where N is the number of variables.

    real(kind=real64), intent(in), dimension(:) :: grad

    An N-element array defining the gradient of fcn evaluated at xold.

    real(kind=real64), intent(in), dimension(:) :: dir

    An N-element array defining the search direction.

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

    An N-element array where the updated solution point will be written.

    real(kind=real64), intent(in), optional :: fold

    An optional input that provides the function value at xold. If not provided, fcn is evalauted at xold.

    real(kind=real64), intent(out), optional :: fx

    The value of the function as evaluated at 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.

procedure, public :: set_distance_factor => ls_set_dist

  • private subroutine ls_set_dist(this, x)

    Sets a distance factor defining the minimum distance along the search direction vector is practical.

    Arguments

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

    The line_search object.

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

    The distance factor. A value of 1 indicates the full length of the vector. Notice, this value is restricted to lie in the set [0.1, 1.0).

procedure, public :: set_max_fcn_evals => ls_set_max_eval

  • private subroutine ls_set_max_eval(this, x)

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

    Arguments

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

    The line_search object.

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

    The maximum number of function evaluations.

procedure, public :: set_scaling_factor => ls_set_scale

  • private subroutine ls_set_scale(this, x)

    Sets the scaling of the product of the gradient and direction vectors such that , where is the search direction vector, is the gradient vector, and is the scaling factor.

    Arguments

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

    The line_search object.

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

    The scaling factor.