Line search. More...
Go to the source code of this file.
Data Types | |
module | linesrch |
Line search data. More... |
Functions/Subroutines | |
subroutine | ptline (n, x, f, g, s, step, info) |
Perform linesearch. | |
subroutine | ptldef (gtole, stmax, minfe, maxfe) |
Initialize line search. | |
subroutine | ptlopt (nf, m, slopes, steps) |
Get details. | |
subroutine | ptlprt (lunp) |
Print line search data. |
Line search.
Line search routine with sufficient decrease of slope.
In many minimization problems the objective function is close to quadratic, except far from the solution. Close to the minimum the behaviour may be almost quadratic or, due to round-off errors, it may have a non-smooth behaviour, which often complicates any further progress and the recognition of convergence. Round-off errors affect the function value, which may be large and small parameter changes result in small relative changes of the function value. Close to the minimum the gradient becomes small and the behaviour is not so much affected by Round-off errors.
CALL PTLDEF(0.0,0.0, 0,0) ! init line search N=... X(.)=... D(.)=... ALPHA=1.0D0 10 F(X)=... G(X)=... IF(.) S(X)=.. CALL PTLINE(N,X,F,G,D,ALPHA,INFO) IF(INFO.LT.0) GOTO 10
Definition in file linesrch.f90.
subroutine ptldef | ( | real, intent(in) | gtole, |
real, intent(in) | stmax, | ||
integer, intent(in) | minfe, | ||
integer, intent(in) | maxfe | ||
) |
Initialize line search.
[in] | gtole | slope ratio |
[in] | stmax | total step limit |
[in] | minfe | minimum number of evaluations |
[in] | maxfe | maximum number of evaluations — range —- default slope ratio 1.0E-4 ... 0.9 0.9 min. F-calls 1 ... 2 1 max. F-calls 2 ... 10 5 |
Definition at line 211 of file linesrch.f90.
Referenced by xloopn().
subroutine ptline | ( | integer, intent(in) | n, |
double precision, dimension(n), intent(inout) | x, | ||
double precision, intent(inout) | f, | ||
double precision, dimension(n), intent(inout) | g, | ||
double precision, dimension(n), intent(inout) | s, | ||
double precision, intent(out) | step, | ||
integer, intent(out) | info | ||
) |
Perform linesearch.
[in] | N | dimension of problem |
[in,out] | X | current iterate |
[in,out] | F | associated function value |
[in,out] | G | associated gradient |
[in,out] | S | search vector |
[out] | STEP | step factor (initially = 1.0) |
[out] | INFO | information = -1 repeat function evaluation = 0 input error (e.g. gradient not negative) = 1 convergence reached = 2 convergence assumed, but round-off errors = 3 too many function calls = 4 step factor ALPHA to small (ALPHA <= TOL) |
Definition at line 68 of file linesrch.f90.
Referenced by xloopn().
subroutine ptlopt | ( | integer, intent(out) | nf, |
integer, intent(out) | m, | ||
real, dimension(3), intent(out) | slopes, | ||
real, dimension(3), intent(out) | steps | ||
) |
Get details.
[out] | NF | number of function values |
[out] | M | index of function value with smallest slope |
[out] | SLOPES | initial, current, smallest slope |
[out] | STEPS | initial position, current, smallest step |
Definition at line 237 of file linesrch.f90.
subroutine ptlprt | ( | integer, intent(in) | lunp | ) |
Print line search data.
[in] | lunp | unit number |
Definition at line 273 of file linesrch.f90.
Referenced by xloopn().