LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
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.
Date
September 2012

Definition at line 148 of file sgtcon.f.

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

Here is the call graph for this function:

Here is the caller graph for this function: