LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine cppcon ( character  UPLO,
integer  N,
complex, dimension( * )  AP,
real  ANORM,
real  RCOND,
complex, dimension( * )  WORK,
real, dimension( * )  RWORK,
integer  INFO 
)

CPPCON

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

Purpose:
 CPPCON estimates the reciprocal of the condition number (in the 
 1-norm) of a complex Hermitian positive definite packed matrix using
 the Cholesky factorization A = U**H*U or A = L*L**H computed by
 CPPTRF.

 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
          = 'U':  Upper triangle of A is stored;
          = 'L':  Lower triangle of A is stored.
[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 triangular factor U or L from the Cholesky factorization
          A = U**H*U or A = L*L**H, packed columnwise in 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.
[in]ANORM
          ANORM is REAL
          The 1-norm (or infinity-norm) of the Hermitian 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]RWORK
          RWORK is REAL array, dimension (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
November 2011

Definition at line 120 of file cppcon.f.

120 *
121 * -- LAPACK computational routine (version 3.4.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 * November 2011
125 *
126 * .. Scalar Arguments ..
127  CHARACTER uplo
128  INTEGER info, n
129  REAL anorm, rcond
130 * ..
131 * .. Array Arguments ..
132  REAL rwork( * )
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  CHARACTER normin
145  INTEGER ix, kase
146  REAL ainvnm, scale, scalel, scaleu, smlnum
147  COMPLEX zdum
148 * ..
149 * .. Local Arrays ..
150  INTEGER isave( 3 )
151 * ..
152 * .. External Functions ..
153  LOGICAL lsame
154  INTEGER icamax
155  REAL slamch
156  EXTERNAL lsame, icamax, slamch
157 * ..
158 * .. External Subroutines ..
159  EXTERNAL clacn2, clatps, csrscl, xerbla
160 * ..
161 * .. Intrinsic Functions ..
162  INTRINSIC abs, aimag, real
163 * ..
164 * .. Statement Functions ..
165  REAL cabs1
166 * ..
167 * .. Statement Function definitions ..
168  cabs1( zdum ) = abs( REAL( ZDUM ) ) + abs( aimag( zdum ) )
169 * ..
170 * .. Executable Statements ..
171 *
172 * Test the input parameters.
173 *
174  info = 0
175  upper = lsame( uplo, 'U' )
176  IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
177  info = -1
178  ELSE IF( n.LT.0 ) THEN
179  info = -2
180  ELSE IF( anorm.LT.zero ) THEN
181  info = -4
182  END IF
183  IF( info.NE.0 ) THEN
184  CALL xerbla( 'CPPCON', -info )
185  RETURN
186  END IF
187 *
188 * Quick return if possible
189 *
190  rcond = zero
191  IF( n.EQ.0 ) THEN
192  rcond = one
193  RETURN
194  ELSE IF( anorm.EQ.zero ) THEN
195  RETURN
196  END IF
197 *
198  smlnum = slamch( 'Safe minimum' )
199 *
200 * Estimate the 1-norm of the inverse.
201 *
202  kase = 0
203  normin = 'N'
204  10 CONTINUE
205  CALL clacn2( n, work( n+1 ), work, ainvnm, kase, isave )
206  IF( kase.NE.0 ) THEN
207  IF( upper ) THEN
208 *
209 * Multiply by inv(U**H).
210 *
211  CALL clatps( 'Upper', 'Conjugate transpose', 'Non-unit',
212  $ normin, n, ap, work, scalel, rwork, info )
213  normin = 'Y'
214 *
215 * Multiply by inv(U).
216 *
217  CALL clatps( 'Upper', 'No transpose', 'Non-unit', normin, n,
218  $ ap, work, scaleu, rwork, info )
219  ELSE
220 *
221 * Multiply by inv(L).
222 *
223  CALL clatps( 'Lower', 'No transpose', 'Non-unit', normin, n,
224  $ ap, work, scalel, rwork, info )
225  normin = 'Y'
226 *
227 * Multiply by inv(L**H).
228 *
229  CALL clatps( 'Lower', 'Conjugate transpose', 'Non-unit',
230  $ normin, n, ap, work, scaleu, rwork, info )
231  END IF
232 *
233 * Multiply by 1/SCALE if doing so will not cause overflow.
234 *
235  scale = scalel*scaleu
236  IF( scale.NE.one ) THEN
237  ix = icamax( n, work, 1 )
238  IF( scale.LT.cabs1( work( ix ) )*smlnum .OR. scale.EQ.zero )
239  $ GO TO 20
240  CALL csrscl( n, scale, work, 1 )
241  END IF
242  GO TO 10
243  END IF
244 *
245 * Compute the estimate of the reciprocal condition number.
246 *
247  IF( ainvnm.NE.zero )
248  $ rcond = ( one / ainvnm ) / anorm
249 *
250  20 CONTINUE
251  RETURN
252 *
253 * End of CPPCON
254 *
subroutine clatps(UPLO, TRANS, DIAG, NORMIN, N, AP, X, SCALE, CNORM, INFO)
CLATPS solves a triangular system of equations with the matrix held in packed storage.
Definition: clatps.f:233
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
integer function icamax(N, CX, INCX)
ICAMAX
Definition: icamax.f:53
subroutine csrscl(N, SA, SX, INCX)
CSRSCL multiplies a vector by the reciprocal of a real scalar.
Definition: csrscl.f:86
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
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

Here is the call graph for this function:

Here is the caller graph for this function: