Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ dtrdi(3P) — Sun WorkShop 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

dtrdi(3P)

NAME

dtrdi - compute the determinant and inverse of a triangular matrix A. 

SYNOPSIS

CALL DTRDI (DA, LDA, N, DDET, JOB, INFO)

CALL STRDI (SA, LDA, N, SDET, JOB, INFO)

CALL ZTRDI (ZA, LDA, N, ZDET, JOB, INFO)

CALL CTRDI (CA, LDA, N, CDET, JOB, INFO)

void dtrdi(double ∗t, long int ldt, long int n, double ∗det,
long int job, long int ∗info)

void strdi(float ∗t, long int ldt, long int n, float ∗det,
long int job, long int ∗info)

void ztrdi(doublecomplex ∗t, long int ldt, long int n,
doublecomplex ∗det, long int job, long int ∗info)

void ctrdi(complex ∗t, long int ldt, long int n,
complex ∗det, long int job, long int ∗info)

ARGUMENTS

xAOn entry, the matrix A. 
On exit, the inverse of the original matrix A if the inverse was requested, otherwise unchanged.

LDALeading dimension of the array A as specified in a dimension
or type statement.  LDA >= max(1,N).

NOrder of the original matrix A.  N >= 0. 

xDETOn exit, the determinant of the matrix A.  The determinant is
stored as b ∗ (10 ∗∗ expon) where b is stored in DET(1) and expon is stored in DET(2).  1.0 <= |DET(1)| <= 10.0  or  DET(1) = 0.0.

JOBDetermines which operation the subroutine will perform:
010 no determinant, inverse of lower triangular A
011 no determinant, inverse of upper triangular A
100 determinant, no inverse
110 determinant, inverse of lower triangular A
111 determinant, inverse of upper triangular A

INFOOn exit:
INFO = 0Subroutine completed normally. 
INFO ∗ 0Contains the index of a zero element of A if the inverse is requested and A is singular. 

SAMPLE PROGRAM

 
      PROGRAM TEST
      IMPLICIT NONE
C
      INTEGER           INDTLO, LDA, N
      PARAMETER        (INDTLO = 110)
      PARAMETER        (N = 5)
      PARAMETER        (LDA = N)
C
      DOUBLE PRECISION  A(LDA,N), DET(2)
      INTEGER           ICOL, INFO, IROW, JOB
C
      EXTERNAL          DTRDI
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  -2  1
C         1  -3  3  -1
C         1  -4  6  -4  1
C
      DATA A / 5∗1.0D0, 8D8, -1.0D0, -2.0D0, -3.0D0, -4.0D0,
     $         2∗8D8, 1.0D0, 3.0D0, 6.0D0, 3∗8D8, -1.0D0,
     $         -4.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     Factor the matrix in banded form.
C
      JOB = INDTLO
      CALL DTRDI (A, LDA, N, DET, JOB, INFO)
      IF (INFO .EQ. 0) THEN
        PRINT 1030, DET(1) ∗ (10.0 ∗∗ DET(2))
        PRINT 1040
        DO 110, IROW = 1, N
          PRINT 1010, (A(IROW,ICOL), ICOL = 1, IROW)
  110   CONTINUE
      ELSE
        PRINT 1050, INFO
      END IF
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, ’det(A) = ’, F4.1)
 1040 FORMAT (/1X, ’A∗∗(-1):’)
 1050 FORMAT (1X, ’A appears singular at ’, I2)
C
      END

SAMPLE OUTPUT

 
 A in full form:
    1.0
    1.0   -1.0
    1.0   -2.0    1.0
    1.0   -3.0    3.0   -1.0
    1.0   -4.0    6.0   -4.0    1.0
 
 A in triangular form:  (∗ in unused elements)
    1.0   ∗∗∗∗   ∗∗∗∗   ∗∗∗∗   ∗∗∗∗
    1.0   -1.0   ∗∗∗∗   ∗∗∗∗   ∗∗∗∗
    1.0   -2.0    1.0   ∗∗∗∗   ∗∗∗∗
    1.0   -3.0    3.0   -1.0   ∗∗∗∗
    1.0   -4.0    6.0   -4.0    1.0
 
 det(A) =  1.0
 
 A∗∗(-1):
    1.0
    1.0   -1.0
    1.0   -2.0    1.0
    1.0   -3.0    3.0   -1.0
    1.0   -4.0    6.0   -4.0    1.0

Sun, Inc.  —  Last change: 20 Sep 1996

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026