1 SUBROUTINE DPPTRI( UPLO, N, AP, INFO )
3 * -- LAPACK routine (version 3.2) --
4 * -- LAPACK is a software package provided by Univ. of Tennessee, --
5 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
8 * .. Scalar Arguments ..
12 * .. Array Arguments ..
13 DOUBLE PRECISION AP( * )
19 * DPPTRI computes the inverse of a real symmetric positive definite
20 * matrix A using the Cholesky factorization A = U**T*U or A = L*L**T
26 * UPLO (input) CHARACTER*1
27 * = 'U': Upper triangular factor is stored in AP;
28 * = 'L': Lower triangular factor is stored in AP.
31 * The order of the matrix A. N >= 0.
33 * AP (input/output) DOUBLE PRECISION array, dimension (N*(N+1)/2)
34 * On entry, the triangular factor U or L from the Cholesky
35 * factorization A = U**T*U or A = L*L**T, packed columnwise as
36 * a linear array. The j-th column of U or L is stored in the
37 * array AP as follows:
38 * if UPLO = 'U', AP(i + (j-1)*j/2) = U(i,j) for 1<=i<=j;
39 * if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = L(i,j) for j<=i<=n.
41 * On exit, the upper or lower triangle of the (symmetric)
42 * inverse of A, overwriting the input factor U or L.
44 * INFO (output) INTEGER
45 * = 0: successful exit
46 * < 0: if INFO = -i, the i-th argument had an illegal value
47 * > 0: if INFO = i, the (i,i) element of the factor U or L is
48 * zero, and the inverse could not be computed.
50 * =====================================================================
54 PARAMETER ( ONE = 1.0D+0 )
58 INTEGER J, JC, JJ, JJN
61 * .. External Functions ..
66 * .. External Subroutines ..
67 EXTERNAL DSCAL, DSPR, DTPMV, DTPTRI, XERBLA
69 * .. Executable Statements ..
71 * Test the input parameters.
74 UPPER = LSAME( UPLO, 'U' )
75 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
77 ELSE IF( N.LT.0 ) THEN
81 CALL XERBLA( 'DPPTRI', -INFO )
85 * Quick return if possible
90 * Invert the triangular Cholesky factor U or L.
92 CALL DTPTRI( UPLO, 'Non-unit', N, AP, INFO )
98 * Compute the product inv(U) * inv(U)**T.
105 $ CALL DSPR( 'Upper', J-1, ONE, AP( JC ), 1, AP )
107 CALL DSCAL( J, AJJ, AP( JC ), 1 )
112 * Compute the product inv(L)**T * inv(L).
117 AP( JJ ) = DDOT( N-J+1, AP( JJ ), 1, AP( JJ ), 1 )
119 $ CALL DTPMV( 'Lower', 'Transpose', 'Non-unit', N-J,
120 $ AP( JJN ), AP( JJ+1 ), 1 )