3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download SGTCON + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/sgtcon.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/sgtcon.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgtcon.f">
21 * SUBROUTINE SGTCON( NORM, N, DL, D, DU, DU2, IPIV, ANORM, RCOND,
24 * .. Scalar Arguments ..
29 * .. Array Arguments ..
30 * INTEGER IPIV( * ), IWORK( * )
31 * REAL D( * ), DL( * ), DU( * ), DU2( * ), WORK( * )
40 *> SGTCON estimates the reciprocal of the condition number of a real
41 *> tridiagonal matrix A using the LU factorization as computed by
44 *> An estimate is obtained for norm(inv(A)), and the reciprocal of the
45 *> condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
53 *> NORM is CHARACTER*1
54 *> Specifies whether the 1-norm condition number or the
55 *> infinity-norm condition number is required:
56 *> = '1' or 'O': 1-norm;
57 *> = 'I': Infinity-norm.
63 *> The order of the matrix A. N >= 0.
68 *> DL is REAL array, dimension (N-1)
69 *> The (n-1) multipliers that define the matrix L from the
70 *> LU factorization of A as computed by SGTTRF.
75 *> D is REAL array, dimension (N)
76 *> The n diagonal elements of the upper triangular matrix U from
77 *> the LU factorization of A.
82 *> DU is REAL array, dimension (N-1)
83 *> The (n-1) elements of the first superdiagonal of U.
88 *> DU2 is REAL array, dimension (N-2)
89 *> The (n-2) elements of the second superdiagonal of U.
94 *> IPIV is INTEGER array, dimension (N)
95 *> The pivot indices; for 1 <= i <= n, row i of the matrix was
96 *> interchanged with row IPIV(i). IPIV(i) will always be either
97 *> i or i+1; IPIV(i) = i indicates a row interchange was not
104 *> If NORM = '1' or 'O', the 1-norm of the original matrix A.
105 *> If NORM = 'I', the infinity-norm of the original matrix A.
111 *> The reciprocal of the condition number of the matrix A,
112 *> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
113 *> estimate of the 1-norm of inv(A) computed in this routine.
118 *> WORK is REAL array, dimension (2*N)
123 *> IWORK is INTEGER array, dimension (N)
129 *> = 0: successful exit
130 *> < 0: if INFO = -i, the i-th argument had an illegal value
136 *> \author Univ. of Tennessee
137 *> \author Univ. of California Berkeley
138 *> \author Univ. of Colorado Denver
141 *> \date September 2012
143 *> \ingroup realGTcomputational
145 * =====================================================================
146 SUBROUTINE SGTCON( NORM, N, DL, D, DU, DU2, IPIV, ANORM, RCOND,
147 $ WORK, IWORK, INFO )
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..--
154 * .. Scalar Arguments ..
159 * .. Array Arguments ..
160 INTEGER IPIV( * ), IWORK( * )
161 REAL D( * ), DL( * ), DU( * ), DU2( * ), WORK( * )
164 * =====================================================================
168 PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
170 * .. Local Scalars ..
172 INTEGER I, KASE, KASE1
178 * .. External Functions ..
182 * .. External Subroutines ..
183 EXTERNAL SGTTRS, SLACN2, XERBLA
185 * .. Executable Statements ..
187 * Test the input arguments.
190 ONENRM = NORM.EQ.'1' .OR. LSAME( NORM, 'O' )
191 IF( .NOT.ONENRM .AND. .NOT.LSAME( NORM, 'I' ) ) THEN
193 ELSE IF( N.LT.0 ) THEN
195 ELSE IF( ANORM.LT.ZERO ) THEN
199 CALL XERBLA( 'SGTCON', -INFO )
203 * Quick return if possible
209 ELSE IF( ANORM.EQ.ZERO ) THEN
213 * Check that D(1:N) is non-zero.
228 CALL SLACN2( N, WORK( N+1 ), WORK, IWORK, AINVNM, KASE, ISAVE )
230 IF( KASE.EQ.KASE1 ) THEN
232 * Multiply by inv(U)*inv(L).
234 CALL SGTTRS( 'No transpose', N, 1, DL, D, DU, DU2, IPIV,
238 * Multiply by inv(L**T)*inv(U**T).
240 CALL SGTTRS( 'Transpose', N, 1, DL, D, DU, DU2, IPIV, WORK,
246 * Compute the estimate of the reciprocal condition number.
249 $ RCOND = ( ONE / AINVNM ) / ANORM