SND@LHC Software
|
Line search. More...
Go to the source code of this file.
Modules | |
module | linesrch |
Line search data. | |
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. | |
Variables | |
integer(mpi), parameter | linesrch::msfd =20 |
integer(mpi) | linesrch::nsfd |
number of function calls | |
integer(mpi) | linesrch::idgl |
index of smallest negative slope | |
integer(mpi) | linesrch::idgr |
index of smallest positive slope | |
integer(mpi) | linesrch::idgm |
index of minimal slope | |
integer(mpi) | linesrch::minf =1 |
min. number of function calls | |
integer(mpi) | linesrch::maxf =5 |
max. number of function calls | |
integer(mpi) | linesrch::lsinfo |
(status) information | |
real(mpd), dimension(4, msfd) | linesrch::sfd |
abscissa; function value; slope; predicted zero | |
real(mpd) | linesrch::stmx =0.9 |
maximum slope ratio | |
real(mpd) | linesrch::gtol |
slope ratio | |
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(mps), intent(in) | gtole, |
real(mps), intent(in) | stmax, | ||
integer(mpi), intent(in) | minfe, | ||
integer(mpi), 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 232 of file linesrch.f90.
subroutine ptline | ( | integer(mpi), intent(in) | n, |
real(mpd), dimension(n), intent(inout) | x, | ||
real(mpd), intent(inout) | f, | ||
real(mpd), dimension(n), intent(inout) | g, | ||
real(mpd), dimension(n), intent(inout) | s, | ||
real(mpd), intent(out) | step, | ||
integer(mpi), 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 89 of file linesrch.f90.
subroutine ptlopt | ( | integer(mpi), intent(out) | nf, |
integer(mpi), intent(out) | m, | ||
real(mps), dimension(3), intent(out) | slopes, | ||
real(mps), 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 258 of file linesrch.f90.
subroutine ptlprt | ( | integer(mpi), intent(in) | lunp | ) |
Print line search data.
[in] | lunp | unit number |
Definition at line 294 of file linesrch.f90.