217 integer,
parameter :: dp = kind(1.0d0)
218 integer,
intent(in) :: n
219 real(kind=dp),
intent(in) :: factr_in
220 real(kind=dp),
intent(in) :: pgtol_in
221 real(kind=dp),
dimension(n),
intent(inout) :: x
223 integer,
parameter :: m = 5, iprint = 1
225 real(dp) :: factr = 1.0d+7, pgtol = 1.0d-5
227 character(len=60) :: task, csave
231 real(dp) :: dsave(29)
232 integer,
allocatable :: nbd(:), iwa(:)
233 real(dp),
allocatable :: l(:), u(:), g(:), wa(:)
243 allocate ( nbd(n), l(n), u(n), g(n) )
244 allocate ( iwa(3*n) )
245 allocate ( wa(2*m*n + 5*n + 11*m*m + 8*m) )
253 16
format(/,5x,
'Solving sample problem.', &
254 /,5x,
' (f = 0.0 at the optimal solution.)',/)
262 do while(task(1:2).eq.
'FG'.or.task.eq.
'NEW_X'.or. &
268 call setulb( n, m, x, l, u, nbd, f, g, factr, pgtol, &
269 wa, iwa, task, iprint,&
270 csave, lsave, isave, dsave )
272 if (task(1:2) .eq.
'FG')
then
subroutine fcn(n, x, f, g)
This is the subroutine which the optimization routines call to get the objective function value and i...
subroutine lbfgs_sub(n, factr_in, pgtol_in, x)
Limited memory BFGS unconstrained optimization code as callable subroutine.