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

◆ chetri2()

subroutine chetri2 ( character uplo,
integer n,
complex, dimension( lda, * ) a,
integer lda,
integer, dimension( * ) ipiv,
complex, dimension( * ) work,
integer lwork,
integer info )

CHETRI2

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

Purpose:
!>
!> CHETRI2 computes the inverse of a COMPLEX hermitian indefinite matrix
!> A using the factorization A = U*D*U**T or A = L*D*L**T computed by
!> CHETRF. CHETRI2 set the LEADING DIMENSION of the workspace
!> before calling CHETRI2X that actually computes the inverse.
!> 
Parameters
[in]UPLO
!>          UPLO is CHARACTER*1
!>          Specifies whether the details of the factorization are stored
!>          as an upper or lower triangular matrix.
!>          = 'U':  Upper triangular, form is A = U*D*U**T;
!>          = 'L':  Lower triangular, form is A = L*D*L**T.
!> 
[in]N
!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.
!> 
[in,out]A
!>          A is COMPLEX array, dimension (LDA,N)
!>          On entry, the block diagonal matrix D and the multipliers
!>          used to obtain the factor U or L as computed by CHETRF.
!>
!>          On exit, if INFO = 0, the (symmetric) inverse of the original
!>          matrix.  If UPLO = 'U', the upper triangular part of the
!>          inverse is formed and the part of A below the diagonal is not
!>          referenced; if UPLO = 'L' the lower triangular part of the
!>          inverse is formed and the part of A above the diagonal is
!>          not referenced.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,N).
!> 
[in]IPIV
!>          IPIV is INTEGER array, dimension (N)
!>          Details of the interchanges and the block structure of D
!>          as determined by CHETRF.
!> 
[out]WORK
!>          WORK is COMPLEX array, dimension (MAX(1,LWORK))
!> 
[in]LWORK
!>          LWORK is INTEGER
!>          The dimension of the array WORK.
!>          If N = 0, LWORK >= 1, else LWORK >= (N+NB+1)*(NB+3).
!>          If LWORK = -1, then a workspace query is assumed; the routine
!>          calculates:
!>              - the optimal size of the WORK array, returns
!>          this value as the first entry of the WORK array,
!>              - and no error message related to LWORK is issued by XERBLA.
!> 
[out]INFO
!>          INFO is INTEGER
!>          = 0: successful exit
!>          < 0: if INFO = -i, the i-th argument had an illegal value
!>          > 0: if INFO = i, D(i,i) = 0; the matrix is singular and its
!>               inverse could not be computed.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 124 of file chetri2.f.

125*
126* -- LAPACK computational routine --
127* -- LAPACK is a software package provided by Univ. of Tennessee, --
128* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
129*
130* .. Scalar Arguments ..
131 CHARACTER UPLO
132 INTEGER INFO, LDA, LWORK, N
133* ..
134* .. Array Arguments ..
135 INTEGER IPIV( * )
136 COMPLEX A( LDA, * ), WORK( * )
137* ..
138*
139* =====================================================================
140*
141* .. Local Scalars ..
142 LOGICAL UPPER, LQUERY
143 INTEGER MINSIZE, NBMAX
144* ..
145* .. External Functions ..
146 LOGICAL LSAME
147 INTEGER ILAENV
148 REAL SROUNDUP_LWORK
149 EXTERNAL lsame, ilaenv, sroundup_lwork
150* ..
151* .. External Subroutines ..
152 EXTERNAL chetri2x, chetri, xerbla
153* ..
154* .. Executable Statements ..
155*
156* Test the input parameters.
157*
158 info = 0
159 upper = lsame( uplo, 'U' )
160 lquery = ( lwork.EQ.-1 )
161*
162* Get blocksize
163*
164 nbmax = ilaenv( 1, 'CHETRF', uplo, n, -1, -1, -1 )
165 IF( n.EQ.0 ) THEN
166 minsize = 1
167 ELSE IF( nbmax.GE.n ) THEN
168 minsize = n
169 ELSE
170 minsize = (n+nbmax+1)*(nbmax+3)
171 END IF
172*
173 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
174 info = -1
175 ELSE IF( n.LT.0 ) THEN
176 info = -2
177 ELSE IF( lda.LT.max( 1, n ) ) THEN
178 info = -4
179 ELSE IF( lwork.LT.minsize .AND. .NOT.lquery ) THEN
180 info = -7
181 END IF
182*
183 IF( info.NE.0 ) THEN
184 CALL xerbla( 'CHETRI2', -info )
185 RETURN
186 ELSE IF( lquery ) THEN
187 work( 1 ) = sroundup_lwork( minsize )
188 RETURN
189 END IF
190*
191* Quick return if possible
192*
193 IF( n.EQ.0 )
194 $ RETURN
195
196 IF( nbmax.GE.n ) THEN
197 CALL chetri( uplo, n, a, lda, ipiv, work, info )
198 ELSE
199 CALL chetri2x( uplo, n, a, lda, ipiv, work, nbmax, info )
200 END IF
201*
202 RETURN
203*
204* End of CHETRI2
205*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine chetri2x(uplo, n, a, lda, ipiv, work, nb, info)
CHETRI2X
Definition chetri2x.f:118
subroutine chetri(uplo, n, a, lda, ipiv, work, info)
CHETRI
Definition chetri.f:112
integer function ilaenv(ispec, name, opts, n1, n2, n3, n4)
ILAENV
Definition ilaenv.f:160
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
real function sroundup_lwork(lwork)
SROUNDUP_LWORK
Here is the call graph for this function:
Here is the caller graph for this function: