Millepede-II V04-17-03
Modules | Functions/Subroutines | Variables
linesrch.f90 File Reference

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. More...
 
subroutine ptldef (gtole, stmax, minfe, maxfe)
 Initialize line search. More...
 
subroutine ptlopt (nf, m, slopes, steps)
 Get details. More...
 
subroutine ptlprt (lunp)
 Print line search data. More...
 

Variables

integer(mpi), parameter linesrch::msfd =20
 
integer(mpi) linesrch::nsfd
 number of function calls More...
 
integer(mpi) linesrch::idgl
 index of smallest negative slope More...
 
integer(mpi) linesrch::idgr
 index of smallest positive slope More...
 
integer(mpi) linesrch::idgm
 index of minimal slope More...
 
integer(mpi) linesrch::minf =1
 min. More...
 
integer(mpi) linesrch::maxf =5
 max. More...
 
integer(mpi) linesrch::lsinfo
 (status) information More...
 
real(mpd), dimension(4, msfd) linesrch::sfd
 abscissa; function value; slope; predicted zero More...
 
real(mpd) linesrch::stmx =0.9
 maximum slope ratio More...
 
real(mpd) linesrch::gtol
 slope ratio More...
 

Detailed Description

Line search.

Author
Volker Blobel, University Hamburg, 2005-2009 (initial Fortran77 version)
Claus Kleinwort, DESY (maintenance and developement)

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.

Function/Subroutine Documentation

◆ ptldef()

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.

Parameters
[in]gtoleslope ratio
[in]stmaxtotal step limit
[in]minfeminimum number of evaluations
[in]maxfemaximum 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.

References linesrch::gtol, linesrch::maxf, linesrch::minf, linesrch::msfd, linesrch::nsfd, and linesrch::stmx.

Referenced by xloopn().

◆ ptline()

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.

Parameters
[in]Ndimension of problem
[in,out]Xcurrent iterate
[in,out]Fassociated function value
[in,out]Gassociated gradient
[in,out]Ssearch vector
[out]STEPstep factor (initially = 1.0)
[out]INFOinformation
 = -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.

Referenced by xloopn().

◆ ptlopt()

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.

Parameters
[out]NFnumber of function values
[out]Mindex of function value with smallest slope
[out]SLOPESinitial, current, smallest slope
[out]STEPSinitial position, current, smallest step

Definition at line 258 of file linesrch.f90.

References linesrch::nsfd, and linesrch::sfd.

Referenced by ploopb(), and ploopc().

◆ ptlprt()

subroutine ptlprt ( integer(mpi), intent(in)  lunp)

Print line search data.

Parameters
[in]lunpunit number

Definition at line 294 of file linesrch.f90.

References linesrch::gtol, linesrch::idgl, linesrch::idgr, linesrch::lsinfo, linesrch::maxf, linesrch::minf, linesrch::nsfd, linesrch::sfd, and linesrch::stmx.

Referenced by xloopn().