the main class
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
procedure(func), | public, | pointer | :: | f | => | null() |
function to be minimized |
Set the function to be minimized.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(brent_class), | intent(inout) | :: | me | |||
procedure(func) | :: | f |
An approximation x to the point where f attains a minimum on the interval (ax,bx) is determined.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(brent_class), | 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) | :: | tol |
desired length of the interval of uncertainty of the final result (>=0) |
abcissa approximating the point where f attains a minimum
Find a zero of the function in the given interval to within a tolerance , where is the relative machine precision defined as the smallest representable number such that .
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(brent_class), | 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) | :: | tol |
desired length of the interval of uncertainty of the final result (>=0) |
||
real(kind=wp), | intent(out) | :: | xzero |
abscissa approximating a zero of |
||
real(kind=wp), | intent(out) | :: | fzero |
value of |
||
integer, | intent(out) | :: | iflag |
status flag ( |
||
real(kind=wp), | intent(in), | optional | :: | fax |
if |
|
real(kind=wp), | intent(in), | optional | :: | fbx |
if |
type,public :: brent_class !! the main class procedure(func),pointer :: f => null() !! function to be minimized contains procedure :: set_function procedure :: minimize => fmin procedure :: find_zero => zeroin end type brent_class