oracle_t Derived Type

type, public, abstract, extends(object_t) :: oracle_t

define procedures for testing output values against expected values


Inherits

type~~oracle_t~~InheritsGraph type~oracle_t oracle_t type~object_t object_t type~oracle_t->type~object_t

Type-Bound Procedures

procedure, public :: mark_as_defined

  • interface

    private pure module subroutine mark_as_defined(self)

    Mark the object as user-defined

    Arguments

    Type IntentOptional Attributes Name
    class(object_t), intent(inout) :: self

procedure(norm_interface), public, deferred :: norm

  • pure function norm_interface(self) result(norm_of_self) Prototype

    result is a norm of the array formed by concatenating the real components of self object

    Arguments

    Type IntentOptional Attributes Name
    class(oracle_t), intent(in) :: self

    Return Value real

generic, public :: operator(-) => subtract

  • function subtract_interface(self, rhs) result(difference) Prototype

    result has components corresponding to subtracting rhs's components fron self object's components

    Arguments

    Type IntentOptional Attributes Name
    class(oracle_t), intent(in) :: self
    class(oracle_t), intent(in) :: rhs

    Return Value class(oracle_t), allocatable

procedure(subtract_interface), public, deferred :: subtract

  • function subtract_interface(self, rhs) result(difference) Prototype

    result has components corresponding to subtracting rhs's components fron self object's components

    Arguments

    Type IntentOptional Attributes Name
    class(oracle_t), intent(in) :: self
    class(oracle_t), intent(in) :: rhs

    Return Value class(oracle_t), allocatable

procedure, public :: user_defined

  • interface

    private pure module function user_defined(self) result(is_defined)

    Return a boolean result indicating whether self object has been initialized since its declaration

    Arguments

    Type IntentOptional Attributes Name
    class(object_t), intent(in) :: self

    Return Value logical

procedure, public :: within_tolerance

  • interface

    private module function within_tolerance(self, reference, tolerance) result(in_tolerance)

    template method with true result iff the difference in state vectors (self - reference) has a norm within tolerance (impure because of internal call to 'subtract' binding) The existence of self procedure eliminates the need to rewrite similar code for every oracle child type.

    Arguments

    Type IntentOptional Attributes Name
    class(oracle_t), intent(in) :: self
    class(oracle_t), intent(in) :: reference
    real, intent(in) :: tolerance

    Return Value logical

generic, public :: write(formatted) => write_formatted

  • subroutine write_interface(self, unit, iotype, v_list, iostat, iomsg) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(object_t), intent(in) :: self
    integer, intent(in) :: unit
    character(len=*), intent(in) :: iotype
    integer, intent(in) :: v_list(:)
    integer, intent(out) :: iostat
    character(len=*), intent(inout) :: iomsg

procedure(write_interface), public, deferred :: write_formatted

  • subroutine write_interface(self, unit, iotype, v_list, iostat, iomsg) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(object_t), intent(in) :: self
    integer, intent(in) :: unit
    character(len=*), intent(in) :: iotype
    integer, intent(in) :: v_list(:)
    integer, intent(out) :: iostat
    character(len=*), intent(inout) :: iomsg