3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download CPTCON + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cptcon.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cptcon.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cptcon.f">
21 * SUBROUTINE CPTCON( N, D, E, ANORM, RCOND, RWORK, INFO )
23 * .. Scalar Arguments ..
27 * .. Array Arguments ..
28 * REAL D( * ), RWORK( * )
38 *> CPTCON computes the reciprocal of the condition number (in the
39 *> 1-norm) of a complex Hermitian positive definite tridiagonal matrix
40 *> using the factorization A = L*D*L**H or A = U**H*D*U computed by
43 *> Norm(inv(A)) is computed by a direct method, and the reciprocal of
44 *> the condition number is computed as
45 *> RCOND = 1 / (ANORM * norm(inv(A))).
54 *> The order of the matrix A. N >= 0.
59 *> D is REAL array, dimension (N)
60 *> The n diagonal elements of the diagonal matrix D from the
61 *> factorization of A, as computed by CPTTRF.
66 *> E is COMPLEX array, dimension (N-1)
67 *> The (n-1) off-diagonal elements of the unit bidiagonal factor
68 *> U or L from the factorization of A, as computed by CPTTRF.
74 *> The 1-norm of the original matrix A.
80 *> The reciprocal of the condition number of the matrix A,
81 *> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is the
82 *> 1-norm of inv(A) computed in this routine.
87 *> RWORK is REAL array, dimension (N)
93 *> = 0: successful exit
94 *> < 0: if INFO = -i, the i-th argument had an illegal value
100 *> \author Univ. of Tennessee
101 *> \author Univ. of California Berkeley
102 *> \author Univ. of Colorado Denver
105 *> \date September 2012
107 *> \ingroup complexPTcomputational
109 *> \par Further Details:
110 * =====================
114 *> The method used is described in Nicholas J. Higham, "Efficient
115 *> Algorithms for Computing the Condition Number of a Tridiagonal
116 *> Matrix", SIAM J. Sci. Stat. Comput., Vol. 7, No. 1, January 1986.
119 * =====================================================================
120 SUBROUTINE CPTCON( N, D, E, ANORM, RCOND, RWORK, INFO )
122 * -- LAPACK computational routine (version 3.4.2) --
123 * -- LAPACK is a software package provided by Univ. of Tennessee, --
124 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
127 * .. Scalar Arguments ..
131 * .. Array Arguments ..
132 REAL D( * ), RWORK( * )
136 * =====================================================================
140 PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
142 * .. Local Scalars ..
146 * .. External Functions ..
150 * .. External Subroutines ..
153 * .. Intrinsic Functions ..
156 * .. Executable Statements ..
158 * Test the input arguments.
163 ELSE IF( ANORM.LT.ZERO ) THEN
167 CALL XERBLA( 'CPTCON', -INFO )
171 * Quick return if possible
177 ELSE IF( ANORM.EQ.ZERO ) THEN
181 * Check that D(1:N) is positive.
188 * Solve M(A) * x = e, where M(A) = (m(i,j)) is given by
190 * m(i,j) = abs(A(i,j)), i = j,
191 * m(i,j) = -abs(A(i,j)), i .ne. j,
193 * and e = [ 1, 1, ..., 1 ]**T. Note M(A) = M(L)*D*M(L)**H.
195 * Solve M(L) * x = e.
199 RWORK( I ) = ONE + RWORK( I-1 )*ABS( E( I-1 ) )
202 * Solve D * M(L)**H * x = b.
204 RWORK( N ) = RWORK( N ) / D( N )
205 DO 30 I = N - 1, 1, -1
206 RWORK( I ) = RWORK( I ) / D( I ) + RWORK( I+1 )*ABS( E( I ) )
209 * Compute AINVNM = max(x(i)), 1<=i<=n.
211 IX = ISAMAX( N, RWORK, 1 )
212 AINVNM = ABS( RWORK( IX ) )
214 * Compute the reciprocal condition number.
217 $ RCOND = ( ONE / AINVNM ) / ANORM