32 integer,
parameter :: rk = kind(1.0d0)
34 integer,
intent(in) :: method
35 integer,
intent(in) :: n
36 real(kind=rk),
intent(in) :: epsin
37 real(kind=rk),
dimension(n),
intent(inout) :: x
39 real(kind=rk),
dimension(n) :: g,d,gold,w
40 real(kind=rk) :: f,eps,tlev
41 real(kind=rk) :: time1,time2,tottime
42 real(kind=rk),
parameter :: one=1.0d0
44 integer :: iprint(2),iflag,icall,i
45 integer :: iter,nfun,irest
82 if (iprint(1) .ge. 0)
then
84 write(*,840) n, method, irest
113 CALL cgfam(n,x,f,g,d,gold,iprint,eps,w,iflag,irest,method,finish )
121 IF(iflag.LE.0.OR.icall.GT.10000) go to 50
131 tlev= eps*(one + dabs(f))
138 IF(dabs(g(i)).GT.tlev)
THEN
151 if (iprint(1).ge.0.and.iflag.ge.0)
then
159 820
format (//,
' Conjugate Gradient Minimization Routine', /)
160 840
format (/,
' n =', i6, /,
' method =', i6,/,
' irest =', i6,/)
161 850
format (/,
' Error: negative N value'/)
162 890
format (/,
' f(x*) =', 1pd16.8)
subroutine subroutine_cg(method, n, epsin, x)
Nonlinear Conjugate gradient method as callable subroutine.
subroutine fcn(n, x, f, g)
This is the subroutine which the optimization routines call to get the objective function value and i...