LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine cptcon ( integer  N,
real, dimension( * )  D,
complex, dimension( * )  E,
real  ANORM,
real  RCOND,
real, dimension( * )  RWORK,
integer  INFO 
)

CPTCON

Download CPTCON + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 CPTCON computes the reciprocal of the condition number (in the
 1-norm) of a complex Hermitian positive definite tridiagonal matrix
 using the factorization A = L*D*L**H or A = U**H*D*U computed by
 CPTTRF.

 Norm(inv(A)) is computed by a direct method, and the reciprocal of
 the condition number is computed as
                  RCOND = 1 / (ANORM * norm(inv(A))).
Parameters
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in]D
          D is REAL array, dimension (N)
          The n diagonal elements of the diagonal matrix D from the
          factorization of A, as computed by CPTTRF.
[in]E
          E is COMPLEX array, dimension (N-1)
          The (n-1) off-diagonal elements of the unit bidiagonal factor
          U or L from the factorization of A, as computed by CPTTRF.
[in]ANORM
          ANORM is REAL
          The 1-norm of the original matrix A.
[out]RCOND
          RCOND is REAL
          The reciprocal of the condition number of the matrix A,
          computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is the
          1-norm of inv(A) computed in this routine.
[out]RWORK
          RWORK is REAL array, dimension (N)
[out]INFO
          INFO is INTEGER
          = 0:  successful exit
          < 0:  if INFO = -i, the i-th argument had an illegal value
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
September 2012
Further Details:
  The method used is described in Nicholas J. Higham, "Efficient
  Algorithms for Computing the Condition Number of a Tridiagonal
  Matrix", SIAM J. Sci. Stat. Comput., Vol. 7, No. 1, January 1986.

Definition at line 121 of file cptcon.f.

121 *
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..--
125 * September 2012
126 *
127 * .. Scalar Arguments ..
128  INTEGER info, n
129  REAL anorm, rcond
130 * ..
131 * .. Array Arguments ..
132  REAL d( * ), rwork( * )
133  COMPLEX e( * )
134 * ..
135 *
136 * =====================================================================
137 *
138 * .. Parameters ..
139  REAL one, zero
140  parameter ( one = 1.0e+0, zero = 0.0e+0 )
141 * ..
142 * .. Local Scalars ..
143  INTEGER i, ix
144  REAL ainvnm
145 * ..
146 * .. External Functions ..
147  INTEGER isamax
148  EXTERNAL isamax
149 * ..
150 * .. External Subroutines ..
151  EXTERNAL xerbla
152 * ..
153 * .. Intrinsic Functions ..
154  INTRINSIC abs
155 * ..
156 * .. Executable Statements ..
157 *
158 * Test the input arguments.
159 *
160  info = 0
161  IF( n.LT.0 ) THEN
162  info = -1
163  ELSE IF( anorm.LT.zero ) THEN
164  info = -4
165  END IF
166  IF( info.NE.0 ) THEN
167  CALL xerbla( 'CPTCON', -info )
168  RETURN
169  END IF
170 *
171 * Quick return if possible
172 *
173  rcond = zero
174  IF( n.EQ.0 ) THEN
175  rcond = one
176  RETURN
177  ELSE IF( anorm.EQ.zero ) THEN
178  RETURN
179  END IF
180 *
181 * Check that D(1:N) is positive.
182 *
183  DO 10 i = 1, n
184  IF( d( i ).LE.zero )
185  $ RETURN
186  10 CONTINUE
187 *
188 * Solve M(A) * x = e, where M(A) = (m(i,j)) is given by
189 *
190 * m(i,j) = abs(A(i,j)), i = j,
191 * m(i,j) = -abs(A(i,j)), i .ne. j,
192 *
193 * and e = [ 1, 1, ..., 1 ]**T. Note M(A) = M(L)*D*M(L)**H.
194 *
195 * Solve M(L) * x = e.
196 *
197  rwork( 1 ) = one
198  DO 20 i = 2, n
199  rwork( i ) = one + rwork( i-1 )*abs( e( i-1 ) )
200  20 CONTINUE
201 *
202 * Solve D * M(L)**H * x = b.
203 *
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 ) )
207  30 CONTINUE
208 *
209 * Compute AINVNM = max(x(i)), 1<=i<=n.
210 *
211  ix = isamax( n, rwork, 1 )
212  ainvnm = abs( rwork( ix ) )
213 *
214 * Compute the reciprocal condition number.
215 *
216  IF( ainvnm.NE.zero )
217  $ rcond = ( one / ainvnm ) / anorm
218 *
219  RETURN
220 *
221 * End of CPTCON
222 *
integer function isamax(N, SX, INCX)
ISAMAX
Definition: isamax.f:53
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62

Here is the call graph for this function:

Here is the caller graph for this function: