
PROGRAM TEST

IMPLICIT NONE

C

INTEGER LDA, N

PARAMETER (N = 4)

PARAMETER (LDA = N)

C

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

INTEGER I, J

C

EXTERNAL DSYMV

C

C Initialize the array A to store in symmetric form the

C matrix A shown below. Initialize the arrays X and Y to

C store the vectors X and Y shown below.

C

C 1 2 3 4 2 4000

C A = 2 5 6 7 x = 2 y = 5000

C 3 6 8 9 2 6000

C 4 7 9 10 2 7000

C

DATA A / 1.0D0, 8.0D8, 8.0D8, 8.0D8,

$ 2.0D0, 5.0D0, 8.0D8, 8.0D8,

$ 3.0D0, 6.0D0, 8.0D0, 8.0D8,

$ 4.0D0, 7.0D0, 9.0D0, 1.0D1 /

DATA X / 2.0D0, 2.0D0, 2.0D0, 2.0D0 /

DATA Y / 4.0D3, 5.0D3, 6.0D3, 7.0D3 /

C

PRINT 1000

DO 10, I = 1, N

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

10 CONTINUE

PRINT 1020

PRINT 1030, (X(I), Y(I), I = 1, N)

ALPHA = 1.0D0

BETA = 0.0D0

CALL DSYMV ('UPPER TRIANGULAR A', N, ALPHA, A, LDA, X, 1,

$ BETA, Y, 1)

PRINT 1040

PRINT 1050, Y

C

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

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

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

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

1040 FORMAT (/1X, 'Ax + y:')

1050 FORMAT (3X, F6.1)

C

END

