X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;ds=sidebyside;f=mjo%2Fldlt.py;h=09b3bb008263281e9cc787764972bb14d40392e4;hb=f919d9f64219f7da4958c3a96d893dfff4e7c007;hp=9a6070d1fadf7e66663336cd35af96b8adf2d30e;hpb=c3ce78725469fb9d75d7c1d74b33bf1d65eea9cc;p=sage.d.git 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