117 INTEGER FUNCTION dlaneg( N, D, LLD, SIGMA, PIVMIN, R )
125 DOUBLE PRECISION pivmin, sigma
128 DOUBLE PRECISION d( * ), lld( * )
134 DOUBLE PRECISION zero, one
135 parameter( zero = 0.0d0, one = 1.0d0 )
142 parameter( blklen = 128 )
145 INTEGER bj, j, neg1, neg2, negcnt
146 DOUBLE PRECISION bsav, dminus, dplus, gamma, p, t, tmp
162 DO 210 bj = 1, r-1, blklen
165 DO 21 j = bj, min(bj+blklen-1, r-1)
167 IF( dplus.LT.zero ) neg1 = neg1 + 1
169 t = tmp * lld( j ) - sigma
179 DO 22 j = bj, min(bj+blklen-1, r-1)
181 IF( dplus.LT.zero ) neg1 = neg1 + 1
183 IF (
disnan(tmp)) tmp = one
184 t = tmp * lld(j) - sigma
187 negcnt = negcnt + neg1
192 DO 230 bj = n-1, r, -blklen
195 DO 23 j = bj, max(bj-blklen+1, r), -1
196 dminus = lld( j ) + p
197 IF( dminus.LT.zero ) neg2 = neg2 + 1
199 p = tmp * d( j ) - sigma
207 DO 24 j = bj, max(bj-blklen+1, r), -1
208 dminus = lld( j ) + p
209 IF( dminus.LT.zero ) neg2 = neg2 + 1
211 IF (
disnan(tmp)) tmp = one
212 p = tmp * d(j) - sigma
215 negcnt = negcnt + neg2
220 gamma = (t + sigma) + p
221 IF( gamma.LT.zero ) negcnt = negcnt+1
logical function disnan(din)
DISNAN tests input for NaN.
integer function dlaneg(n, d, lld, sigma, pivmin, r)
DLANEG computes the Sturm count.