LAPACK  3.10.1
LAPACK: Linear Algebra PACKage

◆ cptcon()

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.
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 118 of file cptcon.f.

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