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

◆ sgtcon()

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

SGTCON

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

Purpose:
!>
!> SGTCON estimates the reciprocal of the condition number of a real
!> tridiagonal matrix A using the LU factorization as computed by
!> SGTTRF.
!>
!> 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 REAL array, dimension (N-1)
!>          The (n-1) multipliers that define the matrix L from the
!>          LU factorization of A as computed by SGTTRF.
!> 
[in]D
!>          D is REAL array, dimension (N)
!>          The n diagonal elements of the upper triangular matrix U from
!>          the LU factorization of A.
!> 
[in]DU
!>          DU is REAL array, dimension (N-1)
!>          The (n-1) elements of the first superdiagonal of U.
!> 
[in]DU2
!>          DU2 is REAL 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 REAL
!>          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 REAL
!>          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 REAL 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 142 of file sgtcon.f.

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