3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download SPPTRI + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/spptri.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/spptri.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spptri.f">
21 * SUBROUTINE SPPTRI( UPLO, N, AP, INFO )
23 * .. Scalar Arguments ..
27 * .. Array Arguments ..
37 *> SPPTRI computes the inverse of a real symmetric positive definite
38 *> matrix A using the Cholesky factorization A = U**T*U or A = L*L**T
39 *> computed by SPPTRF.
47 *> UPLO is CHARACTER*1
48 *> = 'U': Upper triangular factor is stored in AP;
49 *> = 'L': Lower triangular factor is stored in AP.
55 *> The order of the matrix A. N >= 0.
60 *> AP is REAL array, dimension (N*(N+1)/2)
61 *> On entry, the triangular factor U or L from the Cholesky
62 *> factorization A = U**T*U or A = L*L**T, packed columnwise as
63 *> a linear array. The j-th column of U or L is stored in the
64 *> array AP as follows:
65 *> if UPLO = 'U', AP(i + (j-1)*j/2) = U(i,j) for 1<=i<=j;
66 *> if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = L(i,j) for j<=i<=n.
68 *> On exit, the upper or lower triangle of the (symmetric)
69 *> inverse of A, overwriting the input factor U or L.
75 *> = 0: successful exit
76 *> < 0: if INFO = -i, the i-th argument had an illegal value
77 *> > 0: if INFO = i, the (i,i) element of the factor U or L is
78 *> zero, and the inverse could not be computed.
84 *> \author Univ. of Tennessee
85 *> \author Univ. of California Berkeley
86 *> \author Univ. of Colorado Denver
89 *> \date November 2011
91 *> \ingroup realOTHERcomputational
93 * =====================================================================
94 SUBROUTINE SPPTRI( UPLO, N, AP, INFO )
96 * -- LAPACK computational routine (version 3.4.0) --
97 * -- LAPACK is a software package provided by Univ. of Tennessee, --
98 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
101 * .. Scalar Arguments ..
105 * .. Array Arguments ..
109 * =====================================================================
113 PARAMETER ( ONE = 1.0E+0 )
115 * .. Local Scalars ..
117 INTEGER J, JC, JJ, JJN
120 * .. External Functions ..
125 * .. External Subroutines ..
126 EXTERNAL SSCAL, SSPR, STPMV, STPTRI, XERBLA
128 * .. Executable Statements ..
130 * Test the input parameters.
133 UPPER = LSAME( UPLO, 'U' )
134 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
136 ELSE IF( N.LT.0 ) THEN
140 CALL XERBLA( 'SPPTRI', -INFO )
144 * Quick return if possible
149 * Invert the triangular Cholesky factor U or L.
151 CALL STPTRI( UPLO, 'Non-unit', N, AP, INFO )
157 * Compute the product inv(U) * inv(U)**T.
164 $ CALL SSPR( 'Upper', J-1, ONE, AP( JC ), 1, AP )
166 CALL SSCAL( J, AJJ, AP( JC ), 1 )
171 * Compute the product inv(L)**T * inv(L).
176 AP( JJ ) = SDOT( N-J+1, AP( JJ ), 1, AP( JJ ), 1 )
178 $ CALL STPMV( 'Lower', 'Transpose', 'Non-unit', N-J,
179 $ AP( JJN ), AP( JJ+1 ), 1 )