]> gitweb.michael.orlitzky.com - sage.d.git/blobdiff - mjo/ldlt.py
mjo/ldlt.py: actually permute with the permutation matrix.
[sage.d.git] / mjo / ldlt.py
index 8e5f6930da7630d11704458ca14613d9aab64718..8f39198d19a2007a91667baa34f89fc72b7c73db 100644 (file)
@@ -97,6 +97,7 @@ def ldlt_naive(A):
     diags = A1.diagonal()
     s = diags.index(max(diags))
     P1 = copy(A1.matrix_space().identity_matrix())
+    P1.swap_rows(0,s)
     A1 = P1.T * A1 * P1
     alpha1 = A1[0,0]