|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282 |
- *> \brief \b CSYCON_3
- *
- * =========== DOCUMENTATION ===========
- *
- * Online html documentation available at
- * http://www.netlib.org/lapack/explore-html/
- *
- *> \htmlonly
- *> Download CSYCON_3 + dependencies
- *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/csycon_3.f">
- *> [TGZ]</a>
- *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/csycon_3.f">
- *> [ZIP]</a>
- *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csycon_3.f">
- *> [TXT]</a>
- *> \endhtmlonly
- *
- * Definition:
- * ===========
- *
- * SUBROUTINE CSYCON_3( UPLO, N, A, LDA, E, IPIV, ANORM, RCOND,
- * WORK, INFO )
- *
- * .. Scalar Arguments ..
- * CHARACTER UPLO
- * INTEGER INFO, LDA, N
- * REAL ANORM, RCOND
- * ..
- * .. Array Arguments ..
- * INTEGER IPIV( * )
- * COMPLEX A( LDA, * ), E ( * ), WORK( * )
- * ..
- *
- *
- *> \par Purpose:
- * =============
- *>
- *> \verbatim
- *> CSYCON_3 estimates the reciprocal of the condition number (in the
- *> 1-norm) of a complex symmetric matrix A using the factorization
- *> computed by CSYTRF_RK or CSYTRF_BK:
- *>
- *> A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
- *>
- *> where U (or L) is unit upper (or lower) triangular matrix,
- *> U**T (or L**T) is the transpose of U (or L), P is a permutation
- *> matrix, P**T is the transpose of P, and D is symmetric and block
- *> diagonal with 1-by-1 and 2-by-2 diagonal blocks.
- *>
- *> An estimate is obtained for norm(inv(A)), and the reciprocal of the
- *> condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
- *> This routine uses BLAS3 solver CSYTRS_3.
- *> \endverbatim
- *
- * Arguments:
- * ==========
- *
- *> \param[in] UPLO
- *> \verbatim
- *> UPLO is CHARACTER*1
- *> Specifies whether the details of the factorization are
- *> stored as an upper or lower triangular matrix:
- *> = 'U': Upper triangular, form is A = P*U*D*(U**T)*(P**T);
- *> = 'L': Lower triangular, form is A = P*L*D*(L**T)*(P**T).
- *> \endverbatim
- *>
- *> \param[in] N
- *> \verbatim
- *> N is INTEGER
- *> The order of the matrix A. N >= 0.
- *> \endverbatim
- *>
- *> \param[in] A
- *> \verbatim
- *> A is COMPLEX array, dimension (LDA,N)
- *> Diagonal of the block diagonal matrix D and factors U or L
- *> as computed by CSYTRF_RK and CSYTRF_BK:
- *> a) ONLY diagonal elements of the symmetric block diagonal
- *> matrix D on the diagonal of A, i.e. D(k,k) = A(k,k);
- *> (superdiagonal (or subdiagonal) elements of D
- *> should be provided on entry in array E), and
- *> b) If UPLO = 'U': factor U in the superdiagonal part of A.
- *> If UPLO = 'L': factor L in the subdiagonal part of A.
- *> \endverbatim
- *>
- *> \param[in] LDA
- *> \verbatim
- *> LDA is INTEGER
- *> The leading dimension of the array A. LDA >= max(1,N).
- *> \endverbatim
- *>
- *> \param[in] E
- *> \verbatim
- *> E is COMPLEX array, dimension (N)
- *> On entry, contains the superdiagonal (or subdiagonal)
- *> elements of the symmetric block diagonal matrix D
- *> with 1-by-1 or 2-by-2 diagonal blocks, where
- *> If UPLO = 'U': E(i) = D(i-1,i),i=2:N, E(1) not referenced;
- *> If UPLO = 'L': E(i) = D(i+1,i),i=1:N-1, E(N) not referenced.
- *>
- *> NOTE: For 1-by-1 diagonal block D(k), where
- *> 1 <= k <= N, the element E(k) is not referenced in both
- *> UPLO = 'U' or UPLO = 'L' cases.
- *> \endverbatim
- *>
- *> \param[in] IPIV
- *> \verbatim
- *> IPIV is INTEGER array, dimension (N)
- *> Details of the interchanges and the block structure of D
- *> as determined by CSYTRF_RK or CSYTRF_BK.
- *> \endverbatim
- *>
- *> \param[in] ANORM
- *> \verbatim
- *> ANORM is REAL
- *> The 1-norm of the original matrix A.
- *> \endverbatim
- *>
- *> \param[out] RCOND
- *> \verbatim
- *> RCOND is REAL
- *> The reciprocal of the condition number of the matrix A,
- *> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
- *> estimate of the 1-norm of inv(A) computed in this routine.
- *> \endverbatim
- *>
- *> \param[out] WORK
- *> \verbatim
- *> WORK is COMPLEX array, dimension (2*N)
- *> \endverbatim
- *>
- *> \param[out] INFO
- *> \verbatim
- *> INFO is INTEGER
- *> = 0: successful exit
- *> < 0: if INFO = -i, the i-th argument had an illegal value
- *> \endverbatim
- *
- * Authors:
- * ========
- *
- *> \author Univ. of Tennessee
- *> \author Univ. of California Berkeley
- *> \author Univ. of Colorado Denver
- *> \author NAG Ltd.
- *
- *> \date June 2017
- *
- *> \ingroup complexSYcomputational
- *
- *> \par Contributors:
- * ==================
- *> \verbatim
- *>
- *> June 2017, Igor Kozachenko,
- *> Computer Science Division,
- *> University of California, Berkeley
- *>
- *> September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas,
- *> School of Mathematics,
- *> University of Manchester
- *>
- *> \endverbatim
- *
- * =====================================================================
- SUBROUTINE CSYCON_3( UPLO, N, A, LDA, E, IPIV, ANORM, RCOND,
- $ WORK, INFO )
- *
- * -- LAPACK computational routine (version 3.7.1) --
- * -- LAPACK is a software package provided by Univ. of Tennessee, --
- * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
- * June 2017
- *
- * .. Scalar Arguments ..
- CHARACTER UPLO
- INTEGER INFO, LDA, N
- REAL ANORM, RCOND
- * ..
- * .. Array Arguments ..
- INTEGER IPIV( * )
- COMPLEX A( LDA, * ), E( * ), WORK( * )
- * ..
- *
- * =====================================================================
- *
- * .. Parameters ..
- REAL ONE, ZERO
- PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
- COMPLEX CZERO
- PARAMETER ( CZERO = ( 0.0E+0, 0.0E+0 ) )
- * ..
- * .. Local Scalars ..
- LOGICAL UPPER
- INTEGER I, KASE
- REAL AINVNM
- * ..
- * .. Local Arrays ..
- INTEGER ISAVE( 3 )
- * ..
- * .. External Functions ..
- LOGICAL LSAME
- EXTERNAL LSAME
- * ..
- * .. External Subroutines ..
- EXTERNAL CLACN2, CSYTRS_3, XERBLA
- * ..
- * .. Intrinsic Functions ..
- INTRINSIC MAX
- * ..
- * .. Executable Statements ..
- *
- * Test the input parameters.
- *
- INFO = 0
- UPPER = LSAME( UPLO, 'U' )
- IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
- INFO = -1
- ELSE IF( N.LT.0 ) THEN
- INFO = -2
- ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
- INFO = -4
- ELSE IF( ANORM.LT.ZERO ) THEN
- INFO = -7
- END IF
- IF( INFO.NE.0 ) THEN
- CALL XERBLA( 'CSYCON_3', -INFO )
- RETURN
- END IF
- *
- * Quick return if possible
- *
- RCOND = ZERO
- IF( N.EQ.0 ) THEN
- RCOND = ONE
- RETURN
- ELSE IF( ANORM.LE.ZERO ) THEN
- RETURN
- END IF
- *
- * Check that the diagonal matrix D is nonsingular.
- *
- IF( UPPER ) THEN
- *
- * Upper triangular storage: examine D from bottom to top
- *
- DO I = N, 1, -1
- IF( IPIV( I ).GT.0 .AND. A( I, I ).EQ.CZERO )
- $ RETURN
- END DO
- ELSE
- *
- * Lower triangular storage: examine D from top to bottom.
- *
- DO I = 1, N
- IF( IPIV( I ).GT.0 .AND. A( I, I ).EQ.CZERO )
- $ RETURN
- END DO
- END IF
- *
- * Estimate the 1-norm of the inverse.
- *
- KASE = 0
- 30 CONTINUE
- CALL CLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
- IF( KASE.NE.0 ) THEN
- *
- * Multiply by inv(L*D*L**T) or inv(U*D*U**T).
- *
- CALL CSYTRS_3( UPLO, N, 1, A, LDA, E, IPIV, WORK, N, INFO )
- GO TO 30
- END IF
- *
- * Compute the estimate of the reciprocal condition number.
- *
- IF( AINVNM.NE.ZERO )
- $ RCOND = ( ONE / AINVNM ) / ANORM
- *
- RETURN
- *
- * End of CSYCON_3
- *
- END
|