LAPACK  3.4.2
LAPACK: Linear Algebra PACKage
 All Files Functions Groups
spotri.f
Go to the documentation of this file.
1 *> \brief \b SPOTRI
2 *
3 * =========== DOCUMENTATION ===========
4 *
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
7 *
8 *> \htmlonly
9 *> Download SPOTRI + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/spotri.f">
11 *> [TGZ]</a>
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/spotri.f">
13 *> [ZIP]</a>
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spotri.f">
15 *> [TXT]</a>
16 *> \endhtmlonly
17 *
18 * Definition:
19 * ===========
20 *
21 * SUBROUTINE SPOTRI( UPLO, N, A, LDA, INFO )
22 *
23 * .. Scalar Arguments ..
24 * CHARACTER UPLO
25 * INTEGER INFO, LDA, N
26 * ..
27 * .. Array Arguments ..
28 * REAL A( LDA, * )
29 * ..
30 *
31 *
32 *> \par Purpose:
33 * =============
34 *>
35 *> \verbatim
36 *>
37 *> SPOTRI 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 SPOTRF.
40 *> \endverbatim
41 *
42 * Arguments:
43 * ==========
44 *
45 *> \param[in] UPLO
46 *> \verbatim
47 *> UPLO is CHARACTER*1
48 *> = 'U': Upper triangle of A is stored;
49 *> = 'L': Lower triangle of A is stored.
50 *> \endverbatim
51 *>
52 *> \param[in] N
53 *> \verbatim
54 *> N is INTEGER
55 *> The order of the matrix A. N >= 0.
56 *> \endverbatim
57 *>
58 *> \param[in,out] A
59 *> \verbatim
60 *> A is REAL array, dimension (LDA,N)
61 *> On entry, the triangular factor U or L from the Cholesky
62 *> factorization A = U**T*U or A = L*L**T, as computed by
63 *> SPOTRF.
64 *> On exit, the upper or lower triangle of the (symmetric)
65 *> inverse of A, overwriting the input factor U or L.
66 *> \endverbatim
67 *>
68 *> \param[in] LDA
69 *> \verbatim
70 *> LDA is INTEGER
71 *> The leading dimension of the array A. LDA >= max(1,N).
72 *> \endverbatim
73 *>
74 *> \param[out] INFO
75 *> \verbatim
76 *> INFO is INTEGER
77 *> = 0: successful exit
78 *> < 0: if INFO = -i, the i-th argument had an illegal value
79 *> > 0: if INFO = i, the (i,i) element of the factor U or L is
80 *> zero, and the inverse could not be computed.
81 *> \endverbatim
82 *
83 * Authors:
84 * ========
85 *
86 *> \author Univ. of Tennessee
87 *> \author Univ. of California Berkeley
88 *> \author Univ. of Colorado Denver
89 *> \author NAG Ltd.
90 *
91 *> \date November 2011
92 *
93 *> \ingroup realPOcomputational
94 *
95 * =====================================================================
96  SUBROUTINE spotri( UPLO, N, A, LDA, INFO )
97 *
98 * -- LAPACK computational routine (version 3.4.0) --
99 * -- LAPACK is a software package provided by Univ. of Tennessee, --
100 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
101 * November 2011
102 *
103 * .. Scalar Arguments ..
104  CHARACTER uplo
105  INTEGER info, lda, n
106 * ..
107 * .. Array Arguments ..
108  REAL a( lda, * )
109 * ..
110 *
111 * =====================================================================
112 *
113 * .. External Functions ..
114  LOGICAL lsame
115  EXTERNAL lsame
116 * ..
117 * .. External Subroutines ..
118  EXTERNAL slauum, strtri, xerbla
119 * ..
120 * .. Intrinsic Functions ..
121  INTRINSIC max
122 * ..
123 * .. Executable Statements ..
124 *
125 * Test the input parameters.
126 *
127  info = 0
128  IF( .NOT.lsame( uplo, 'U' ) .AND. .NOT.lsame( uplo, 'L' ) ) THEN
129  info = -1
130  ELSE IF( n.LT.0 ) THEN
131  info = -2
132  ELSE IF( lda.LT.max( 1, n ) ) THEN
133  info = -4
134  END IF
135  IF( info.NE.0 ) THEN
136  CALL xerbla( 'SPOTRI', -info )
137  return
138  END IF
139 *
140 * Quick return if possible
141 *
142  IF( n.EQ.0 )
143  $ return
144 *
145 * Invert the triangular Cholesky factor U or L.
146 *
147  CALL strtri( uplo, 'Non-unit', n, a, lda, info )
148  IF( info.GT.0 )
149  $ return
150 *
151 * Form inv(U) * inv(U)**T or inv(L)**T * inv(L).
152 *
153  CALL slauum( uplo, n, a, lda, info )
154 *
155  return
156 *
157 * End of SPOTRI
158 *
159  END