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