`Write a routine that computes the LU decomposition of a matrix
with partial pivoting.
`

`Input arguments:
`

- , a square matrix.

`Output arguments:
`

- , containing the compact storage of and ; the input value of is overwritten.
- , an integer dimensional vector, containing the pivot positions (i.e. the permutations).
- , an integer, indicating the column where a zero pivot was found (which means that the matrix is singular). if no zero pivots were found (nonsingular matrix).

`The header and the declarations of this routine should be
`

subroutine LU_Fact(A,Pivot,Ierr) implicit none ! The input matrix, at exit ! will hold the LU factorization real, dimension(:,:), intent(inout) :: A ! Vector of permutations integer, dimension(:), intent(out) :: Pivot ! Singularity indicator, = 0 if A nonsingular, ! and = column number j if the first zero ! pivot was detected in column j integer, intent(out) :: Ierr .....................................

Adrian Sandu 2001-08-26