70 subroutine lnsrlb(n, l, u, nbd, x, f, fold, gd, gdold, g, d, r, t,
71 + z, stp, dnorm, dtd, xstep, stpmx, iter, ifun,
72 + iback, nfgv, info, task, boxed, cnstnd, csave,
75 character*60 task, csave
77 integer n, iter, ifun, iback, nfgv, info,
79 double precision f, fold, gd, gdold, stp, dnorm, dtd, xstep,
80 + stpmx, x(n), l(n), u(n), g(n), d(n), r(n), t(n),
96 double precision ddot,a1,a2
97 double precision one,zero,big
98 parameter(one=1.0d0,zero=0.0d0,big=1.0d+10)
109 double precision ftol,gtol,xtol
110 parameter (ftol=1.0d-3,gtol=0.9d0,xtol=0.1d0)
112 if (task(1:5) .eq.
'FG_LN')
goto 556
114 dtd = ddot(n,d,1,d,1)
121 if (iter .eq. 0)
then
126 if (nbd(i) .ne. 0)
then
127 if (a1 .lt. zero .and. nbd(i) .le. 2)
then
129 if (a2 .ge. zero)
then
131 else if (a1*stpmx .lt. a2)
then
134 else if (a1 .gt. zero .and. nbd(i) .ge. 2)
then
136 if (a2 .le. zero)
then
138 else if (a1*stpmx .gt. a2)
then
147 if (iter .eq. 0 .and. .not. boxed)
then
148 stp = min(one/dnorm, stpmx)
153 call dcopy(n,x,1,t,1)
154 call dcopy(n,g,1,r,1)
161 if (ifun .eq. 0)
then
163 if (gd .ge. zero)
then
166 write(6,*)
' ascent direction in projection gd = ', gd
172 call dcsrch(f,gd,stp,ftol,gtol,xtol,zero,stpmx,csave,isave,dsave)
175 if (csave(1:4) .ne.
'CONV' .and. csave(1:4) .ne.
'WARN')
then
180 if (stp .eq. one)
then
181 call dcopy(n,z,1,x,1)
184 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....