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

◆ dgtcon()

subroutine dgtcon ( character  norm,
integer  n,
double precision, dimension( * )  dl,
double precision, dimension( * )  d,
double precision, dimension( * )  du,
double precision, dimension( * )  du2,
integer, dimension( * )  ipiv,
double precision  anorm,
double precision  rcond,
double precision, dimension( * )  work,
integer, dimension( * )  iwork,
integer  info 
)

DGTCON

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

Purpose:
 DGTCON estimates the reciprocal of the condition number of a real
 tridiagonal matrix A using the LU factorization as computed by
 DGTTRF.

 An estimate is obtained for norm(inv(A)), and the reciprocal of the
 condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
Parameters
[in]NORM
          NORM is CHARACTER*1
          Specifies whether the 1-norm condition number or the
          infinity-norm condition number is required:
          = '1' or 'O':  1-norm;
          = 'I':         Infinity-norm.
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in]DL
          DL is DOUBLE PRECISION array, dimension (N-1)
          The (n-1) multipliers that define the matrix L from the
          LU factorization of A as computed by DGTTRF.
[in]D
          D is DOUBLE PRECISION array, dimension (N)
          The n diagonal elements of the upper triangular matrix U from
          the LU factorization of A.
[in]DU
          DU is DOUBLE PRECISION array, dimension (N-1)
          The (n-1) elements of the first superdiagonal of U.
[in]DU2
          DU2 is DOUBLE PRECISION array, dimension (N-2)
          The (n-2) elements of the second superdiagonal of U.
[in]IPIV
          IPIV is INTEGER array, dimension (N)
          The pivot indices; for 1 <= i <= n, row i of the matrix was
          interchanged with row IPIV(i).  IPIV(i) will always be either
          i or i+1; IPIV(i) = i indicates a row interchange was not
          required.
[in]ANORM
          ANORM is DOUBLE PRECISION
          If NORM = '1' or 'O', the 1-norm of the original matrix A.
          If NORM = 'I', the infinity-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 an
          estimate of the 1-norm of inv(A) computed in this routine.
[out]WORK
          WORK is DOUBLE PRECISION array, dimension (2*N)
[out]IWORK
          IWORK is INTEGER 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.

Definition at line 144 of file dgtcon.f.

146*
147* -- LAPACK computational routine --
148* -- LAPACK is a software package provided by Univ. of Tennessee, --
149* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
150*
151* .. Scalar Arguments ..
152 CHARACTER NORM
153 INTEGER INFO, N
154 DOUBLE PRECISION ANORM, RCOND
155* ..
156* .. Array Arguments ..
157 INTEGER IPIV( * ), IWORK( * )
158 DOUBLE PRECISION D( * ), DL( * ), DU( * ), DU2( * ), WORK( * )
159* ..
160*
161* =====================================================================
162*
163* .. Parameters ..
164 DOUBLE PRECISION ONE, ZERO
165 parameter( one = 1.0d+0, zero = 0.0d+0 )
166* ..
167* .. Local Scalars ..
168 LOGICAL ONENRM
169 INTEGER I, KASE, KASE1
170 DOUBLE PRECISION AINVNM
171* ..
172* .. Local Arrays ..
173 INTEGER ISAVE( 3 )
174* ..
175* .. External Functions ..
176 LOGICAL LSAME
177 EXTERNAL lsame
178* ..
179* .. External Subroutines ..
180 EXTERNAL dgttrs, dlacn2, xerbla
181* ..
182* .. Executable Statements ..
183*
184* Test the input arguments.
185*
186 info = 0
187 onenrm = norm.EQ.'1' .OR. lsame( norm, 'O' )
188 IF( .NOT.onenrm .AND. .NOT.lsame( norm, 'I' ) ) THEN
189 info = -1
190 ELSE IF( n.LT.0 ) THEN
191 info = -2
192 ELSE IF( anorm.LT.zero ) THEN
193 info = -8
194 END IF
195 IF( info.NE.0 ) THEN
196 CALL xerbla( 'DGTCON', -info )
197 RETURN
198 END IF
199*
200* Quick return if possible
201*
202 rcond = zero
203 IF( n.EQ.0 ) THEN
204 rcond = one
205 RETURN
206 ELSE IF( anorm.EQ.zero ) THEN
207 RETURN
208 END IF
209*
210* Check that D(1:N) is non-zero.
211*
212 DO 10 i = 1, n
213 IF( d( i ).EQ.zero )
214 $ RETURN
215 10 CONTINUE
216*
217 ainvnm = zero
218 IF( onenrm ) THEN
219 kase1 = 1
220 ELSE
221 kase1 = 2
222 END IF
223 kase = 0
224 20 CONTINUE
225 CALL dlacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
226 IF( kase.NE.0 ) THEN
227 IF( kase.EQ.kase1 ) THEN
228*
229* Multiply by inv(U)*inv(L).
230*
231 CALL dgttrs( 'No transpose', n, 1, dl, d, du, du2, ipiv,
232 $ work, n, info )
233 ELSE
234*
235* Multiply by inv(L**T)*inv(U**T).
236*
237 CALL dgttrs( 'Transpose', n, 1, dl, d, du, du2, ipiv, work,
238 $ n, info )
239 END IF
240 GO TO 20
241 END IF
242*
243* Compute the estimate of the reciprocal condition number.
244*
245 IF( ainvnm.NE.zero )
246 $ rcond = ( one / ainvnm ) / anorm
247*
248 RETURN
249*
250* End of DGTCON
251*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine dgttrs(trans, n, nrhs, dl, d, du, du2, ipiv, b, ldb, info)
DGTTRS
Definition dgttrs.f:138
subroutine dlacn2(n, v, x, isgn, est, kase, isave)
DLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition dlacn2.f:136
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
Here is the call graph for this function:
Here is the caller graph for this function: