MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: LU factorization in Mathematica

  • To: mathgroup at
  • Subject: [mg20660] Re: [mg20637] LU factorization in Mathematica
  • From: Daniel Lichtblau <danl at>
  • Date: Sun, 7 Nov 1999 02:10:00 -0500
  • References: <>
  • Sender: owner-wri-mathgroup at

Peltio wrote:
> I apologise for this question but I did not find what iI was looking for
> on the Big Book.
> Any hint will be appreciated.
> LUDecomposition returns a matrix that is a combination of the L and U
> matrices. But what kind of combination?
> How can I recover the two matrices L and U?
> What is the meaning of the pivoting vector (Does P[[k]]=j means that row
> k has been swapped with row j ?)
> And what are the meaning of the elements returned by LUfactor (in the
> GaussianElimination package ), which returns a different pivot vector
> (and matrix as well)?
> Thanks in advance,
> Peltio
> peltio AT iname DOT com
> warning: Antispam return address <ON>

I quote from the Further Examples for LUDecomposition in the Help
Browser, under the subheading

"Recovering the lower and upper triangular matrices from the

"LUDecomposition satisfies the following relation: Given a matrix M,
determine a unit lower triangular matrix L, an upper triangular matrix U
and a permutation vector P such that Part[M, P] == L. U . Part[M, P]
rearranges the rows of M."

There is code provided in that section to do the extractions you want.

As for the permutation vector, P[[k]]==j means that the kth pivot row
was originally row j. But it may have moved prior to being swapped into
row k, that is, it need not have been the jth row at the time of the
pivot selection.

LUFactor is an older package function that predates the appearance of
LUDecomposition in Mathematica. The pivot vector indeed records actual
swaps at the time the pivot was chosen, so it does not represent a
permutation. LUFactor is retained primarily for pedagogical reasons
because it is tied to related arithmetic packages and hence can
effectively demonstrate e.g. LU factorization of a matrix of real

Daniel Lichtblau
Wolfram Research

  • Prev by Date: Re: Combinatorica questions!!!
  • Next by Date: Re: PolygonIntersections, MeshRange: What do they do?
  • Previous by thread: Re: LU factorization in Mathematica
  • Next by thread: "Developer Project Information" Russell Towle