
PROGRAM TEST

IMPLICIT NONE

C

INTEGER LENGTA, N

PARAMETER (N = 3)

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

C

DOUBLE PRECISION ALPHA, AP(LENGTA), X(N), Y(N)

INTEGER I

C

EXTERNAL DSPR2

C

C Initialize the array to store in packed symmetric form the

C symmetric matrix A shown below. Initialize the arrays X

C and Y to store the vectors x and y shown below.

C

C 10 20 30 1 4

C A = 20 40 50 x = 2 y = 4

C 30 50 60 3 4

C

DATA AP / 1.0D1, 2.0D1, 3.0D1, 4.0D1, 5.0D1, 6.0D1 /

DATA X / 1.0D0, 2.0D0, 3.0D0 /

DATA Y / 4.0D0, 4.0D0, 4.0D0 /

C

PRINT 1000

PRINT 1010, AP(1), AP(2), AP(4)

PRINT 1010, AP(2), AP(3), AP(5)

PRINT 1010, AP(4), AP(5), AP(6)

PRINT 1020

DO 20, I = 1, N

PRINT 1030, X(I), Y(I)

20 CONTINUE

ALPHA = 1.0D1

CALL DSPR2 ('UPPER TRIANGULAR A', N, ALPHA, X, 1, Y, 1, AP)

PRINT 1040

PRINT 1010, AP(1), AP(2), AP(4)

PRINT 1010, AP(2), AP(3), AP(5)

PRINT 1010, AP(4), AP(5), AP(6)

C

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

1010 FORMAT (1X, 3(2X, F6.1))

1020 FORMAT (/7X, 'x', 7X, 'y')

1030 FORMAT (1X, 2(2X, F6.1))

1040 FORMAT (/1X, 'A + xy'' + yx''')

C

END

