43 subroutine lnsrlb(n, l, u, nbd, x, f, fold, gd, gdold, g, d, r, t,
44 + z, stp, dnorm, dtd, xstep, stpmx, iter, ifun,
45 + iback, nfgv, info, task, boxed, cnstnd, csave,
48 character*60 task, csave
50 integer n, iter, ifun, iback, nfgv, info,
52 double precision f, fold, gd, gdold, stp, dnorm, dtd, xstep,
53 + stpmx, x(n), l(n), u(n), g(n), d(n), r(n), t(n),
69 double precision ddot,a1,a2
70 double precision one,zero,big
71 parameter(one=1.0d0,zero=0.0d0,big=1.0d+10)
72 double precision ftol,gtol,xtol
73 parameter(ftol=1.0d-3,gtol=0.9d0,xtol=0.1d0)
75 if (task(1:5) .eq.
'FG_LN')
goto 556
89 if (nbd(i) .ne. 0)
then
90 if (a1 .lt. zero .and. nbd(i) .le. 2)
then
92 if (a2 .ge. zero)
then
94 else if (a1*stpmx .lt. a2)
then
97 else if (a1 .gt. zero .and. nbd(i) .ge. 2)
then
99 if (a2 .le. zero)
then
101 else if (a1*stpmx .gt. a2)
then
110 if (iter .eq. 0 .and. .not. boxed)
then
111 stp = min(one/dnorm, stpmx)
116 call dcopy(n,x,1,t,1)
117 call dcopy(n,g,1,r,1)
124 if (ifun .eq. 0)
then
126 if (gd .ge. zero)
then
129 write(6,*)
' ascent direction in projection gd = ', gd
135 call dcsrch(f,gd,stp,ftol,gtol,xtol,zero,stpmx,csave,isave,dsave)
138 if (csave(1:4) .ne.
'CONV' .and. csave(1:4) .ne.
'WARN')
then
143 if (stp .eq. one)
then
144 call dcopy(n,z,1,x,1)
147 x(i) = stp*d(i) + t(i)
subroutine dcsrch(f, g, stp, ftol, gtol, xtol, stpmin, stpmax, task, isave, dsave)
This subroutine finds a step that satisfies a sufficient decrease condition and a curvature condition...
subroutine lnsrlb(n, l, u, nbd, x, f, fold, gd, gdold, g, d, r, t, z, stp, dnorm, dtd, xstep, stpmx, iter, ifun, iback, nfgv, info, task, boxed, cnstnd, csave, isave, dsave)
This subroutine calls subroutine dcsrch from the Minpack2 library to perform the line search....