max_selectable_real64 Function

private elemental function max_selectable_real64(agm, i) result(max_selectable)

Extract the arithmetic-geometric mean value at a specific iteration.
Specifically, this function returns the larger of the two values.

Warning

This function assumes the AGM computation has been performed via the compute method.
If called on an uninitialized or improperly computed AGM object, the result may be NaN or undefined.

The iteration index i must be valid: 0 <= i <= n_iter.
No bounds checking is performed; invalid indices may cause undefined behavior.

Arguments

Type IntentOptional Attributes Name
type(arithmetic_geometric_mean_real64_type), intent(in) :: agm
integer, intent(in) :: i

Return Value real(kind=real64)


Source Code

    elemental function max_selectable_real64(agm, i) result(max_selectable)
        !! Extract the arithmetic-geometric mean value at a specific iteration.  
        !! Specifically, this function returns the larger of the two values.
        !!
        !! @warning
        !! This function assumes the AGM computation has been performed via the `compute` method.  
        !! If called on an uninitialized or improperly computed AGM object,
        !! the result may be NaN or undefined.
        !!
        !! The iteration index `i` must be valid: `0 <= i <= n_iter`.  
        !! No bounds checking is performed; invalid indices may cause undefined behavior.
        !! @endwarning

        type(arithmetic_geometric_mean_real64_type), intent(in) :: agm

        integer, intent(in) :: i



        real(real64) :: max_selectable



        max_selectable = max( agm%list_a(i), agm%list_g(i) )

    end function max_selectable_real64