LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ spptri()

subroutine spptri ( character  UPLO,
integer  N,
real, dimension( * )  AP,
integer  INFO 
)

SPPTRI

Download SPPTRI + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 SPPTRI computes the inverse of a real symmetric positive definite
 matrix A using the Cholesky factorization A = U**T*U or A = L*L**T
 computed by SPPTRF.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          = 'U':  Upper triangular factor is stored in AP;
          = 'L':  Lower triangular factor is stored in AP.
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in,out]AP
          AP is REAL array, dimension (N*(N+1)/2)
          On entry, the triangular factor U or L from the Cholesky
          factorization A = U**T*U or A = L*L**T, packed columnwise as
          a linear array.  The j-th column of U or L is stored in the
          array AP as follows:
          if UPLO = 'U', AP(i + (j-1)*j/2) = U(i,j) for 1<=i<=j;
          if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = L(i,j) for j<=i<=n.

          On exit, the upper or lower triangle of the (symmetric)
          inverse of A, overwriting the input factor U or L.
[out]INFO
          INFO is INTEGER
          = 0:  successful exit
          < 0:  if INFO = -i, the i-th argument had an illegal value
          > 0:  if INFO = i, the (i,i) element of the factor U or L is
                zero, and the inverse could not be computed.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 95 of file spptri.f.

95 *
96 * -- LAPACK computational routine (version 3.7.0) --
97 * -- LAPACK is a software package provided by Univ. of Tennessee, --
98 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
99 * December 2016
100 *
101 * .. Scalar Arguments ..
102  CHARACTER uplo
103  INTEGER info, n
104 * ..
105 * .. Array Arguments ..
106  REAL ap( * )
107 * ..
108 *
109 * =====================================================================
110 *
111 * .. Parameters ..
112  REAL one
113  parameter( one = 1.0e+0 )
114 * ..
115 * .. Local Scalars ..
116  LOGICAL upper
117  INTEGER j, jc, jj, jjn
118  REAL ajj
119 * ..
120 * .. External Functions ..
121  LOGICAL lsame
122  REAL sdot
123  EXTERNAL lsame, sdot
124 * ..
125 * .. External Subroutines ..
126  EXTERNAL sscal, sspr, stpmv, stptri, xerbla
127 * ..
128 * .. Executable Statements ..
129 *
130 * Test the input parameters.
131 *
132  info = 0
133  upper = lsame( uplo, 'U' )
134  IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
135  info = -1
136  ELSE IF( n.LT.0 ) THEN
137  info = -2
138  END IF
139  IF( info.NE.0 ) THEN
140  CALL xerbla( 'SPPTRI', -info )
141  RETURN
142  END IF
143 *
144 * Quick return if possible
145 *
146  IF( n.EQ.0 )
147  $ RETURN
148 *
149 * Invert the triangular Cholesky factor U or L.
150 *
151  CALL stptri( uplo, 'Non-unit', n, ap, info )
152  IF( info.GT.0 )
153  $ RETURN
154 *
155  IF( upper ) THEN
156 *
157 * Compute the product inv(U) * inv(U)**T.
158 *
159  jj = 0
160  DO 10 j = 1, n
161  jc = jj + 1
162  jj = jj + j
163  IF( j.GT.1 )
164  $ CALL sspr( 'Upper', j-1, one, ap( jc ), 1, ap )
165  ajj = ap( jj )
166  CALL sscal( j, ajj, ap( jc ), 1 )
167  10 CONTINUE
168 *
169  ELSE
170 *
171 * Compute the product inv(L)**T * inv(L).
172 *
173  jj = 1
174  DO 20 j = 1, n
175  jjn = jj + n - j + 1
176  ap( jj ) = sdot( n-j+1, ap( jj ), 1, ap( jj ), 1 )
177  IF( j.LT.n )
178  $ CALL stpmv( 'Lower', 'Transpose', 'Non-unit', n-j,
179  $ ap( jjn ), ap( jj+1 ), 1 )
180  jj = jjn
181  20 CONTINUE
182  END IF
183 *
184  RETURN
185 *
186 * End of SPPTRI
187 *
real function sdot(N, SX, INCX, SY, INCY)
SDOT
Definition: sdot.f:84
subroutine stpmv(UPLO, TRANS, DIAG, N, AP, X, INCX)
STPMV
Definition: stpmv.f:144
subroutine stptri(UPLO, DIAG, N, AP, INFO)
STPTRI
Definition: stptri.f:119
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine sscal(N, SA, SX, INCX)
SSCAL
Definition: sscal.f:81
subroutine sspr(UPLO, N, ALPHA, X, INCX, AP)
SSPR
Definition: sspr.f:129
Here is the call graph for this function:
Here is the caller graph for this function: