minimum_1d Subroutine

private pure subroutine minimum_1d(me, xmin, fmin, iflag, xa, xb)

The global minimum of a bspline_1d on (the whole spline domain if xa and xb are not present). This is a wrapper for db1min.

Type Bound

bspline_1d

Arguments

Type IntentOptional Attributes Name
class(bspline_1d), intent(inout) :: me

the spline

real(kind=wp), intent(out) :: xmin

location of the minimum

real(kind=wp), intent(out) :: fmin

minimum value

integer(kind=ip), intent(out) :: iflag

status flag (see db1min)

real(kind=wp), intent(in), optional :: xa

left end of the interval (default tx(kx))

real(kind=wp), intent(in), optional :: xb

right end of the interval (default tx(nx+1))


Calls

proc~~minimum_1d~~CallsGraph proc~minimum_1d bspline_1d%minimum_1d proc~db1min db1min proc~minimum_1d->proc~db1min proc~get_interval_1d get_interval_1d proc~minimum_1d->proc~get_interval_1d proc~db1extremum db1extremum proc~db1min->proc~db1extremum proc~check_root_inputs check_root_inputs proc~db1extremum->proc~check_root_inputs proc~dbspvd dbspvd proc~db1extremum->proc~dbspvd proc~dbvalu dbvalu proc~db1extremum->proc~dbvalu proc~spline_derivative spline_derivative proc~db1extremum->proc~spline_derivative proc~spline_roots spline_roots proc~db1extremum->proc~spline_roots proc~dbspvn dbspvn proc~dbspvd->proc~dbspvn proc~dintrv dintrv proc~dbvalu->proc~dintrv proc~spline_roots->proc~dbvalu proc~in_flat_region in_flat_region proc~spline_roots->proc~in_flat_region proc~root_dup_tol root_dup_tol proc~spline_roots->proc~root_dup_tol proc~sort_unique sort_unique proc~spline_roots->proc~sort_unique proc~get_temp_x_for_extrap get_temp_x_for_extrap proc~dintrv->proc~get_temp_x_for_extrap proc~in_flat_region->proc~dintrv

Source Code

    pure subroutine minimum_1d(me,xmin,fmin,iflag,xa,xb)

    implicit none

    class(bspline_1d),intent(inout) :: me  !! the spline
    real(wp),intent(out)            :: xmin   !! location of the minimum
    real(wp),intent(out)            :: fmin   !! minimum value
    integer(ip),intent(out)         :: iflag  !! status flag (see [[db1min]])
    real(wp),intent(in),optional    :: xa     !! left end of the interval (default `tx(kx)`)
    real(wp),intent(in),optional    :: xb     !! right end of the interval (default `tx(nx+1)`)

    real(wp) :: x1  !! left end of the interval
    real(wp) :: x2  !! right end of the interval

    if (me%initialized .and. me%nf/=1_ip) then
        iflag = 6003_ip  ! use the multiple-output version
        xmin = 0.0_wp
        fmin = 0.0_wp
    else if (me%initialized) then
        call get_interval_1d(me,xa,xb,x1,x2)
        call db1min(me%tx,me%nx,me%kx,me%bcoef(:,1),x1,x2,xmin,fmin,iflag)
    else
        xmin = 0.0_wp
        fmin = 0.0_wp
        iflag = 1_ip
    end if
    me%iflag = iflag

    end subroutine minimum_1d