|
PROGRAM TEST
|
IMPLICIT NONE
|
C
|
REAL RZERO
|
COMPLEX ONE
|
INTEGER LENGTA, N
|
PARAMETER (N = 3)
|
PARAMETER (LENGTA = (N * N + N) / 2)
|
PARAMETER (ONE = (1.0E0,0.0E0))
|
PARAMETER (RZERO = 0.0E0)
|
C
|
COMPLEX AP(LENGTA), ONE, X(N)
|
REAL RZERO
|
INTEGER I
|
C
|
EXTERNAL CHPR
|
INTRINSIC CMPLX, CONJG, REAL
|
C
|
C Initialize the array A to store in packed Hermitian form
|
C the matrix A shown below. Initialize the array X to
|
C store the vector x shown below.
|
C
|
C 1+0i 2-3i 4-5i 2-2i
|
C A = 2+3i 6+0i 7-8i x = 2-2i
|
C 4+5i 7+8i 9+0i 2-2i
|
C
|
DATA AP / (1.0,8E8), (2.0,3.0), (4.0,5.0), (6.0,8E8),
|
$ (7.0,8.0), (9.0,8E8) /
|
DATA X / (2.0,-2.0), (2.0,-2.0), (2.0,-2.0) /
|
C
|
PRINT 1000
|
PRINT 1010, REAL (AP(1)), RZERO, CONJG (AP(2)),
|
$ CONJG (AP(3))
|
PRINT 1010, AP(2), REAL (AP(4)), RZERO, CONJG (AP(5))
|
PRINT 1010, AP(3), AP(5), REAL (AP(6)), RZERO
|
PRINT 1020
|
PRINT 1030, (X(I), I = 1, N)
|
CALL CHPR ('LOWER TRIANGULAR A', N, ONE, X, 1, AP)
|
PRINT 1040
|
PRINT 1010, AP(1), CONJG (AP(2)), CONJG (AP(3))
|
PRINT 1010, AP(2), AP(4), CONJG (AP(5))
|
PRINT 1010, AP(3), AP(5), AP(6)
|
C
|
1000 FORMAT (1X, 'A in full form:')
|
1010 FORMAT (1X, 3(2X, '(', F5.1, ',', F5.1, ')'))
|
1020 FORMAT (/1X, 'x:')
|
1030 FORMAT (3X, '(', F5.1, ',', F5.1, ')')
|
1040 FORMAT (/1X, 'Axx'':')
|
END
|
|