Please see the attached file.
Find the Doolittle LU decomposition of H5 with scaled partial pivoting.
Here are the MAPLE procedures that solve this assignment.
In the first file Gauss_Elim-final we solve the Gaussian elimination problem of the Hilbert matrices.
The main procedure there is the algorithm you supplied, so I didn't comment in the procedure itself.
The file LU-final solves the Doolittle LU decomposition problem.
Since the Doolittle algorithm results in an upper ...
This shows how to work with Hilbert matrices to solve a system of equations using Gaussian elimination and to find the Doolittle LU decomposition with scaled partial pivoting.