LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ chpcon()

subroutine chpcon ( character  UPLO,
integer  N,
complex, dimension( * )  AP,
integer, dimension( * )  IPIV,
real  ANORM,
real  RCOND,
complex, dimension( * )  WORK,
integer  INFO 
)

CHPCON

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

Purpose:
 CHPCON 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 CHPTRF.

 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 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 CHPTRF, 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 CHPTRF.
[in]ANORM
          ANORM is REAL
          The 1-norm of the original matrix A.
[out]RCOND
          RCOND is REAL
          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 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.
Date
December 2016

Definition at line 120 of file chpcon.f.

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