LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ dpptri()

subroutine dpptri ( character uplo,
integer n,
double precision, dimension( * ) ap,
integer info )

DPPTRI

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

Purpose:
!>
!> DPPTRI 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 DPPTRF.
!> 
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 DOUBLE PRECISION 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.

Definition at line 90 of file dpptri.f.

91*
92* -- LAPACK computational routine --
93* -- LAPACK is a software package provided by Univ. of Tennessee, --
94* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
95*
96* .. Scalar Arguments ..
97 CHARACTER UPLO
98 INTEGER INFO, N
99* ..
100* .. Array Arguments ..
101 DOUBLE PRECISION AP( * )
102* ..
103*
104* =====================================================================
105*
106* .. Parameters ..
107 DOUBLE PRECISION ONE
108 parameter( one = 1.0d+0 )
109* ..
110* .. Local Scalars ..
111 LOGICAL UPPER
112 INTEGER J, JC, JJ, JJN
113 DOUBLE PRECISION AJJ
114* ..
115* .. External Functions ..
116 LOGICAL LSAME
117 DOUBLE PRECISION DDOT
118 EXTERNAL lsame, ddot
119* ..
120* .. External Subroutines ..
121 EXTERNAL dscal, dspr, dtpmv, dtptri, xerbla
122* ..
123* .. Executable Statements ..
124*
125* Test the input parameters.
126*
127 info = 0
128 upper = lsame( uplo, 'U' )
129 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
130 info = -1
131 ELSE IF( n.LT.0 ) THEN
132 info = -2
133 END IF
134 IF( info.NE.0 ) THEN
135 CALL xerbla( 'DPPTRI', -info )
136 RETURN
137 END IF
138*
139* Quick return if possible
140*
141 IF( n.EQ.0 )
142 $ RETURN
143*
144* Invert the triangular Cholesky factor U or L.
145*
146 CALL dtptri( uplo, 'Non-unit', n, ap, info )
147 IF( info.GT.0 )
148 $ RETURN
149*
150 IF( upper ) THEN
151*
152* Compute the product inv(U) * inv(U)**T.
153*
154 jj = 0
155 DO 10 j = 1, n
156 jc = jj + 1
157 jj = jj + j
158 IF( j.GT.1 )
159 $ CALL dspr( 'Upper', j-1, one, ap( jc ), 1, ap )
160 ajj = ap( jj )
161 CALL dscal( j, ajj, ap( jc ), 1 )
162 10 CONTINUE
163*
164 ELSE
165*
166* Compute the product inv(L)**T * inv(L).
167*
168 jj = 1
169 DO 20 j = 1, n
170 jjn = jj + n - j + 1
171 ap( jj ) = ddot( n-j+1, ap( jj ), 1, ap( jj ), 1 )
172 IF( j.LT.n )
173 $ CALL dtpmv( 'Lower', 'Transpose', 'Non-unit', n-j,
174 $ ap( jjn ), ap( jj+1 ), 1 )
175 jj = jjn
176 20 CONTINUE
177 END IF
178*
179 RETURN
180*
181* End of DPPTRI
182*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
double precision function ddot(n, dx, incx, dy, incy)
DDOT
Definition ddot.f:82
subroutine dspr(uplo, n, alpha, x, incx, ap)
DSPR
Definition dspr.f:127
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine dscal(n, da, dx, incx)
DSCAL
Definition dscal.f:79
subroutine dtpmv(uplo, trans, diag, n, ap, x, incx)
DTPMV
Definition dtpmv.f:142
subroutine dtptri(uplo, diag, n, ap, info)
DTPTRI
Definition dtptri.f:115
Here is the call graph for this function:
Here is the caller graph for this function: