LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ dtrcon()

subroutine dtrcon ( character  NORM,
character  UPLO,
character  DIAG,
integer  N,
double precision, dimension( lda, * )  A,
integer  LDA,
double precision  RCOND,
double precision, dimension( * )  WORK,
integer, dimension( * )  IWORK,
integer  INFO 
)

DTRCON

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

Purpose:
 DTRCON estimates the reciprocal of the condition number of a
 triangular matrix A, in either the 1-norm or the infinity-norm.

 The norm of A is computed and an estimate is obtained for
 norm(inv(A)), then the reciprocal of the condition number is
 computed as
    RCOND = 1 / ( norm(A) * 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]UPLO
          UPLO is CHARACTER*1
          = 'U':  A is upper triangular;
          = 'L':  A is lower triangular.
[in]DIAG
          DIAG is CHARACTER*1
          = 'N':  A is non-unit triangular;
          = 'U':  A is unit triangular.
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in]A
          A is DOUBLE PRECISION array, dimension (LDA,N)
          The triangular matrix A.  If UPLO = 'U', the leading N-by-N
          upper triangular part of the array A contains the upper
          triangular matrix, and the strictly lower triangular part of
          A is not referenced.  If UPLO = 'L', the leading N-by-N lower
          triangular part of the array A contains the lower triangular
          matrix, and the strictly upper triangular part of A is not
          referenced.  If DIAG = 'U', the diagonal elements of A are
          also not referenced and are assumed to be 1.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N).
[out]RCOND
          RCOND is DOUBLE PRECISION
          The reciprocal of the condition number of the matrix A,
          computed as RCOND = 1/(norm(A) * norm(inv(A))).
[out]WORK
          WORK is DOUBLE PRECISION array, dimension (3*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
December 2016

Definition at line 139 of file dtrcon.f.

139 *
140 * -- LAPACK computational routine (version 3.7.0) --
141 * -- LAPACK is a software package provided by Univ. of Tennessee, --
142 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
143 * December 2016
144 *
145 * .. Scalar Arguments ..
146  CHARACTER diag, norm, uplo
147  INTEGER info, lda, n
148  DOUBLE PRECISION rcond
149 * ..
150 * .. Array Arguments ..
151  INTEGER iwork( * )
152  DOUBLE PRECISION a( lda, * ), work( * )
153 * ..
154 *
155 * =====================================================================
156 *
157 * .. Parameters ..
158  DOUBLE PRECISION one, zero
159  parameter( one = 1.0d+0, zero = 0.0d+0 )
160 * ..
161 * .. Local Scalars ..
162  LOGICAL nounit, onenrm, upper
163  CHARACTER normin
164  INTEGER ix, kase, kase1
165  DOUBLE PRECISION ainvnm, anorm, scale, smlnum, xnorm
166 * ..
167 * .. Local Arrays ..
168  INTEGER isave( 3 )
169 * ..
170 * .. External Functions ..
171  LOGICAL lsame
172  INTEGER idamax
173  DOUBLE PRECISION dlamch, dlantr
174  EXTERNAL lsame, idamax, dlamch, dlantr
175 * ..
176 * .. External Subroutines ..
177  EXTERNAL dlacn2, dlatrs, drscl, xerbla
178 * ..
179 * .. Intrinsic Functions ..
180  INTRINSIC abs, dble, max
181 * ..
182 * .. Executable Statements ..
183 *
184 * Test the input parameters.
185 *
186  info = 0
187  upper = lsame( uplo, 'U' )
188  onenrm = norm.EQ.'1' .OR. lsame( norm, 'O' )
189  nounit = lsame( diag, 'N' )
190 *
191  IF( .NOT.onenrm .AND. .NOT.lsame( norm, 'I' ) ) THEN
192  info = -1
193  ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
194  info = -2
195  ELSE IF( .NOT.nounit .AND. .NOT.lsame( diag, 'U' ) ) THEN
196  info = -3
197  ELSE IF( n.LT.0 ) THEN
198  info = -4
199  ELSE IF( lda.LT.max( 1, n ) ) THEN
200  info = -6
201  END IF
202  IF( info.NE.0 ) THEN
203  CALL xerbla( 'DTRCON', -info )
204  RETURN
205  END IF
206 *
207 * Quick return if possible
208 *
209  IF( n.EQ.0 ) THEN
210  rcond = one
211  RETURN
212  END IF
213 *
214  rcond = zero
215  smlnum = dlamch( 'Safe minimum' )*dble( max( 1, n ) )
216 *
217 * Compute the norm of the triangular matrix A.
218 *
219  anorm = dlantr( norm, uplo, diag, n, n, a, lda, work )
220 *
221 * Continue only if ANORM > 0.
222 *
223  IF( anorm.GT.zero ) THEN
224 *
225 * Estimate the norm of the inverse of A.
226 *
227  ainvnm = zero
228  normin = 'N'
229  IF( onenrm ) THEN
230  kase1 = 1
231  ELSE
232  kase1 = 2
233  END IF
234  kase = 0
235  10 CONTINUE
236  CALL dlacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
237  IF( kase.NE.0 ) THEN
238  IF( kase.EQ.kase1 ) THEN
239 *
240 * Multiply by inv(A).
241 *
242  CALL dlatrs( uplo, 'No transpose', diag, normin, n, a,
243  $ lda, work, scale, work( 2*n+1 ), info )
244  ELSE
245 *
246 * Multiply by inv(A**T).
247 *
248  CALL dlatrs( uplo, 'Transpose', diag, normin, n, a, lda,
249  $ work, scale, work( 2*n+1 ), info )
250  END IF
251  normin = 'Y'
252 *
253 * Multiply by 1/SCALE if doing so will not cause overflow.
254 *
255  IF( scale.NE.one ) THEN
256  ix = idamax( n, work, 1 )
257  xnorm = abs( work( ix ) )
258  IF( scale.LT.xnorm*smlnum .OR. scale.EQ.zero )
259  $ GO TO 20
260  CALL drscl( n, scale, work, 1 )
261  END IF
262  GO TO 10
263  END IF
264 *
265 * Compute the estimate of the reciprocal condition number.
266 *
267  IF( ainvnm.NE.zero )
268  $ rcond = ( one / anorm ) / ainvnm
269  END IF
270 *
271  20 CONTINUE
272  RETURN
273 *
274 * End of DTRCON
275 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
integer function idamax(N, DX, INCX)
IDAMAX
Definition: idamax.f:73
subroutine dlatrs(UPLO, TRANS, DIAG, NORMIN, N, A, LDA, X, SCALE, CNORM, INFO)
DLATRS solves a triangular system of equations with the scale factor set to prevent overflow...
Definition: dlatrs.f:240
double precision function dlantr(NORM, UPLO, DIAG, M, N, A, LDA, WORK)
DLANTR returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a trapezoidal or triangular matrix.
Definition: dlantr.f:143
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:138
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine drscl(N, SA, SX, INCX)
DRSCL multiplies a vector by the reciprocal of a real scalar.
Definition: drscl.f:86
Here is the call graph for this function:
Here is the caller graph for this function: