Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1283

Re: LUDecomposition

From DrMajorBob <btreat1@austin.rr.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: LUDecomposition
Date 2011-03-30 09:16 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <imusch$i84$1@smc.vnet.net> (permalink)

Show all headers | View raw


(a) The outputs are NOT the same:

LUDecomposition[{{1, 2}, {3, 4}}]

{{{1, 2}, {3, -2}}, {1, 2}, 1}

LUDecomposition[{{3, 4}, {1, 2}}]

{{{1, 2}, {3, -2}}, {2, 1}, 1}

(b) Alpha IS wrong, as you say, on the second matrix.

(c) The documentation buries far down the page -- and why, one wonders???  
-- the critical info that l.u is not the original matrix, but a  
PERMUTATION of it:

m = {{1, 2}, {3, 4}};
{lu, p, c} = LUDecomposition@m
l = LowerTriangularize[lu, -1] + IdentityMatrix@2;
u = UpperTriangularize@lu;
l.u == m[[p]]

{{{1, 2}, {3, -2}}, {1, 2}, 1}

True

m = {{3, 4}, {1, 2}};
{lu, p, c} = LUDecomposition@m
l = LowerTriangularize[lu, -1] + IdentityMatrix@2;
u = UpperTriangularize@lu;
l.u == m[[p]]

{{{1, 2}, {3, -2}}, {2, 1}, 1}

True

Bobby

On Tue, 29 Mar 2011 06:58:37 -0500, Kevin <kjslag@gmail.com> wrote:

> LUDecomposition[{{1, 2}, {3, 4}}]
> and
> LUDecomposition[{{3, 4}, {1, 2}}]
> both give the same output:
> {{{1, 2}, {3, -2}}, {1, 2}, 1}
>
> Only the output for the first matrix is correct.
>
> Alpha gives the same incorrect results for the 2nd matrix
> correct 1st matrix:  
> http://www.wolframalpha.com/input/?i=LUDecomposition+{{1%2C2}%2C{3%2C4}}
> incorrect 2nd matrix:  
> http://www.wolframalpha.com/input/?i=LUDecomposition+{{3%2C4}%2C{1%2C2}}
>


-- 
DrMajorBob@yahoo.com

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: LUDecomposition DrMajorBob <btreat1@austin.rr.com> - 2011-03-30 09:16 +0000

csiph-web