LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
zgecon.f
Go to the documentation of this file.
00001 *> \brief \b ZGECON
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *> \htmlonly
00009 *> Download ZGECON + dependencies 
00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zgecon.f"> 
00011 *> [TGZ]</a> 
00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zgecon.f"> 
00013 *> [ZIP]</a> 
00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgecon.f"> 
00015 *> [TXT]</a>
00016 *> \endhtmlonly 
00017 *
00018 *  Definition:
00019 *  ===========
00020 *
00021 *       SUBROUTINE ZGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK,
00022 *                          INFO )
00023 * 
00024 *       .. Scalar Arguments ..
00025 *       CHARACTER          NORM
00026 *       INTEGER            INFO, LDA, N
00027 *       DOUBLE PRECISION   ANORM, RCOND
00028 *       ..
00029 *       .. Array Arguments ..
00030 *       DOUBLE PRECISION   RWORK( * )
00031 *       COMPLEX*16         A( LDA, * ), WORK( * )
00032 *       ..
00033 *  
00034 *
00035 *> \par Purpose:
00036 *  =============
00037 *>
00038 *> \verbatim
00039 *>
00040 *> ZGECON estimates the reciprocal of the condition number of a general
00041 *> complex matrix A, in either the 1-norm or the infinity-norm, using
00042 *> the LU factorization computed by ZGETRF.
00043 *>
00044 *> An estimate is obtained for norm(inv(A)), and the reciprocal of the
00045 *> condition number is computed as
00046 *>    RCOND = 1 / ( norm(A) * norm(inv(A)) ).
00047 *> \endverbatim
00048 *
00049 *  Arguments:
00050 *  ==========
00051 *
00052 *> \param[in] NORM
00053 *> \verbatim
00054 *>          NORM is CHARACTER*1
00055 *>          Specifies whether the 1-norm condition number or the
00056 *>          infinity-norm condition number is required:
00057 *>          = '1' or 'O':  1-norm;
00058 *>          = 'I':         Infinity-norm.
00059 *> \endverbatim
00060 *>
00061 *> \param[in] N
00062 *> \verbatim
00063 *>          N is INTEGER
00064 *>          The order of the matrix A.  N >= 0.
00065 *> \endverbatim
00066 *>
00067 *> \param[in] A
00068 *> \verbatim
00069 *>          A is COMPLEX*16 array, dimension (LDA,N)
00070 *>          The factors L and U from the factorization A = P*L*U
00071 *>          as computed by ZGETRF.
00072 *> \endverbatim
00073 *>
00074 *> \param[in] LDA
00075 *> \verbatim
00076 *>          LDA is INTEGER
00077 *>          The leading dimension of the array A.  LDA >= max(1,N).
00078 *> \endverbatim
00079 *>
00080 *> \param[in] ANORM
00081 *> \verbatim
00082 *>          ANORM is DOUBLE PRECISION
00083 *>          If NORM = '1' or 'O', the 1-norm of the original matrix A.
00084 *>          If NORM = 'I', the infinity-norm of the original matrix A.
00085 *> \endverbatim
00086 *>
00087 *> \param[out] RCOND
00088 *> \verbatim
00089 *>          RCOND is DOUBLE PRECISION
00090 *>          The reciprocal of the condition number of the matrix A,
00091 *>          computed as RCOND = 1/(norm(A) * norm(inv(A))).
00092 *> \endverbatim
00093 *>
00094 *> \param[out] WORK
00095 *> \verbatim
00096 *>          WORK is COMPLEX*16 array, dimension (2*N)
00097 *> \endverbatim
00098 *>
00099 *> \param[out] RWORK
00100 *> \verbatim
00101 *>          RWORK is DOUBLE PRECISION array, dimension (2*N)
00102 *> \endverbatim
00103 *>
00104 *> \param[out] INFO
00105 *> \verbatim
00106 *>          INFO is INTEGER
00107 *>          = 0:  successful exit
00108 *>          < 0:  if INFO = -i, the i-th argument had an illegal value
00109 *> \endverbatim
00110 *
00111 *  Authors:
00112 *  ========
00113 *
00114 *> \author Univ. of Tennessee 
00115 *> \author Univ. of California Berkeley 
00116 *> \author Univ. of Colorado Denver 
00117 *> \author NAG Ltd. 
00118 *
00119 *> \date November 2011
00120 *
00121 *> \ingroup complex16GEcomputational
00122 *
00123 *  =====================================================================
00124       SUBROUTINE ZGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK,
00125      $                   INFO )
00126 *
00127 *  -- LAPACK computational routine (version 3.4.0) --
00128 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00129 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00130 *     November 2011
00131 *
00132 *     .. Scalar Arguments ..
00133       CHARACTER          NORM
00134       INTEGER            INFO, LDA, N
00135       DOUBLE PRECISION   ANORM, RCOND
00136 *     ..
00137 *     .. Array Arguments ..
00138       DOUBLE PRECISION   RWORK( * )
00139       COMPLEX*16         A( LDA, * ), WORK( * )
00140 *     ..
00141 *
00142 *  =====================================================================
00143 *
00144 *     .. Parameters ..
00145       DOUBLE PRECISION   ONE, ZERO
00146       PARAMETER          ( ONE = 1.0D+0, ZERO = 0.0D+0 )
00147 *     ..
00148 *     .. Local Scalars ..
00149       LOGICAL            ONENRM
00150       CHARACTER          NORMIN
00151       INTEGER            IX, KASE, KASE1
00152       DOUBLE PRECISION   AINVNM, SCALE, SL, SMLNUM, SU
00153       COMPLEX*16         ZDUM
00154 *     ..
00155 *     .. Local Arrays ..
00156       INTEGER            ISAVE( 3 )
00157 *     ..
00158 *     .. External Functions ..
00159       LOGICAL            LSAME
00160       INTEGER            IZAMAX
00161       DOUBLE PRECISION   DLAMCH
00162       EXTERNAL           LSAME, IZAMAX, DLAMCH
00163 *     ..
00164 *     .. External Subroutines ..
00165       EXTERNAL           XERBLA, ZDRSCL, ZLACN2, ZLATRS
00166 *     ..
00167 *     .. Intrinsic Functions ..
00168       INTRINSIC          ABS, DBLE, DIMAG, MAX
00169 *     ..
00170 *     .. Statement Functions ..
00171       DOUBLE PRECISION   CABS1
00172 *     ..
00173 *     .. Statement Function definitions ..
00174       CABS1( ZDUM ) = ABS( DBLE( ZDUM ) ) + ABS( DIMAG( ZDUM ) )
00175 *     ..
00176 *     .. Executable Statements ..
00177 *
00178 *     Test the input parameters.
00179 *
00180       INFO = 0
00181       ONENRM = NORM.EQ.'1' .OR. LSAME( NORM, 'O' )
00182       IF( .NOT.ONENRM .AND. .NOT.LSAME( NORM, 'I' ) ) THEN
00183          INFO = -1
00184       ELSE IF( N.LT.0 ) THEN
00185          INFO = -2
00186       ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
00187          INFO = -4
00188       ELSE IF( ANORM.LT.ZERO ) THEN
00189          INFO = -5
00190       END IF
00191       IF( INFO.NE.0 ) THEN
00192          CALL XERBLA( 'ZGECON', -INFO )
00193          RETURN
00194       END IF
00195 *
00196 *     Quick return if possible
00197 *
00198       RCOND = ZERO
00199       IF( N.EQ.0 ) THEN
00200          RCOND = ONE
00201          RETURN
00202       ELSE IF( ANORM.EQ.ZERO ) THEN
00203          RETURN
00204       END IF
00205 *
00206       SMLNUM = DLAMCH( 'Safe minimum' )
00207 *
00208 *     Estimate the norm of inv(A).
00209 *
00210       AINVNM = ZERO
00211       NORMIN = 'N'
00212       IF( ONENRM ) THEN
00213          KASE1 = 1
00214       ELSE
00215          KASE1 = 2
00216       END IF
00217       KASE = 0
00218    10 CONTINUE
00219       CALL ZLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
00220       IF( KASE.NE.0 ) THEN
00221          IF( KASE.EQ.KASE1 ) THEN
00222 *
00223 *           Multiply by inv(L).
00224 *
00225             CALL ZLATRS( 'Lower', 'No transpose', 'Unit', NORMIN, N, A,
00226      $                   LDA, WORK, SL, RWORK, INFO )
00227 *
00228 *           Multiply by inv(U).
00229 *
00230             CALL ZLATRS( 'Upper', 'No transpose', 'Non-unit', NORMIN, N,
00231      $                   A, LDA, WORK, SU, RWORK( N+1 ), INFO )
00232          ELSE
00233 *
00234 *           Multiply by inv(U**H).
00235 *
00236             CALL ZLATRS( 'Upper', 'Conjugate transpose', 'Non-unit',
00237      $                   NORMIN, N, A, LDA, WORK, SU, RWORK( N+1 ),
00238      $                   INFO )
00239 *
00240 *           Multiply by inv(L**H).
00241 *
00242             CALL ZLATRS( 'Lower', 'Conjugate transpose', 'Unit', NORMIN,
00243      $                   N, A, LDA, WORK, SL, RWORK, INFO )
00244          END IF
00245 *
00246 *        Divide X by 1/(SL*SU) if doing so will not cause overflow.
00247 *
00248          SCALE = SL*SU
00249          NORMIN = 'Y'
00250          IF( SCALE.NE.ONE ) THEN
00251             IX = IZAMAX( N, WORK, 1 )
00252             IF( SCALE.LT.CABS1( WORK( IX ) )*SMLNUM .OR. SCALE.EQ.ZERO )
00253      $         GO TO 20
00254             CALL ZDRSCL( N, SCALE, WORK, 1 )
00255          END IF
00256          GO TO 10
00257       END IF
00258 *
00259 *     Compute the estimate of the reciprocal condition number.
00260 *
00261       IF( AINVNM.NE.ZERO )
00262      $   RCOND = ( ONE / AINVNM ) / ANORM
00263 *
00264    20 CONTINUE
00265       RETURN
00266 *
00267 *     End of ZGECON
00268 *
00269       END
 All Files Functions