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 | Intent | Optional | 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 |
|
| real(kind=wp), | intent(in), | optional | :: | xb |
right end of the interval (default |
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