LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ dptcon()

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.
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 117 of file dptcon.f.

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