      subroutine matgen(a,lda,n,b)
      implicit none

*
*     -- NPAC, Syracuse University --
*     Modified Manish Parashar
*     April 1992
*
      double precision a(lda,n),b(n)
      integer lda, n, init
      integer i, j
c
      init = 1325
      do 30 j = 1,n
         do 20 i = 1,n
            init = mod(3125*init,65536)
            a(i,j) = (init - 32768.0d0)/16384.0d0
   20    continue
   30 continue
      do 35 i = 1,n
          b(i) = 0.0d0
   35 continue
      do 50 j = 1,n
         do 40 i = 1,n
            b(i) = b(i) + a(i,j)
   40    continue
   50 continue
      return
      end

