3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download CPOCON + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cpocon.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cpocon.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpocon.f">
21 * SUBROUTINE CPOCON( UPLO, N, A, LDA, ANORM, RCOND, WORK, RWORK,
24 * .. Scalar Arguments ..
26 * INTEGER INFO, LDA, N
29 * .. Array Arguments ..
31 * COMPLEX A( LDA, * ), WORK( * )
40 *> CPOCON estimates the reciprocal of the condition number (in the
41 *> 1-norm) of a complex Hermitian positive definite matrix using the
42 *> Cholesky factorization A = U**H*U or A = L*L**H computed by CPOTRF.
44 *> An estimate is obtained for norm(inv(A)), and the reciprocal of the
45 *> condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
53 *> UPLO is CHARACTER*1
54 *> = 'U': Upper triangle of A is stored;
55 *> = 'L': Lower triangle of A is stored.
61 *> The order of the matrix A. N >= 0.
66 *> A is COMPLEX array, dimension (LDA,N)
67 *> The triangular factor U or L from the Cholesky factorization
68 *> A = U**H*U or A = L*L**H, as computed by CPOTRF.
74 *> The leading dimension of the array A. LDA >= max(1,N).
80 *> The 1-norm (or infinity-norm) of the Hermitian matrix A.
86 *> The reciprocal of the condition number of the matrix A,
87 *> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
88 *> estimate of the 1-norm of inv(A) computed in this routine.
93 *> WORK is COMPLEX array, dimension (2*N)
98 *> RWORK is REAL array, dimension (N)
104 *> = 0: successful exit
105 *> < 0: if INFO = -i, the i-th argument had an illegal value
111 *> \author Univ. of Tennessee
112 *> \author Univ. of California Berkeley
113 *> \author Univ. of Colorado Denver
116 *> \date November 2011
118 *> \ingroup complexPOcomputational
120 * =====================================================================
121 SUBROUTINE CPOCON( UPLO, N, A, LDA, ANORM, RCOND, WORK, RWORK,
124 * -- LAPACK computational routine (version 3.4.0) --
125 * -- LAPACK is a software package provided by Univ. of Tennessee, --
126 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
129 * .. Scalar Arguments ..
134 * .. Array Arguments ..
136 COMPLEX A( LDA, * ), WORK( * )
139 * =====================================================================
143 PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
145 * .. Local Scalars ..
149 REAL AINVNM, SCALE, SCALEL, SCALEU, SMLNUM
155 * .. External Functions ..
159 EXTERNAL LSAME, ICAMAX, SLAMCH
161 * .. External Subroutines ..
162 EXTERNAL CLACN2, CLATRS, CSRSCL, XERBLA
164 * .. Intrinsic Functions ..
165 INTRINSIC ABS, AIMAG, MAX, REAL
167 * .. Statement Functions ..
170 * .. Statement Function definitions ..
171 CABS1( ZDUM ) = ABS( REAL( ZDUM ) ) + ABS( AIMAG( ZDUM ) )
173 * .. Executable Statements ..
175 * Test the input parameters.
178 UPPER = LSAME( UPLO, 'U' )
179 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
181 ELSE IF( N.LT.0 ) THEN
183 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
185 ELSE IF( ANORM.LT.ZERO ) THEN
189 CALL XERBLA( 'CPOCON', -INFO )
193 * Quick return if possible
199 ELSE IF( ANORM.EQ.ZERO ) THEN
203 SMLNUM = SLAMCH( 'Safe minimum' )
205 * Estimate the 1-norm of inv(A).
210 CALL CLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
214 * Multiply by inv(U**H).
216 CALL CLATRS( 'Upper', 'Conjugate transpose', 'Non-unit',
217 $ NORMIN, N, A, LDA, WORK, SCALEL, RWORK, INFO )
220 * Multiply by inv(U).
222 CALL CLATRS( 'Upper', 'No transpose', 'Non-unit', NORMIN, N,
223 $ A, LDA, WORK, SCALEU, RWORK, INFO )
226 * Multiply by inv(L).
228 CALL CLATRS( 'Lower', 'No transpose', 'Non-unit', NORMIN, N,
229 $ A, LDA, WORK, SCALEL, RWORK, INFO )
232 * Multiply by inv(L**H).
234 CALL CLATRS( 'Lower', 'Conjugate transpose', 'Non-unit',
235 $ NORMIN, N, A, LDA, WORK, SCALEU, RWORK, INFO )
238 * Multiply by 1/SCALE if doing so will not cause overflow.
240 SCALE = SCALEL*SCALEU
241 IF( SCALE.NE.ONE ) THEN
242 IX = ICAMAX( N, WORK, 1 )
243 IF( SCALE.LT.CABS1( WORK( IX ) )*SMLNUM .OR. SCALE.EQ.ZERO )
245 CALL CSRSCL( N, SCALE, WORK, 1 )
250 * Compute the estimate of the reciprocal condition number.
253 $ RCOND = ( ONE / AINVNM ) / ANORM