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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real128_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
elemental function max_selectable_real128(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_real128_type), intent(in) :: agm integer, intent(in) :: i real(real128) :: max_selectable max_selectable = max( agm%list_a(i), agm%list_g(i) ) end function max_selectable_real128