117 INTEGER FUNCTION slaneg( N, D, LLD, SIGMA, PIVMIN, R )
128 REAL d( * ), lld( * )
135 parameter( zero = 0.0e0, one = 1.0e0 )
142 parameter( blklen = 128 )
145 INTEGER bj, j, neg1, neg2, negcnt
146 REAL 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 (
sisnan(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 (
sisnan(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 sisnan(sin)
SISNAN tests input for NaN.
integer function slaneg(n, d, lld, sigma, pivmin, r)
SLANEG computes the Sturm count.