arithmetic_geometric_mean_real64_type Derived Type

type, public, extends(arithmetic_geometric_mean_base_type) :: arithmetic_geometric_mean_real64_type


Components

Type Visibility Attributes Name Initial
real(kind=real64), private :: list_a(0:max_n_iter_real64)

history of the arithmetic mean

real(kind=real64), private :: list_g(0:max_n_iter_real64)

history of the geometric mean


Type-Bound Procedures

generic, public :: compute => compute_real64

  • private elemental subroutine compute_real64(agm, x, y)

    Safe wrapper for the arithmetic-geometric mean (AGM) computation.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(arithmetic_geometric_mean_real64_type), intent(inout) :: agm
    real(kind=real64), intent(in) :: x
    real(kind=real64), intent(in) :: y

generic, private :: compute_kernel => compute_kernel_real64

  • private elemental subroutine compute_kernel_real64(agm, init_a, init_g)

    Compute arithmetic–geometric mean (AGM) using the given arithmetic mean init_a and geometric mean init_g and store the complete iteration history.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(arithmetic_geometric_mean_real64_type), intent(inout) :: agm
    real(kind=real64), intent(in) :: init_a

    initial value: arithmetic mean

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

    initial value: geometric mean

procedure, private, pass :: compute_kernel_real64

  • private elemental subroutine compute_kernel_real64(agm, init_a, init_g)

    Compute arithmetic–geometric mean (AGM) using the given arithmetic mean init_a and geometric mean init_g and store the complete iteration history.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(arithmetic_geometric_mean_real64_type), intent(inout) :: agm
    real(kind=real64), intent(in) :: init_a

    initial value: arithmetic mean

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

    initial value: geometric mean

procedure, private, pass :: compute_real64

  • private elemental subroutine compute_real64(agm, x, y)

    Safe wrapper for the arithmetic-geometric mean (AGM) computation.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(arithmetic_geometric_mean_real64_type), intent(inout) :: agm
    real(kind=real64), intent(in) :: x
    real(kind=real64), intent(in) :: y

procedure, public, pass :: n_iter

  • public elemental function n_iter(agm)

    return the number of iterations performed during AGM calculation

    Arguments

    Type IntentOptional Attributes Name
    class(arithmetic_geometric_mean_base_type), intent(in) :: agm

    Return Value integer

Source Code

    type, extends(arithmetic_geometric_mean_base_type) :: arithmetic_geometric_mean_real64_type

        real(real64), private :: list_a(0:max_n_iter_real64)
        !! history of the arithmetic mean

        real(real64), private :: list_g(0:max_n_iter_real64)
        !! history of the geometric mean

        contains

        procedure, pass, private :: compute_real64
        procedure, pass, private :: compute_kernel_real64

        generic, public  :: compute        => compute_real64
        generic, private :: compute_kernel => compute_kernel_real64

    end type arithmetic_geometric_mean_real64_type