![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b DSYCON 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download DSYCON + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dsycon.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dsycon.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsycon.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE DSYCON( UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, 00022 * IWORK, INFO ) 00023 * 00024 * .. Scalar Arguments .. 00025 * CHARACTER UPLO 00026 * INTEGER INFO, LDA, N 00027 * DOUBLE PRECISION ANORM, RCOND 00028 * .. 00029 * .. Array Arguments .. 00030 * INTEGER IPIV( * ), IWORK( * ) 00031 * DOUBLE PRECISION A( LDA, * ), WORK( * ) 00032 * .. 00033 * 00034 * 00035 *> \par Purpose: 00036 * ============= 00037 *> 00038 *> \verbatim 00039 *> 00040 *> DSYCON estimates the reciprocal of the condition number (in the 00041 *> 1-norm) of a real symmetric matrix A using the factorization 00042 *> A = U*D*U**T or A = L*D*L**T computed by DSYTRF. 00043 *> 00044 *> An estimate is obtained for norm(inv(A)), and the reciprocal of the 00045 *> condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))). 00046 *> \endverbatim 00047 * 00048 * Arguments: 00049 * ========== 00050 * 00051 *> \param[in] UPLO 00052 *> \verbatim 00053 *> UPLO is CHARACTER*1 00054 *> Specifies whether the details of the factorization are stored 00055 *> as an upper or lower triangular matrix. 00056 *> = 'U': Upper triangular, form is A = U*D*U**T; 00057 *> = 'L': Lower triangular, form is A = L*D*L**T. 00058 *> \endverbatim 00059 *> 00060 *> \param[in] N 00061 *> \verbatim 00062 *> N is INTEGER 00063 *> The order of the matrix A. N >= 0. 00064 *> \endverbatim 00065 *> 00066 *> \param[in] A 00067 *> \verbatim 00068 *> A is DOUBLE PRECISION array, dimension (LDA,N) 00069 *> The block diagonal matrix D and the multipliers used to 00070 *> obtain the factor U or L as computed by DSYTRF. 00071 *> \endverbatim 00072 *> 00073 *> \param[in] LDA 00074 *> \verbatim 00075 *> LDA is INTEGER 00076 *> The leading dimension of the array A. LDA >= max(1,N). 00077 *> \endverbatim 00078 *> 00079 *> \param[in] IPIV 00080 *> \verbatim 00081 *> IPIV is INTEGER array, dimension (N) 00082 *> Details of the interchanges and the block structure of D 00083 *> as determined by DSYTRF. 00084 *> \endverbatim 00085 *> 00086 *> \param[in] ANORM 00087 *> \verbatim 00088 *> ANORM is DOUBLE PRECISION 00089 *> The 1-norm of the original matrix A. 00090 *> \endverbatim 00091 *> 00092 *> \param[out] RCOND 00093 *> \verbatim 00094 *> RCOND is DOUBLE PRECISION 00095 *> The reciprocal of the condition number of the matrix A, 00096 *> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an 00097 *> estimate of the 1-norm of inv(A) computed in this routine. 00098 *> \endverbatim 00099 *> 00100 *> \param[out] WORK 00101 *> \verbatim 00102 *> WORK is DOUBLE PRECISION array, dimension (2*N) 00103 *> \endverbatim 00104 *> 00105 *> \param[out] IWORK 00106 *> \verbatim 00107 *> IWORK is INTEGER array, dimension (N) 00108 *> \endverbatim 00109 *> 00110 *> \param[out] INFO 00111 *> \verbatim 00112 *> INFO is INTEGER 00113 *> = 0: successful exit 00114 *> < 0: if INFO = -i, the i-th argument had an illegal value 00115 *> \endverbatim 00116 * 00117 * Authors: 00118 * ======== 00119 * 00120 *> \author Univ. of Tennessee 00121 *> \author Univ. of California Berkeley 00122 *> \author Univ. of Colorado Denver 00123 *> \author NAG Ltd. 00124 * 00125 *> \date November 2011 00126 * 00127 *> \ingroup doubleSYcomputational 00128 * 00129 * ===================================================================== 00130 SUBROUTINE DSYCON( UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, 00131 $ IWORK, INFO ) 00132 * 00133 * -- LAPACK computational routine (version 3.4.0) -- 00134 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00135 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00136 * November 2011 00137 * 00138 * .. Scalar Arguments .. 00139 CHARACTER UPLO 00140 INTEGER INFO, LDA, N 00141 DOUBLE PRECISION ANORM, RCOND 00142 * .. 00143 * .. Array Arguments .. 00144 INTEGER IPIV( * ), IWORK( * ) 00145 DOUBLE PRECISION A( LDA, * ), WORK( * ) 00146 * .. 00147 * 00148 * ===================================================================== 00149 * 00150 * .. Parameters .. 00151 DOUBLE PRECISION ONE, ZERO 00152 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 ) 00153 * .. 00154 * .. Local Scalars .. 00155 LOGICAL UPPER 00156 INTEGER I, KASE 00157 DOUBLE PRECISION AINVNM 00158 * .. 00159 * .. Local Arrays .. 00160 INTEGER ISAVE( 3 ) 00161 * .. 00162 * .. External Functions .. 00163 LOGICAL LSAME 00164 EXTERNAL LSAME 00165 * .. 00166 * .. External Subroutines .. 00167 EXTERNAL DLACN2, DSYTRS, XERBLA 00168 * .. 00169 * .. Intrinsic Functions .. 00170 INTRINSIC MAX 00171 * .. 00172 * .. Executable Statements .. 00173 * 00174 * Test the input parameters. 00175 * 00176 INFO = 0 00177 UPPER = LSAME( UPLO, 'U' ) 00178 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN 00179 INFO = -1 00180 ELSE IF( N.LT.0 ) THEN 00181 INFO = -2 00182 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN 00183 INFO = -4 00184 ELSE IF( ANORM.LT.ZERO ) THEN 00185 INFO = -6 00186 END IF 00187 IF( INFO.NE.0 ) THEN 00188 CALL XERBLA( 'DSYCON', -INFO ) 00189 RETURN 00190 END IF 00191 * 00192 * Quick return if possible 00193 * 00194 RCOND = ZERO 00195 IF( N.EQ.0 ) THEN 00196 RCOND = ONE 00197 RETURN 00198 ELSE IF( ANORM.LE.ZERO ) THEN 00199 RETURN 00200 END IF 00201 * 00202 * Check that the diagonal matrix D is nonsingular. 00203 * 00204 IF( UPPER ) THEN 00205 * 00206 * Upper triangular storage: examine D from bottom to top 00207 * 00208 DO 10 I = N, 1, -1 00209 IF( IPIV( I ).GT.0 .AND. A( I, I ).EQ.ZERO ) 00210 $ RETURN 00211 10 CONTINUE 00212 ELSE 00213 * 00214 * Lower triangular storage: examine D from top to bottom. 00215 * 00216 DO 20 I = 1, N 00217 IF( IPIV( I ).GT.0 .AND. A( I, I ).EQ.ZERO ) 00218 $ RETURN 00219 20 CONTINUE 00220 END IF 00221 * 00222 * Estimate the 1-norm of the inverse. 00223 * 00224 KASE = 0 00225 30 CONTINUE 00226 CALL DLACN2( N, WORK( N+1 ), WORK, IWORK, AINVNM, KASE, ISAVE ) 00227 IF( KASE.NE.0 ) THEN 00228 * 00229 * Multiply by inv(L*D*L**T) or inv(U*D*U**T). 00230 * 00231 CALL DSYTRS( UPLO, N, 1, A, LDA, IPIV, WORK, N, INFO ) 00232 GO TO 30 00233 END IF 00234 * 00235 * Compute the estimate of the reciprocal condition number. 00236 * 00237 IF( AINVNM.NE.ZERO ) 00238 $ RCOND = ( ONE / AINVNM ) / ANORM 00239 * 00240 RETURN 00241 * 00242 * End of DSYCON 00243 * 00244 END