From f919d9f64219f7da4958c3a96d893dfff4e7c007 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 4 Oct 2020 08:53:48 -0400 Subject: [PATCH] mjo/ldlt.py: switch some row/column indexing around. --- mjo/ldlt.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mjo/ldlt.py b/mjo/ldlt.py index 9a6070d..09b3bb0 100644 --- a/mjo/ldlt.py +++ b/mjo/ldlt.py @@ -434,9 +434,9 @@ def block_ldlt(A): # right-hand corner of "A". for i in range(n-k-1): for j in range(i+1): - A[k+1+j,k+1+i] = ( A[k+1+j,k+1+i] - - A[k,k+1+j]*A[k,k+1+i]/A[k,k] ) - A[k+1+i,k+1+j] = A[k+1+j,k+1+i] # keep it symmetric! + A[k+1+i,k+1+j] = ( A[k+1+i,k+1+j] - + A[k,k+1+i]*A[k,k+1+j]/A[k,k] ) + A[k+1+j,k+1+i] = A[k+1+i,k+1+j] # keep it symmetric! for i in range(n-k-1): # Store the new (kth) column of "L" within the lower- @@ -554,8 +554,8 @@ def block_ldlt(A): # right-hand corner of "A". for i in range(n-k-2): for j in range(i+1): + A[k+2+i,k+2+j] = A[k+2+i,k+2+j] - schur_complement[i,j] A[k+2+j,k+2+i] = A[k+2+j,k+2+i] - schur_complement[j,i] - A[k+2+i,k+2+j] = A[k+2+j,k+2+i] # keep it symmetric! # The on- and above-diagonal entries of "L" will be fixed # later, so we only need to worry about the lower-left entry -- 2.44.2