You are on page 1of 2

www.numerical-methods.

com
Numerical Methods Library in FORTRAN


Module

SUBROUTINE LUFAC


Title


Carries out an LU factorisation of a real matrix.


Description

This is the FORTRAN source files for carrying out a LU factorisation of a
real square matrix , so that



where is a lower-triangular matrix (with diagonal elements set to 1)
and is an upper-triangular matrix and is a permutation matrix.


Interface

SUBROUTINE LUFAC(MAXN, N, A, PERM, LFAIL)
integer MAXN: the limit on the dimension of the matrix/vector
integer N: the dimension of the matrix/vector
real A: on input the nxn matrix A, on output L and U
integer PERM: an N-vector, the column index of the permutation matrix
P
logical LFAIL: returns 'true' if the method fails, otherwise 'false'

Note the output matrix A is such that the diagonal and upper-triangular
elements is the U matrix and the lower-triangular elements together
with 1s on the diagonal is the matrix U.
On exit PERM records the row exchanges that have occurred as a
result of pivoting, otherwise known as a permutation matrix P. It would
be wasteful of computer memory to store the permutation matrix as an
NxN array. P is taken to be made up of all zeros, except for P[j,i]=1
when PERM(i)=j.


Web source of
code.

http://www.numerical-methods.com/fortran/LUFAC.FOR


Web source of
this guide


www.numerical-methods.com/fortan/LUFAC_FOR.htm


Web source of
the algorithm


http://www.numerical-methods.com/lineq/LU Factorisation.htm


Dependent
routines


NONE



www.numerical-methods.com

Test problems


http://www.numerical-methods.com/fortran/LUTESTS_FOR.htm


Licence


This is open source; the software may be used and applied within other
systems as long as its provenance is appropriately acknowledged.
See the GNU Licence for more information or contact
webmaster@numerical-methods.com


Similar codes
that may be of
interest


CLUFAC, www.numerical-methods.com/fortran/CLUFAC_FOR.htm , for
complex-valued systems

LUfac.bas, www.numerical-metods.com/Excel_VBA/LU.xlsm
For the method in visual basic / VBA (Excel)


Bibilography


Linear Systems and 2x2 Matrices

www.numerical-methods.com/lineq/LU Factorisation.htm

Tutorials on Fortran77

Numerical Methods