objN_t Derived Type

type, public, abstract :: objN_t

Type for an N-D objective function

Inherited By

type~~objn_t~~InheritedByGraph type~objn_t objN_t type~linesearch_t lineSearch_t type~objn_t->type~linesearch_t parent
Help

Components

TypeVisibility AttributesNameInitial
integer, public :: derivativeOrder =2

Order for finite difference approximations

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

Step size for finite differences


Type-Bound Procedures

procedure, public :: grad

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

    Compute the gradient using finite differences

    Arguments

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

    Function for gradient calculation

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

    Evaluation point

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

    Gradient

procedure, public :: hessian

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

    Compute the hessian using finite differences

    Arguments

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

    Function for hessian calculation

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

    Evaluation point

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

    Hessian

procedure, public :: steepestDescent

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

    Find the minimum using the steepest descent method

    Arguments

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

    Function for minimization

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

    Initial guess

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

    Tolerance

    integer, intent(in), optional :: maxIts

    Maximum iterations

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

    Location of minimum

procedure, public :: nelderMead

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

    Find the minimum of an N-D function using Nelder-Mead's simplex method

    Arguments

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

    Function for minimization

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

    Initial guess

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

    Tolerance

    integer, intent(in), optional :: maxIts

    Maximum iterations

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

    Location of minimum

procedure, public :: minNewton => minNewton_objN

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

    Find the minimum of an N-D function using Newton's method

    Arguments

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

    Function for minimization

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

    Initial guess

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

    Tolerance

    integer, intent(in), optional :: maxIts

    Maximum iterations

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

    Location of minimum

procedure(evalN_p), public, deferred :: eval

  • function evalN_p(self, x) result(o) Prototype

    Evaluate an objectgive function at point \(\vec{x}\)

    Arguments

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

    Objective function

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

    Evaluation point

    Return Value real(kind=wp)

    Function result