
PROGRAM TEST

IMPLICIT NONE

C

DOUBLE PRECISION ONE

INTEGER LENGTA, N

PARAMETER (N = 4)

PARAMETER (LENGTA = (N * N + N) / 2)

PARAMETER (ONE = 1.0D0)

C

DOUBLE PRECISION AP(LENGTA), B(N)

INTEGER I

EXTERNAL DTPSV

C

C Initialize the array AP to store in packed triangular form

C the unit diagonal triangular matrix A shown below.

C Initialize the array B to store the vector b shown below.

C

C 1.0 8.0

C A = 2.0 1.0 b = 25.0

C 3.0 5.0 1.0 79.0

C 4.0 6.0 7.0 1.0 167.0

C

DATA AP / 8D8, 2.0D0, 3.0D0, 4.0D0, 8D8, 5.0D0,

$ 6.0D0, 8D8, 7.0D0, 1.0D0 /

DATA B / 8.0D0, 2.5D1, 7.9D1, 1.67D2 /

C

PRINT 1000

PRINT 1010, ONE

PRINT 1010, AP(2), ONE

PRINT 1010, AP(3), AP(6), ONE

PRINT 1010, AP(4), AP(7), AP(9), ONE

PRINT 1020

PRINT 1030, (AP(I), I = 1, LENGTA)

PRINT 1040

PRINT 1050, (B(I), I = 1, N)

CALL DTPSV ('LOWER TRIANGULAR A', 'NOT TRANSPOSED A',

$ 'UNIT DIAGONAL A', N, AP, B, 1)

PRINT 1060

PRINT 1050, (B(I), I = 1, N)

C

1000 FORMAT (1X, 'A in full form:')

1010 FORMAT (1X, 4(2X, F5.1))

1020 FORMAT (/1X, 'A in packed form: (* in unused elements)')

1030 FORMAT (1X, 9(2X, F5.1))

1040 FORMAT (/1X, 'b:')

1050 FORMAT (3X, F5.1)

1060 FORMAT (/1X, 'A**(1) * b:')

C

END

