Jump to content

LU decomposition: Difference between revisions

m
Fixed a small error in the pivotize code: initially would keep a zero on the main diagonal in favor of a negative number
(Initial PL/I version)
m (Fixed a small error in the pivotize code: initially would keep a zero on the main diagonal in favor of a negative number)
Line 1,676:
ID = [[float(i == j) for i in xrange(n)] for j in xrange(n)]
for j in xrange(n):
row = max(xrange(j, n), key=lambda i: abs(m[i][j]))
if j != row:
ID[j], ID[row] = ID[row], ID[j]
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.