lineSearch_t Derived Type

type, public, extends(obj_t) :: lineSearch_t

type~~linesearch_t~~InheritsGraph type~linesearch_t lineSearch_t type~objn_t objN_t type~objn_t->type~linesearch_t parent type~obj_t obj_t type~obj_t->type~linesearch_t
Help


Objective function for a line search in an N-D space



Components

TypeVisibility AttributesNameInitial
integer, public :: derivativeOrder =2

Order of finite difference approximations

real(kind=wp), public :: stepSize =1.0E-3_wp

Step size for finite differences

class(objN_t), public, allocatable:: parent

N-D objective function

real(kind=wp), public, dimension(:), allocatable:: x0

Base point in N-space along the line

real(kind=wp), public, dimension(:), allocatable:: n0

Direction in N-space


Constructor

public interface lineSearch_t

Constructors for lineSearch_t

  • private function newLineSearch(obj, x) result(self)

    Constructor for lineSearch_t

    Arguments

    Type IntentOptional AttributesName
    class(objN_t), intent(in) :: obj

    Parent N-D objective function

    real(kind=wp), intent(in), dimension(:):: x

    Point along line

    Return Value type(lineSearch_t)

    New lineSearch_t


Type-Bound Procedures

procedure, public :: der1

  • private function der1(self, x) result(o)

    Compute the first derivative using finite differences

    Arguments

    Type IntentOptional AttributesName
    class(obj_t), intent(in) :: self

    Function to differentiate

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

    Evaluation point

    Return Value real(kind=wp)

    First derivative

procedure, public :: der2

  • private function der2(self, x) result(o)

    Compute the second derivative using finite differences

    Arguments

    Type IntentOptional AttributesName
    class(obj_t), intent(in) :: self

    Function to differentiate

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

    Evaluation point

    Return Value real(kind=wp)

    Second derivative

procedure, public :: rootNewton

  • private function rootNewton(self, x0, tol, maxIts) result(o)

    Find the root of a 1-D function using Newton's method

    Arguments

    Type IntentOptional AttributesName
    class(obj_t), intent(in) :: self

    Function for root finding

    real(kind=wp), intent(in) :: x0

    Initial guess

    real(kind=wp), intent(in), optional :: tol

    Tolerance

    integer, intent(in), optional :: maxIts

    Maximum iterations

    Return Value real(kind=wp)

    Location of root

procedure, public :: minNewton => minNewton_obj

  • private function minNewton_obj(self, x0, tol, maxIts) result(o)

    Find the minimum of a 1-D function using Newton's method

    Arguments

    Type IntentOptional AttributesName
    class(obj_t), intent(in) :: self

    Function for minimization

    real(kind=wp), intent(in) :: x0

    Intial guess

    real(kind=wp), intent(in), optional :: tol

    Tolerance

    integer, intent(in), optional :: maxIts

    Maximum iterations

    Return Value real(kind=wp)

    Location of minimum

procedure, public :: parentX

  • private function parentX(self, x) result(o)

    Convert a local 1-D x into the parent's N-space

    Arguments

    Type IntentOptional AttributesName
    class(lineSearch_t), intent(in) :: self

    Line search space

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

    Local location \(x\)

    Return Value real(kind=wp), dimension(:), allocatable

    Parent location \(\vec{x}\)

procedure, public :: eval => eval_lineSearch

  • private function eval_lineSearch(self, x) result(o)

    Evaluate the parent function at a local \(x\)

    Arguments

    Type IntentOptional AttributesName
    class(lineSearch_t), intent(in) :: self

    Line search space

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

    Local location

    Return Value real(kind=wp)

    Parent result