227 SUBROUTINE clar1v( 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 REAL GAPTOL, LAMBDA, MINGMA, NRMINV, PIVMIN, RESID,
243 REAL D( * ), L( * ), LD( * ), LLD( * ),
252 PARAMETER ( ZERO = 0.0e0, one = 1.0e0 )
254 parameter( cone = ( 1.0e0, 0.0e0 ) )
258 LOGICAL SAWNAN1, SAWNAN2
259 INTEGER I, INDLPL, INDP, INDS, INDUMN, NEG1, NEG2, R1,
261 REAL DMINUS, DPLUS, EPS, S, TMP
266 EXTERNAL sisnan, slamch
273 eps = slamch(
'Precision' )
294 work( inds+b1-1 ) = lld( b1-1 )
303 s = work( inds+b1-1 ) - lambda
306 work( indlpl+i ) = ld( i ) / dplus
307 IF(dplus.LT.zero) neg1 = neg1 + 1
308 work( inds+i ) = s*work( indlpl+i )*l( i )
309 s = work( inds+i ) - lambda
311 sawnan1 = sisnan( s )
312 IF( sawnan1 )
GOTO 60
315 work( indlpl+i ) = ld( i ) / dplus
316 work( inds+i ) = s*work( indlpl+i )*l( i )
317 s = work( inds+i ) - lambda
319 sawnan1 = sisnan( s )
325 s = work( inds+b1-1 ) - lambda
328 IF(abs(dplus).LT.pivmin) dplus = -pivmin
329 work( indlpl+i ) = ld( i ) / dplus
330 IF(dplus.LT.zero) neg1 = neg1 + 1
331 work( inds+i ) = s*work( indlpl+i )*l( i )
332 IF( work( indlpl+i ).EQ.zero )
333 $ work( inds+i ) = lld( i )
334 s = work( inds+i ) - lambda
338 IF(abs(dplus).LT.pivmin) dplus = -pivmin
339 work( indlpl+i ) = ld( i ) / dplus
340 work( inds+i ) = s*work( indlpl+i )*l( i )
341 IF( work( indlpl+i ).EQ.zero )
342 $ work( inds+i ) = lld( i )
343 s = work( inds+i ) - lambda
352 work( indp+bn-1 ) = d( bn ) - lambda
353 DO 80 i = bn - 1, r1, -1
354 dminus = lld( i ) + work( indp+i )
355 tmp = d( i ) / dminus
356 IF(dminus.LT.zero) neg2 = neg2 + 1
357 work( indumn+i ) = l( i )*tmp
358 work( indp+i-1 ) = work( indp+i )*tmp - lambda
360 tmp = work( indp+r1-1 )
361 sawnan2 = sisnan( tmp )
366 DO 100 i = bn-1, r1, -1
367 dminus = lld( i ) + work( indp+i )
368 IF(abs(dminus).LT.pivmin) dminus = -pivmin
369 tmp = d( i ) / dminus
370 IF(dminus.LT.zero) neg2 = neg2 + 1
371 work( indumn+i ) = l( i )*tmp
372 work( indp+i-1 ) = work( indp+i )*tmp - lambda
374 $ work( indp+i-1 ) = d( i ) - lambda
381 mingma = work( inds+r1-1 ) + work( indp+r1-1 )
382 IF( mingma.LT.zero ) neg1 = neg1 + 1
388 IF( abs(mingma).EQ.zero )
389 $ mingma = eps*work( inds+r1-1 )
391 DO 110 i = r1, r2 - 1
392 tmp = work( inds+i ) + work( indp+i )
394 $ tmp = eps*work( inds+i )
395 IF( abs( tmp ).LE.abs( mingma ) )
THEN
410 IF( .NOT.sawnan1 .AND. .NOT.sawnan2 )
THEN
411 DO 210 i = r-1, b1, -1
412 z( i ) = -( work( indlpl+i )*z( i+1 ) )
413 IF( (abs(z(i))+abs(z(i+1)))* abs(ld(i)).LT.gaptol )
419 ztz = ztz + real( z( i )*z( i ) )
424 DO 230 i = r - 1, b1, -1
425 IF( z( i+1 ).EQ.zero )
THEN
426 z( i ) = -( ld( i+1 ) / ld( i ) )*z( i+2 )
428 z( i ) = -( work( indlpl+i )*z( i+1 ) )
430 IF( (abs(z(i))+abs(z(i+1)))* abs(ld(i)).LT.gaptol )
436 ztz = ztz + real( z( i )*z( i ) )
442 IF( .NOT.sawnan1 .AND. .NOT.sawnan2 )
THEN
444 z( i+1 ) = -( work( indumn+i )*z( i ) )
445 IF( (abs(z(i))+abs(z(i+1)))* abs(ld(i)).LT.gaptol )
451 ztz = ztz + real( z( i+1 )*z( i+1 ) )
457 IF( z( i ).EQ.zero )
THEN
458 z( i+1 ) = -( ld( i-1 ) / ld( i ) )*z( i-1 )
460 z( i+1 ) = -( work( indumn+i )*z( i ) )
462 IF( (abs(z(i))+abs(z(i+1)))* abs(ld(i)).LT.gaptol )
468 ztz = ztz + real( z( i+1 )*z( i+1 ) )
477 resid = abs( mingma )*nrminv
subroutine clar1v(n, b1, bn, lambda, d, l, ld, lld, pivmin, gaptol, z, wantnc, negcnt, ztz, mingma, r, isuppz, nrminv, resid, rqcorr, work)
CLAR1V computes the (scaled) r-th column of the inverse of the submatrix in rows b1 through bn of the...