Returns the function values at ax
and bx
to start the root finding algorithm.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(root_solver), | intent(inout) | :: | me | |||
real(kind=wp), | intent(in) | :: | ax |
left endpoint of initial interval |
||
real(kind=wp), | intent(in) | :: | bx |
right endpoint of initial interval |
||
real(kind=wp), | intent(in), | optional | :: | fax |
if |
|
real(kind=wp), | intent(in), | optional | :: | fbx |
if |
|
real(kind=wp), | intent(out) | :: | fa |
|
||
real(kind=wp), | intent(out) | :: | fb |
|
subroutine get_fa_fb(me,ax,bx,fax,fbx,fa,fb) implicit none class(root_solver),intent(inout) :: me real(wp),intent(in) :: ax !! left endpoint of initial interval real(wp),intent(in) :: bx !! right endpoint of initial interval real(wp),intent(in),optional :: fax !! if `f(ax)` is already known, it can be input here real(wp),intent(in),optional :: fbx !! if `f(bx)` is already known, it can be input here real(wp),intent(out) :: fa !! `f(ax)` to use real(wp),intent(out) :: fb !! `f(ax)` to use if (present(fax)) then fa = fax else fa = me%f(ax) end if if (present(fbx)) then fb = fbx else fb = me%f(bx) end if end subroutine get_fa_fb