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

◆ cpptri()

subroutine cpptri ( character uplo,
integer n,
complex, dimension( * ) ap,
integer info )

CPPTRI

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

Purpose:
!>
!> CPPTRI computes the inverse of a complex Hermitian positive definite
!> matrix A using the Cholesky factorization A = U**H*U or A = L*L**H
!> computed by CPPTRF.
!> 
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 COMPLEX array, dimension (N*(N+1)/2)
!>          On entry, the triangular factor U or L from the Cholesky
!>          factorization A = U**H*U or A = L*L**H, 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 (Hermitian)
!>          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 cpptri.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 COMPLEX AP( * )
102* ..
103*
104* =====================================================================
105*
106* .. Parameters ..
107 REAL ONE
108 parameter( one = 1.0e+0 )
109* ..
110* .. Local Scalars ..
111 LOGICAL UPPER
112 INTEGER J, JC, JJ, JJN
113 REAL AJJ
114* ..
115* .. External Functions ..
116 LOGICAL LSAME
117 COMPLEX CDOTC
118 EXTERNAL lsame, cdotc
119* ..
120* .. External Subroutines ..
121 EXTERNAL chpr, csscal, ctpmv, ctptri, xerbla
122* ..
123* .. Intrinsic Functions ..
124 INTRINSIC real
125* ..
126* .. Executable Statements ..
127*
128* Test the input parameters.
129*
130 info = 0
131 upper = lsame( uplo, 'U' )
132 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
133 info = -1
134 ELSE IF( n.LT.0 ) THEN
135 info = -2
136 END IF
137 IF( info.NE.0 ) THEN
138 CALL xerbla( 'CPPTRI', -info )
139 RETURN
140 END IF
141*
142* Quick return if possible
143*
144 IF( n.EQ.0 )
145 $ RETURN
146*
147* Invert the triangular Cholesky factor U or L.
148*
149 CALL ctptri( uplo, 'Non-unit', n, ap, info )
150 IF( info.GT.0 )
151 $ RETURN
152 IF( upper ) THEN
153*
154* Compute the product inv(U) * inv(U)**H.
155*
156 jj = 0
157 DO 10 j = 1, n
158 jc = jj + 1
159 jj = jj + j
160 IF( j.GT.1 )
161 $ CALL chpr( 'Upper', j-1, one, ap( jc ), 1, ap )
162 ajj = real( ap( jj ) )
163 CALL csscal( j, ajj, ap( jc ), 1 )
164 10 CONTINUE
165*
166 ELSE
167*
168* Compute the product inv(L)**H * inv(L).
169*
170 jj = 1
171 DO 20 j = 1, n
172 jjn = jj + n - j + 1
173 ap( jj ) = real( cdotc( n-j+1, ap( jj ), 1, ap( jj ),
174 $ 1 ) )
175 IF( j.LT.n )
176 $ CALL ctpmv( 'Lower', 'Conjugate transpose',
177 $ 'Non-unit',
178 $ n-j, ap( jjn ), ap( jj+1 ), 1 )
179 jj = jjn
180 20 CONTINUE
181 END IF
182*
183 RETURN
184*
185* End of CPPTRI
186*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
complex function cdotc(n, cx, incx, cy, incy)
CDOTC
Definition cdotc.f:83
subroutine chpr(uplo, n, alpha, x, incx, ap)
CHPR
Definition chpr.f:130
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine csscal(n, sa, cx, incx)
CSSCAL
Definition csscal.f:78
subroutine ctpmv(uplo, trans, diag, n, ap, x, incx)
CTPMV
Definition ctpmv.f:142
subroutine ctptri(uplo, diag, n, ap, info)
CTPTRI
Definition ctptri.f:115
Here is the call graph for this function:
Here is the caller graph for this function: