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