
PROGRAM TEST

IMPLICIT NONE

C

INTEGER LDA, N

PARAMETER (N = 3)

PARAMETER (LDA = N)

C

DOUBLE PRECISION A(LDA,N), ALPHA, X(N), Y(N)

INTEGER I, J

C

EXTERNAL DSYR2

C

C Initialize the array A to store in symmetric form the

C symmetric matrix A shown below. Initialize the arrays X and

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

C

C 20 10 10 1 4

C A = 10 20 10 x = 2 y = 5

C 10 10 20 3 6

C

DATA A / 20.0, 8D8, 8D8, 10.0, 20.0, 8D8, 10.0, 10.0, 20.0 /

DATA X / 1.0, 2.0, 3.0 /

DATA Y / 4.0, 5.0, 6.0 /

PRINT 1000

DO 100, I = 1, N

PRINT 1010, (A(J,I), J = 1, I), (A(I,J), J = I + 1, N)

100 CONTINUE

PRINT 1020

DO 110, I = 1, N

PRINT 1010, (A(I,J), J = 1, N)

110 CONTINUE

PRINT 1030

DO 120, I = 1, N

PRINT 1040, X(I), Y(I)

120 CONTINUE

ALPHA = 1.0D0

CALL DSYR2 ('UPPER TRIANGULAR A', N, ALPHA, X, 1, Y, 1,

$ A, LDA)

PRINT 1050

DO 130, I = 1, N

PRINT 1010, (A(J,I), J = 1, I), (A(I,J), J = I + 1, N)

130 CONTINUE

C

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

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

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

1030 FORMAT (/3X, ' x ', 2X, ' y')

1040 FORMAT (1X, 2(2X, F5.1))

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

C

END

