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

◆ zhpcon()

subroutine zhpcon ( character  uplo,
integer  n,
complex*16, dimension( * )  ap,
integer, dimension( * )  ipiv,
double precision  anorm,
double precision  rcond,
complex*16, dimension( * )  work,
integer  info 
)

ZHPCON

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

Purpose:
 ZHPCON estimates the reciprocal of the condition number of a complex
 Hermitian packed matrix A using the factorization A = U*D*U**H or
 A = L*D*L**H computed by ZHPTRF.

 An estimate is obtained for norm(inv(A)), and the reciprocal of the
 condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
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**H;
          = 'L':  Lower triangular, form is A = L*D*L**H.
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in]AP
          AP is COMPLEX*16 array, dimension (N*(N+1)/2)
          The block diagonal matrix D and the multipliers used to
          obtain the factor U or L as computed by ZHPTRF, stored as a
          packed triangular matrix.
[in]IPIV
          IPIV is INTEGER array, dimension (N)
          Details of the interchanges and the block structure of D
          as determined by ZHPTRF.
[in]ANORM
          ANORM is DOUBLE PRECISION
          The 1-norm of the original matrix A.
[out]RCOND
          RCOND is DOUBLE PRECISION
          The reciprocal of the condition number of the matrix A,
          computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
          estimate of the 1-norm of inv(A) computed in this routine.
[out]WORK
          WORK is COMPLEX*16 array, dimension (2*N)
[out]INFO
          INFO is INTEGER
          = 0:  successful exit
          < 0:  if INFO = -i, the i-th argument had an illegal value
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 117 of file zhpcon.f.

118*
119* -- LAPACK computational routine --
120* -- LAPACK is a software package provided by Univ. of Tennessee, --
121* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
122*
123* .. Scalar Arguments ..
124 CHARACTER UPLO
125 INTEGER INFO, N
126 DOUBLE PRECISION ANORM, RCOND
127* ..
128* .. Array Arguments ..
129 INTEGER IPIV( * )
130 COMPLEX*16 AP( * ), WORK( * )
131* ..
132*
133* =====================================================================
134*
135* .. Parameters ..
136 DOUBLE PRECISION ONE, ZERO
137 parameter( one = 1.0d+0, zero = 0.0d+0 )
138* ..
139* .. Local Scalars ..
140 LOGICAL UPPER
141 INTEGER I, IP, KASE
142 DOUBLE PRECISION AINVNM
143* ..
144* .. Local Arrays ..
145 INTEGER ISAVE( 3 )
146* ..
147* .. External Functions ..
148 LOGICAL LSAME
149 EXTERNAL lsame
150* ..
151* .. External Subroutines ..
152 EXTERNAL xerbla, zhptrs, zlacn2
153* ..
154* .. Executable Statements ..
155*
156* Test the input parameters.
157*
158 info = 0
159 upper = lsame( uplo, 'U' )
160 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
161 info = -1
162 ELSE IF( n.LT.0 ) THEN
163 info = -2
164 ELSE IF( anorm.LT.zero ) THEN
165 info = -5
166 END IF
167 IF( info.NE.0 ) THEN
168 CALL xerbla( 'ZHPCON', -info )
169 RETURN
170 END IF
171*
172* Quick return if possible
173*
174 rcond = zero
175 IF( n.EQ.0 ) THEN
176 rcond = one
177 RETURN
178 ELSE IF( anorm.LE.zero ) THEN
179 RETURN
180 END IF
181*
182* Check that the diagonal matrix D is nonsingular.
183*
184 IF( upper ) THEN
185*
186* Upper triangular storage: examine D from bottom to top
187*
188 ip = n*( n+1 ) / 2
189 DO 10 i = n, 1, -1
190 IF( ipiv( i ).GT.0 .AND. ap( ip ).EQ.zero )
191 $ RETURN
192 ip = ip - i
193 10 CONTINUE
194 ELSE
195*
196* Lower triangular storage: examine D from top to bottom.
197*
198 ip = 1
199 DO 20 i = 1, n
200 IF( ipiv( i ).GT.0 .AND. ap( ip ).EQ.zero )
201 $ RETURN
202 ip = ip + n - i + 1
203 20 CONTINUE
204 END IF
205*
206* Estimate the 1-norm of the inverse.
207*
208 kase = 0
209 30 CONTINUE
210 CALL zlacn2( n, work( n+1 ), work, ainvnm, kase, isave )
211 IF( kase.NE.0 ) THEN
212*
213* Multiply by inv(L*D*L**H) or inv(U*D*U**H).
214*
215 CALL zhptrs( uplo, n, 1, ap, ipiv, work, n, info )
216 GO TO 30
217 END IF
218*
219* Compute the estimate of the reciprocal condition number.
220*
221 IF( ainvnm.NE.zero )
222 $ rcond = ( one / ainvnm ) / anorm
223*
224 RETURN
225*
226* End of ZHPCON
227*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine zhptrs(uplo, n, nrhs, ap, ipiv, b, ldb, info)
ZHPTRS
Definition zhptrs.f:115
subroutine zlacn2(n, v, x, est, kase, isave)
ZLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition zlacn2.f:133
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
Here is the call graph for this function:
Here is the caller graph for this function: