1 SUBROUTINE droots (NG, HMIN, JFLAG, X0, X1, G0, G1, GX, X, JROOT,
2 * imax, last,
alpha, x2)
11 IMPLICIT DOUBLE PRECISION(a-h,o-z)
12 INTEGER NG, JFLAG, JROOT, IMAX, LAST
13 DOUBLE PRECISION HMIN, X0, X1, G0, G1, GX, X, ALPHA, X2
14 dimension g0(ng), g1(ng), gx(ng), jroot(ng)
93 INTEGER I, IMXOLD, NXLAST
94 DOUBLE PRECISION T2, TMAX, ZERO
95 LOGICAL ZROOT, SGNCHG, XROOT
98 IF (jflag .EQ. 1) go to 200
104 IF (dabs(g1(i)) .GT. zero) go to 110
108 110
IF (dsign(1.0d0,g0(i)) .EQ. dsign(1.0d0,g1(i))) go to 120
109 t2 = dabs(g1(i)/(g1(i)-g0(i)))
110 IF (t2 .LE. tmax) go to 120
114 IF (imax .GT. 0) go to 130
118 140
IF (.NOT. sgnchg) go to 400
127 IF (nxlast .EQ. last) go to 160
130 160
IF (last .EQ. 0) go to 170
133 170 alpha = 2.0d0*alpha
134 180 x2 = x1 - (x1-x0)*g1(imax)/(g1(imax) - alpha*g0(imax))
135 IF ((dabs(x2-x0) .LT. hmin) .AND.
136 1 (dabs(x1-x0) .GT. 10.0d0*hmin)) x2 = x0 + 0.1d0*(x1-x0)
147 IF (dabs(gx(i)) .GT. zero) go to 210
151 210
IF (dsign(1.0d0,g0(i)) .EQ. dsign(1.0d0,gx(i))) go to 220
152 t2 = dabs(gx(i)/(gx(i) - g0(i)))
153 IF (t2 .LE. tmax) go to 220
157 IF (imax .GT. 0) go to 230
163 IF (.NOT. sgnchg) go to 250
166 CALL dcopy(ng, gx, 1, g1, 1)
170 250
IF (.NOT. zroot) go to 260
173 CALL dcopy(ng, gx, 1, g1, 1)
178 CALL dcopy(ng, gx, 1, g0, 1)
182 270
IF (dabs(x1-x0) .LE. hmin) xroot = .true.
188 CALL dcopy(ng, g1, 1, gx, 1)
191 IF (dabs(g1(i)) .GT. zero) go to 310
194 310
IF (dsign(1.0d0,g0(i)) .NE. dsign(1.0d0,g1(i))) jroot(i) = 1
199 400
IF (.NOT. zroot) go to 420
203 CALL dcopy(ng, g1, 1, gx, 1)
206 IF (dabs(g1(i)) .LE. zero) jroot(i) = 1
212 420 CALL dcopy(ng, g1, 1, gx, 1)
std::string dimension(void) const
subroutine droots(NG, HMIN, JFLAG, X0, X1, G0, G1, GX, X, JROOT, IMAX, LAST, ALPHA, X2)