test_t Derived Type

type, public, extends(obj_t) :: test_t

type~~test_t~~InheritsGraph type~test_t test_t type~obj_t obj_t type~obj_t->type~test_t
Help



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


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 :: eval => eval_test

  • public function eval_test(self, x) result(o)

    Arguments

    Type IntentOptional AttributesName
    class(test_t), intent(in) :: self
    real(kind=wp), intent(in) :: x

    Return Value real(kind=wp)