maximum_1d Subroutine

private pure subroutine maximum_1d(me, xmax, fmax, iflag, xa, xb)

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

Type Bound

bspline_1d

Arguments

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

the spline

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

location of the maximum

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

maximum value

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

status flag (see db1max)

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~~maximum_1d~~CallsGraph proc~maximum_1d bspline_1d%maximum_1d proc~db1max db1max proc~maximum_1d->proc~db1max proc~get_interval_1d get_interval_1d proc~maximum_1d->proc~get_interval_1d proc~db1extremum db1extremum proc~db1max->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 maximum_1d(me,xmax,fmax,iflag,xa,xb)

    implicit none

    class(bspline_1d),intent(inout) :: me  !! the spline
    real(wp),intent(out)            :: xmax   !! location of the maximum
    real(wp),intent(out)            :: fmax   !! maximum value
    integer(ip),intent(out)         :: iflag  !! status flag (see [[db1max]])
    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
        xmax = 0.0_wp
        fmax = 0.0_wp
    else if (me%initialized) then
        call get_interval_1d(me,xa,xb,x1,x2)
        call db1max(me%tx,me%nx,me%kx,me%bcoef(:,1),x1,x2,xmax,fmax,iflag)
    else
        xmax = 0.0_wp
        fmax = 0.0_wp
        iflag = 1_ip
    end if
    me%iflag = iflag

    end subroutine maximum_1d