ztrco(l) — SunSoft Performance Library
NAME
ztrco - estimate the condition number of a triangular matrix A. It is typical to follow a call to xTRCO with a call to xTRSL to solve Ax = b or to xTRDI to compute the determinant and inverse of A.
SYNOPSIS
CALL DTRCO (DA, LDA, N, DRCOND, DWORK, JOB)
CALL STRCO (SA, LDA, N, SRCOND, SWORK, JOB)
CALL ZTRCO (ZA, LDA, N, DRCOND, ZWORK, JOB)
CALL CTRCO (CA, LDA, N, SRCOND, CWORK, JOB)
ARGUMENTS
xAMatrix A.
LDALeading dimension of the array A as specified in a dimension or type statement. LDA >= max(1,N).
NOrder of the matrix A. N >= 0.
xRCONDOn exit, an estimate of the reciprocal condition number of A.
0.0 <= RCOND <= 1.0. As the value of RCOND gets smaller, operations with A such as solving Ax = b may become less stable. If RCOND satisfies RCOND + 1.0 = 1.0 then A may be singular to working precision.
xWORKScratch array with a dimension of N.
JOBIf JOB = 0, then A is lower triangular; otherwise A is upper
triangular.
SAMPLE PROGRAM
PROGRAM TEST
IMPLICIT NONE
C
INTEGER ILOWER, LDA, N
PARAMETER (ILOWER = 0)
PARAMETER (N = 5)
PARAMETER (LDA = N)
C
DOUBLE PRECISION A(LDA,N), RCOND, WORK(N)
INTEGER ICOL, IROW, JOB
C
EXTERNAL DTRCO
C
C Initialize the array A to store the 5x5 triangular matrix A
C shown below.
C
C 1
C 1 1
C A = 1 1 1
C 1 1 1 1
C 1 1 1 1 1
C
DATA A / 5∗1.0D0, 8D8, 4∗1.0D0, 2∗8D8, 3∗1.0D0, 3∗8D8,
$ 2∗1.0D0, 4∗8D8, 1.0D0 /
C
C Print the initial values of the arrays.
C
PRINT 1000
DO 100, IROW = 1, N
PRINT 1010, (A(IROW,ICOL), ICOL = 1, IROW)
100 CONTINUE
PRINT 1020
PRINT 1010, ((A(IROW,ICOL), ICOL = 1, N), IROW = 1, LDA)
C
C Estimate the condition number of the matrix.
C
JOB = ILOWER
CALL DTRCO (A, LDA, N, RCOND, WORK, JOB)
PRINT 1030, RCOND
C
1000 FORMAT (1X, ’A in full form:’)
1010 FORMAT (5(3X, F4.1))
1020 FORMAT (/1X, ’A in triangular form: (∗ in unused elements)’)
1030 FORMAT (/1X, ’Reciprocal of the condition number:’, F4.1)
C
END
SAMPLE OUTPUT
A in full form:
1.0
1.0 1.0
1.0 1.0 1.0
1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0
A in triangular form: (∗ in unused elements)
1.0 ∗∗∗∗ ∗∗∗∗ ∗∗∗∗ ∗∗∗∗
1.0 1.0 ∗∗∗∗ ∗∗∗∗ ∗∗∗∗
1.0 1.0 1.0 ∗∗∗∗ ∗∗∗∗
1.0 1.0 1.0 1.0 ∗∗∗∗
1.0 1.0 1.0 1.0 1.0
Reciprocal of the condition number: 0.1
SunSoft, Inc. — Last change: 27 Jun 1995