      PROGRAM TESTK  
*     
*     This test program simply gererate a Hilbert-like matrix A
*     except the main diagonal elements are all 1.0s. It computes
*     on L*L**T factorization of A by calling SLLTBK, and calls
*     STRSV twice (forward and backward substitutions) to get the 
*     solution. 

      PARAMETER (LDA = 1024, COL = 1024)
      INTEGER N,INFO,NB
      REAL    A(LDA,COL), X(LDA)
      INTEGER I,J 

   10 PRINT *, 'THE MATRIX SIZE(0 FOR STOP) N(N*N) =  '
      READ *, N
      IF (N .EQ. 0) GOTO 20
      DO 14 I = 1,N
        X(I) = 1.0 
        DO 12 J = 1,I-1
            A(I,J) = 1.0 /REAL(I+J-1)
   12   CONTINUE
        A(I,I) = 1.0
   14 CONTINUE
      PRINT *, 'THE BLOCK SIZE(0 FOR NEW MATRIX) NB =  '
      READ *, NB
      IF (NB .EQ. 0) GOTO 10
      CALL SLLTBK(N,A,LDA,INFO,NB)
      CALL STRSV('Lower', 'No transpose', 'Non-unit', N, A, LDA, X, 1)
      CALL STRSV('Lower', 'Transpose', 'Non-unit', N, A, LDA, X, 1)
      PRINT *, 'The Solution is :'
      DO I = 1, N, 4
      PRINT 18,  I, I+3, X(I), X(I+1), X(I+2), X(I+3) 
   18 FORMAT ('X(' , I4, ':', I4, '): ', 4E16.7)
      END DO
      GOTO 10
   20 CONTINUE
      END 

