c    @(#)elmhes.f	1.1
c
      subroutine elmhes(nm,n,low,igh,a,int)
      integer i,j,m,n,la,nm,igh,kp1,low,mm1,mp1
      real a(nm,n)
      real x,y
      integer int(igh)
      la = igh - 1
      kp1 = low + 1
      if (la .lt. kp1) go to 200
      do 180 m = kp1, la
         mm1 = m - 1
         x = 0.0
         i = m
         do 100 j = m, igh
            if (abs(a(j,mm1)) .le. abs(x)) go to 100
            x = a(j,mm1)
            i = j
  100    continue
         int(m) = i
         if (i .eq. m) go to 130
         do 110 j = mm1, n
            y = a(i,j)
            a(i,j) = a(m,j)
            a(m,j) = y
  110    continue
         do 120 j = 1, igh
            y = a(j,i)
            a(j,i) = a(j,m)
            a(j,m) = y
  120    continue
  130    if (x .eq. 0.0) go to 180
         mp1 = m + 1
         do 160 i = mp1, igh
            y = a(i,mm1)
            if (y .eq. 0.0) go to 160
            y = y / x
            a(i,mm1) = y
            do 140 j = m, n
  140       a(i,j) = a(i,j) - y * a(m,j)
            do 150 j = 1, igh
  150       a(j,m) = a(j,m) + y * a(j,i)
  160    continue
  180 continue
  200 return
      end
