|
From: | Carlo de Falco |
Subject: | Re: Question about LU decomposition |
Date: | Mon, 19 Apr 2010 20:12:58 +0200 |
On 19 Apr 2010, at 15:31, forkandwait wrote:
yes but it is a dirty hack and is only (questionably) useful if you want to check theoretical results:Hi all, Let A = [2 4; 4 11]. Then the output from the lu command is L = [1 0; 1/2 1] U = [4 11; 0 -3/2] P = [0 1; 1 0]This is great... but it is different from what would be generated if thepermutation hadn't been done first, which would have been L = [1 0; 2 1] U = [2 4; 0 3]This difference wouldn't be a problem, except I am just starting to work through Gilbert Strang's "Intro to Applied Mathematics" using the computer as acrutch (^H^H learning tool), and Octave's answers don't match the book(generally because he doesn't permute the matrices). (This matrix is on p 20).I am not sure what my question is exactly, but maybe for starts: (1) is there a way to run lu() without permuting?
[l, u] = lu(sparse(A), 0); full(l) full(u) full(l*u-A)
(2) what is the long story on permuting and LU decomposition -- is it wrong to not permute? Is there a relationship between all the possible decompositions?in general it is always a good idea to use pivoting (i.e. "permuting") to improve the numerical stability of the algorithm, and it has an almost negligible cost, so avoiding pivoting never makes sense in numerics.etc etc (a link would be awesome...)
Thanks again
HTH, c.
[Prev in Thread] | Current Thread | [Next in Thread] |