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

◆ zgtcon()

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

ZGTCON

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

Purpose:
!>
!> ZGTCON estimates the reciprocal of the condition number of a complex
!> tridiagonal matrix A using the LU factorization as computed by
!> ZGTTRF.
!>
!> 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 COMPLEX*16 array, dimension (N-1)
!>          The (n-1) multipliers that define the matrix L from the
!>          LU factorization of A as computed by ZGTTRF.
!> 
[in]D
!>          D is COMPLEX*16 array, dimension (N)
!>          The n diagonal elements of the upper triangular matrix U from
!>          the LU factorization of A.
!> 
[in]DU
!>          DU is COMPLEX*16 array, dimension (N-1)
!>          The (n-1) elements of the first superdiagonal of U.
!> 
[in]DU2
!>          DU2 is COMPLEX*16 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 COMPLEX*16 array, dimension (2*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 137 of file zgtcon.f.

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