Talk:LU decomposition: Difference between revisions

From Rosetta Code
Content added Content deleted
No edit summary
No edit summary
Line 6: Line 6:
[http://www.wolframalpha.com/input/?i=lu+decomposition+{{1%2C+1%2C+1%2C+1}%2C+{1%2C+1%2C+-1%2C+-1}%2C+{1%2C+-1%2C+0%2C+0}%2C+{0%2C+0%2C+1%2C+-1}}]
[http://www.wolframalpha.com/input/?i=lu+decomposition+{{1%2C+1%2C+1%2C+1}%2C+{1%2C+1%2C+-1%2C+-1}%2C+{1%2C+-1%2C+0%2C+0}%2C+{0%2C+0%2C+1%2C+-1}}]


The permutation matrix has to be updated at each step, but that will make the code a lot more complicated.
I guess the pivotization is at fault.

Revision as of 16:33, 18 November 2014

The Python example has a divide by zero error for the matrix

b = [[1, 1, 1, 1], [1, 1, -1, -1], [1, -1, 0, 0], [0, 0, 1, -1]]

although a LUP decomposition exists: [1]

The permutation matrix has to be updated at each step, but that will make the code a lot more complicated.