arithmetic_geometric_mean_real128_type Derived Type

type, public, extends(arithmetic_geometric_mean_base_type) :: arithmetic_geometric_mean_real128_type


Components

Type Visibility Attributes Name Initial
real(kind=real128), private :: list_a(0:max_n_iter_real128)

history of the arithmetic mean

real(kind=real128), private :: list_g(0:max_n_iter_real128)

history of the geometric mean


Type-Bound Procedures

generic, public :: compute => compute_real128

generic, private :: compute_kernel => compute_kernel_real128

  • private elemental subroutine compute_kernel_real128(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_real128_type), intent(inout) :: agm
    real(kind=real128), intent(in) :: init_a

    initial value: arithmetic mean

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

    initial value: geometric mean

procedure, private, pass :: compute_kernel_real128

  • private elemental subroutine compute_kernel_real128(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_real128_type), intent(inout) :: agm
    real(kind=real128), intent(in) :: init_a

    initial value: arithmetic mean

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

    initial value: geometric mean

procedure, private, pass :: compute_real128

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_real128_type

        real(real128), private :: list_a(0:max_n_iter_real128)
        !! history of the arithmetic mean

        real(real128), private :: list_g(0:max_n_iter_real128)
        !! history of the geometric mean

        contains

        procedure, pass, private :: compute_real128
        procedure, pass, private :: compute_kernel_real128

        generic, public  :: compute        => compute_real128
        generic, private :: compute_kernel => compute_kernel_real128

    end type arithmetic_geometric_mean_real128_type