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