227 SUBROUTINE dlatps( UPLO, TRANS, DIAG, NORMIN, N, AP, X, SCALE,
235 CHARACTER DIAG, NORMIN, TRANS, UPLO
237 DOUBLE PRECISION SCALE
240 DOUBLE PRECISION AP( * ), CNORM( * ), X( * )
246 DOUBLE PRECISION ZERO, HALF, ONE
247 parameter( zero = 0.0d+0, half = 0.5d+0, one = 1.0d+0 )
250 LOGICAL NOTRAN, NOUNIT, UPPER
251 INTEGER I, IMAX, IP, J, JFIRST, JINC, JLAST, JLEN
252 DOUBLE PRECISION BIGNUM, GROW, REC, SMLNUM, SUMJ, TJJ, TJJS,
253 $ tmax, tscal, uscal, xbnd, xj, xmax
258 DOUBLE PRECISION DASUM, DDOT, DLAMCH
259 EXTERNAL lsame, idamax, dasum, ddot, dlamch
265 INTRINSIC abs, max, min
270 upper = lsame( uplo,
'U' )
271 notran = lsame( trans,
'N' )
272 nounit = lsame( diag,
'N' )
276 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
278 ELSE IF( .NOT.notran .AND. .NOT.lsame( trans,
'T' ) .AND. .NOT.
279 $ lsame( trans,
'C' ) )
THEN
281 ELSE IF( .NOT.nounit .AND. .NOT.lsame( diag,
'U' ) )
THEN
283 ELSE IF( .NOT.lsame( normin,
'Y' ) .AND. .NOT.
284 $ lsame( normin,
'N' ) )
THEN
286 ELSE IF( n.LT.0 )
THEN
290 CALL xerbla(
'DLATPS', -info )
301 smlnum = dlamch(
'Safe minimum' ) / dlamch(
'Precision' )
302 bignum = one / smlnum
305 IF( lsame( normin,
'N' ) )
THEN
315 cnorm( j ) = dasum( j-1, ap( ip ), 1 )
324 cnorm( j ) = dasum( n-j, ap( ip+1 ), 1 )
334 imax = idamax( n, cnorm, 1 )
336 IF( tmax.LE.bignum )
THEN
339 tscal = one / ( smlnum*tmax )
340 CALL dscal( n, tscal, cnorm, 1 )
346 j = idamax( n, x, 1 )
363 IF( tscal.NE.one )
THEN
375 grow = one / max( xbnd, smlnum )
377 ip = jfirst*( jfirst+1 ) / 2
379 DO 30 j = jfirst, jlast, jinc
388 tjj = abs( ap( ip ) )
389 xbnd = min( xbnd, min( one, tjj )*grow )
390 IF( tjj+cnorm( j ).GE.smlnum )
THEN
394 grow = grow*( tjj / ( tjj+cnorm( j ) ) )
411 grow = min( one, one / max( xbnd, smlnum ) )
412 DO 40 j = jfirst, jlast, jinc
421 grow = grow*( one / ( one+cnorm( j ) ) )
440 IF( tscal.NE.one )
THEN
452 grow = one / max( xbnd, smlnum )
454 ip = jfirst*( jfirst+1 ) / 2
456 DO 60 j = jfirst, jlast, jinc
465 xj = one + cnorm( j )
466 grow = min( grow, xbnd / xj )
470 tjj = abs( ap( ip ) )
472 $ xbnd = xbnd*( tjj / xj )
476 grow = min( grow, xbnd )
483 grow = min( one, one / max( xbnd, smlnum ) )
484 DO 70 j = jfirst, jlast, jinc
493 xj = one + cnorm( j )
500 IF( ( grow*tscal ).GT.smlnum )
THEN
505 CALL dtpsv( uplo, trans, diag, n, ap, x, 1 )
510 IF( xmax.GT.bignum )
THEN
515 scale = bignum / xmax
516 CALL dscal( n, scale, x, 1 )
524 ip = jfirst*( jfirst+1 ) / 2
525 DO 110 j = jfirst, jlast, jinc
531 tjjs = ap( ip )*tscal
538 IF( tjj.GT.smlnum )
THEN
542 IF( tjj.LT.one )
THEN
543 IF( xj.GT.tjj*bignum )
THEN
548 CALL dscal( n, rec, x, 1 )
553 x( j ) = x( j ) / tjjs
555 ELSE IF( tjj.GT.zero )
THEN
559 IF( xj.GT.tjj*bignum )
THEN
564 rec = ( tjj*bignum ) / xj
565 IF( cnorm( j ).GT.one )
THEN
570 rec = rec / cnorm( j )
572 CALL dscal( n, rec, x, 1 )
576 x( j ) = x( j ) / tjjs
598 IF( cnorm( j ).GT.( bignum-xmax )*rec )
THEN
603 CALL dscal( n, rec, x, 1 )
606 ELSE IF( xj*cnorm( j ).GT.( bignum-xmax ) )
THEN
610 CALL dscal( n, half, x, 1 )
620 CALL daxpy( j-1, -x( j )*tscal, ap( ip-j+1 ), 1, x,
622 i = idamax( j-1, x, 1 )
632 CALL daxpy( n-j, -x( j )*tscal, ap( ip+1 ), 1,
634 i = j + idamax( n-j, x( j+1 ), 1 )
645 ip = jfirst*( jfirst+1 ) / 2
647 DO 160 j = jfirst, jlast, jinc
654 rec = one / max( xmax, one )
655 IF( cnorm( j ).GT.( bignum-xj )*rec )
THEN
661 tjjs = ap( ip )*tscal
666 IF( tjj.GT.one )
THEN
670 rec = min( one, rec*tjj )
673 IF( rec.LT.one )
THEN
674 CALL dscal( n, rec, x, 1 )
681 IF( uscal.EQ.one )
THEN
687 sumj = ddot( j-1, ap( ip-j+1 ), 1, x, 1 )
688 ELSE IF( j.LT.n )
THEN
689 sumj = ddot( n-j, ap( ip+1 ), 1, x( j+1 ), 1 )
697 sumj = sumj + ( ap( ip-j+i )*uscal )*x( i )
699 ELSE IF( j.LT.n )
THEN
701 sumj = sumj + ( ap( ip+i )*uscal )*x( j+i )
706 IF( uscal.EQ.tscal )
THEN
711 x( j ) = x( j ) - sumj
717 tjjs = ap( ip )*tscal
724 IF( tjj.GT.smlnum )
THEN
728 IF( tjj.LT.one )
THEN
729 IF( xj.GT.tjj*bignum )
THEN
734 CALL dscal( n, rec, x, 1 )
739 x( j ) = x( j ) / tjjs
740 ELSE IF( tjj.GT.zero )
THEN
744 IF( xj.GT.tjj*bignum )
THEN
748 rec = ( tjj*bignum ) / xj
749 CALL dscal( n, rec, x, 1 )
753 x( j ) = x( j ) / tjjs
772 x( j ) = x( j ) / tjjs - sumj
774 xmax = max( xmax, abs( x( j ) ) )
779 scale = scale / tscal
784 IF( tscal.NE.one )
THEN
785 CALL dscal( n, one / tscal, cnorm, 1 )
subroutine xerbla(srname, info)
subroutine daxpy(n, da, dx, incx, dy, incy)
DAXPY
subroutine dlatps(uplo, trans, diag, normin, n, ap, x, scale, cnorm, info)
DLATPS solves a triangular system of equations with the matrix held in packed storage.
subroutine dscal(n, da, dx, incx)
DSCAL
subroutine dtpsv(uplo, trans, diag, n, ap, x, incx)
DTPSV