227 SUBROUTINE dlar1v( N, B1, BN, LAMBDA, D, L, LD, LLD,
228 $ PIVMIN, GAPTOL, Z, WANTNC, NEGCNT, ZTZ, MINGMA,
229 $ R, ISUPPZ, NRMINV, RESID, RQCORR, WORK )
237 INTEGER B1, BN, N, NEGCNT, R
238 DOUBLE PRECISION GAPTOL, LAMBDA, MINGMA, NRMINV, PIVMIN, RESID,
243 DOUBLE PRECISION D( * ), L( * ), LD( * ), LLD( * ),
245 DOUBLE PRECISION Z( * )
251 DOUBLE PRECISION ZERO, ONE
252 PARAMETER ( ZERO = 0.0d0, one = 1.0d0 )
256 LOGICAL SAWNAN1, SAWNAN2
257 INTEGER I, INDLPL, INDP, INDS, INDUMN, NEG1, NEG2, R1,
259 DOUBLE PRECISION DMINUS, DPLUS, EPS, S, TMP
263 DOUBLE PRECISION DLAMCH
264 EXTERNAL disnan, dlamch
271 eps = dlamch(
'Precision' )
292 work( inds+b1-1 ) = lld( b1-1 )
301 s = work( inds+b1-1 ) - lambda
304 work( indlpl+i ) = ld( i ) / dplus
305 IF(dplus.LT.zero) neg1 = neg1 + 1
306 work( inds+i ) = s*work( indlpl+i )*l( i )
307 s = work( inds+i ) - lambda
309 sawnan1 = disnan( s )
310 IF( sawnan1 )
GOTO 60
313 work( indlpl+i ) = ld( i ) / dplus
314 work( inds+i ) = s*work( indlpl+i )*l( i )
315 s = work( inds+i ) - lambda
317 sawnan1 = disnan( s )
323 s = work( inds+b1-1 ) - lambda
326 IF(abs(dplus).LT.pivmin) dplus = -pivmin
327 work( indlpl+i ) = ld( i ) / dplus
328 IF(dplus.LT.zero) neg1 = neg1 + 1
329 work( inds+i ) = s*work( indlpl+i )*l( i )
330 IF( work( indlpl+i ).EQ.zero )
331 $ work( inds+i ) = lld( i )
332 s = work( inds+i ) - lambda
336 IF(abs(dplus).LT.pivmin) dplus = -pivmin
337 work( indlpl+i ) = ld( i ) / dplus
338 work( inds+i ) = s*work( indlpl+i )*l( i )
339 IF( work( indlpl+i ).EQ.zero )
340 $ work( inds+i ) = lld( i )
341 s = work( inds+i ) - lambda
350 work( indp+bn-1 ) = d( bn ) - lambda
351 DO 80 i = bn - 1, r1, -1
352 dminus = lld( i ) + work( indp+i )
353 tmp = d( i ) / dminus
354 IF(dminus.LT.zero) neg2 = neg2 + 1
355 work( indumn+i ) = l( i )*tmp
356 work( indp+i-1 ) = work( indp+i )*tmp - lambda
358 tmp = work( indp+r1-1 )
359 sawnan2 = disnan( tmp )
364 DO 100 i = bn-1, r1, -1
365 dminus = lld( i ) + work( indp+i )
366 IF(abs(dminus).LT.pivmin) dminus = -pivmin
367 tmp = d( i ) / dminus
368 IF(dminus.LT.zero) neg2 = neg2 + 1
369 work( indumn+i ) = l( i )*tmp
370 work( indp+i-1 ) = work( indp+i )*tmp - lambda
372 $ work( indp+i-1 ) = d( i ) - lambda
379 mingma = work( inds+r1-1 ) + work( indp+r1-1 )
380 IF( mingma.LT.zero ) neg1 = neg1 + 1
386 IF( abs(mingma).EQ.zero )
387 $ mingma = eps*work( inds+r1-1 )
389 DO 110 i = r1, r2 - 1
390 tmp = work( inds+i ) + work( indp+i )
392 $ tmp = eps*work( inds+i )
393 IF( abs( tmp ).LE.abs( mingma ) )
THEN
408 IF( .NOT.sawnan1 .AND. .NOT.sawnan2 )
THEN
409 DO 210 i = r-1, b1, -1
410 z( i ) = -( work( indlpl+i )*z( i+1 ) )
411 IF( (abs(z(i))+abs(z(i+1)))* abs(ld(i)).LT.gaptol )
417 ztz = ztz + z( i )*z( i )
422 DO 230 i = r - 1, b1, -1
423 IF( z( i+1 ).EQ.zero )
THEN
424 z( i ) = -( ld( i+1 ) / ld( i ) )*z( i+2 )
426 z( i ) = -( work( indlpl+i )*z( i+1 ) )
428 IF( (abs(z(i))+abs(z(i+1)))* abs(ld(i)).LT.gaptol )
434 ztz = ztz + z( i )*z( i )
440 IF( .NOT.sawnan1 .AND. .NOT.sawnan2 )
THEN
442 z( i+1 ) = -( work( indumn+i )*z( i ) )
443 IF( (abs(z(i))+abs(z(i+1)))* abs(ld(i)).LT.gaptol )
449 ztz = ztz + z( i+1 )*z( i+1 )
455 IF( z( i ).EQ.zero )
THEN
456 z( i+1 ) = -( ld( i-1 ) / ld( i ) )*z( i-1 )
458 z( i+1 ) = -( work( indumn+i )*z( i ) )
460 IF( (abs(z(i))+abs(z(i+1)))* abs(ld(i)).LT.gaptol )
466 ztz = ztz + z( i+1 )*z( i+1 )
475 resid = abs( mingma )*nrminv
subroutine dlar1v(n, b1, bn, lambda, d, l, ld, lld, pivmin, gaptol, z, wantnc, negcnt, ztz, mingma, r, isuppz, nrminv, resid, rqcorr, work)
DLAR1V computes the (scaled) r-th column of the inverse of the submatrix in rows b1 through bn of the...