Extract the arithmetic-geometric mean value at a specific iteration.
Specifically, this function returns the smaller 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_real64_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
elemental function min_selectable_real64(agm, i) result(min_selectable) !! Extract the arithmetic-geometric mean value at a specific iteration. !! Specifically, this function returns the smaller 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) :: min_selectable min_selectable = min( agm%list_a(i), agm%list_g(i) ) end function min_selectable_real64