]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
mjo/ldlt.py: actually permute with the permutation matrix.
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 28 Sep 2020 15:08:37 +0000 (11:08 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 28 Sep 2020 15:08:37 +0000 (11:08 -0400)
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]