119 INTEGER FUNCTION slaneg( N, D, LLD, SIGMA, PIVMIN, R )
131 REAL d( * ), lld( * )
138 parameter( zero = 0.0e0, one = 1.0e0 )
145 parameter( blklen = 128 )
148 INTEGER bj, j, neg1, neg2, negcnt
149 REAL bsav, dminus, dplus, gamma, p, t, tmp
165 DO 210 bj = 1, r-1, blklen
168 DO 21 j = bj, min(bj+blklen-1, r-1)
170 IF( dplus.LT.zero ) neg1 = neg1 + 1
172 t = tmp * lld( j ) - sigma
182 DO 22 j = bj, min(bj+blklen-1, r-1)
184 IF( dplus.LT.zero ) neg1 = neg1 + 1
186 IF (
sisnan(tmp)) tmp = one
187 t = tmp * lld(j) - sigma
190 negcnt = negcnt + neg1
195 DO 230 bj = n-1, r, -blklen
198 DO 23 j = bj, max(bj-blklen+1, r), -1
199 dminus = lld( j ) + p
200 IF( dminus.LT.zero ) neg2 = neg2 + 1
202 p = tmp * d( j ) - sigma
210 DO 24 j = bj, max(bj-blklen+1, r), -1
211 dminus = lld( j ) + p
212 IF( dminus.LT.zero ) neg2 = neg2 + 1
214 IF (
sisnan(tmp)) tmp = one
215 p = tmp * d(j) - sigma
218 negcnt = negcnt + neg2
223 gamma = (t + sigma) + p
224 IF( gamma.LT.zero ) negcnt = negcnt+1