3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DPOCON + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dpocon.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dpocon.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpocon.f">
21 * SUBROUTINE DPOCON( UPLO, N, A, LDA, ANORM, RCOND, WORK, IWORK,
24 * .. Scalar Arguments ..
26 * INTEGER INFO, LDA, N
27 * DOUBLE PRECISION ANORM, RCOND
29 * .. Array Arguments ..
31 * DOUBLE PRECISION A( LDA, * ), WORK( * )
40 *> DPOCON estimates the reciprocal of the condition number (in the
41 *> 1-norm) of a real symmetric positive definite matrix using the
42 *> Cholesky factorization A = U**T*U or A = L*L**T computed by DPOTRF.
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 DOUBLE PRECISION array, dimension (LDA,N)
67 *> The triangular factor U or L from the Cholesky factorization
68 *> A = U**T*U or A = L*L**T, as computed by DPOTRF.
74 *> The leading dimension of the array A. LDA >= max(1,N).
79 *> ANORM is DOUBLE PRECISION
80 *> The 1-norm (or infinity-norm) of the symmetric matrix A.
85 *> RCOND is DOUBLE PRECISION
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 DOUBLE PRECISION array, dimension (3*N)
98 *> IWORK is INTEGER 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 doublePOcomputational
120 * =====================================================================
121 SUBROUTINE DPOCON( UPLO, N, A, LDA, ANORM, RCOND, WORK, IWORK,
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 ..
132 DOUBLE PRECISION ANORM, RCOND
134 * .. Array Arguments ..
136 DOUBLE PRECISION A( LDA, * ), WORK( * )
139 * =====================================================================
142 DOUBLE PRECISION ONE, ZERO
143 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
145 * .. Local Scalars ..
149 DOUBLE PRECISION AINVNM, SCALE, SCALEL, SCALEU, SMLNUM
154 * .. External Functions ..
157 DOUBLE PRECISION DLAMCH
158 EXTERNAL LSAME, IDAMAX, DLAMCH
160 * .. External Subroutines ..
161 EXTERNAL DLACN2, DLATRS, DRSCL, XERBLA
163 * .. Intrinsic Functions ..
166 * .. Executable Statements ..
168 * Test the input parameters.
171 UPPER = LSAME( UPLO, 'U' )
172 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
174 ELSE IF( N.LT.0 ) THEN
176 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
178 ELSE IF( ANORM.LT.ZERO ) THEN
182 CALL XERBLA( 'DPOCON', -INFO )
186 * Quick return if possible
192 ELSE IF( ANORM.EQ.ZERO ) THEN
196 SMLNUM = DLAMCH( 'Safe minimum' )
198 * Estimate the 1-norm of inv(A).
203 CALL DLACN2( N, WORK( N+1 ), WORK, IWORK, AINVNM, KASE, ISAVE )
207 * Multiply by inv(U**T).
209 CALL DLATRS( 'Upper', 'Transpose', 'Non-unit', NORMIN, N, A,
210 $ LDA, WORK, SCALEL, WORK( 2*N+1 ), INFO )
213 * Multiply by inv(U).
215 CALL DLATRS( 'Upper', 'No transpose', 'Non-unit', NORMIN, N,
216 $ A, LDA, WORK, SCALEU, WORK( 2*N+1 ), INFO )
219 * Multiply by inv(L).
221 CALL DLATRS( 'Lower', 'No transpose', 'Non-unit', NORMIN, N,
222 $ A, LDA, WORK, SCALEL, WORK( 2*N+1 ), INFO )
225 * Multiply by inv(L**T).
227 CALL DLATRS( 'Lower', 'Transpose', 'Non-unit', NORMIN, N, A,
228 $ LDA, WORK, SCALEU, WORK( 2*N+1 ), INFO )
231 * Multiply by 1/SCALE if doing so will not cause overflow.
233 SCALE = SCALEL*SCALEU
234 IF( SCALE.NE.ONE ) THEN
235 IX = IDAMAX( N, WORK, 1 )
236 IF( SCALE.LT.ABS( WORK( IX ) )*SMLNUM .OR. SCALE.EQ.ZERO )
238 CALL DRSCL( N, SCALE, WORK, 1 )
243 * Compute the estimate of the reciprocal condition number.
246 $ RCOND = ( ONE / AINVNM ) / ANORM