arithmetic_geometric_mean_real32_type Derived Type

type, public, extends(arithmetic_geometric_mean_base_type) :: arithmetic_geometric_mean_real32_type


Components

Type Visibility Attributes Name Initial
real(kind=real32), private :: list_a(0:max_n_iter_real32)

history of the arithmetic mean

real(kind=real32), private :: list_g(0:max_n_iter_real32)

history of the geometric mean


Type-Bound Procedures

generic, public :: compute => compute_real32

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

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

    Read more…

    Arguments

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

generic, private :: compute_kernel => compute_kernel_real32

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

    initial value: arithmetic mean

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

    initial value: geometric mean

procedure, private, pass :: compute_kernel_real32

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

    initial value: arithmetic mean

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

    initial value: geometric mean

procedure, private, pass :: compute_real32

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

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

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(arithmetic_geometric_mean_real32_type), intent(inout) :: agm
    real(kind=real32), intent(in) :: x
    real(kind=real32), 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_real32_type

        real(real32), private :: list_a(0:max_n_iter_real32)
        !! history of the arithmetic mean

        real(real32), private :: list_g(0:max_n_iter_real32)
        !! history of the geometric mean

        contains

        procedure, pass, private :: compute_real32
        procedure, pass, private :: compute_kernel_real32

        generic, public  :: compute        => compute_real32
        generic, private :: compute_kernel => compute_kernel_real32

    end type arithmetic_geometric_mean_real32_type