LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine dptcon ( integer  N,
double precision, dimension( * )  D,
double precision, dimension( * )  E,
double precision  ANORM,
double precision  RCOND,
double precision, dimension( * )  WORK,
integer  INFO 
)

DPTCON

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

Purpose:
 DPTCON computes the reciprocal of the condition number (in the
 1-norm) of a real symmetric positive definite tridiagonal matrix
 using the factorization A = L*D*L**T or A = U**T*D*U computed by
 DPTTRF.

 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 DOUBLE PRECISION array, dimension (N)
          The n diagonal elements of the diagonal matrix D from the
          factorization of A, as computed by DPTTRF.
[in]E
          E is DOUBLE PRECISION 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 DPTTRF.
[in]ANORM
          ANORM is DOUBLE PRECISION
          The 1-norm of the original matrix A.
[out]RCOND
          RCOND is DOUBLE PRECISION
          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]WORK
          WORK is DOUBLE PRECISION 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 120 of file dptcon.f.

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