	subroutine chk(n, a, lda, ipiv)
	implicit none
	
*
*  -- NPAC, Syracuse University --
*     Manish Parashar
*     April 1992
*

	integer n, lda
	integer ipiv(n)
	integer info, i, j, one
	real a(lda,n)
 	real tmp(lda,n)
 	real tmp2(lda,n)
 	real b(lda)
 	real x(lda)
	parameter ( one = 1 )

	a = a
	ipiv = ipiv
	tmp = tmp

        call MatGen(n, tmp, lda)

        call slapge(n, a, lda, ipiv)

        tmp = tmp - a
        print *,'Max Error = ',maxval(abs(tmp))

        return
	end
