# Update the "next" block of A that we'll work on during
# the following iteration. I think it's faster to get the
# entries of a row than a column here?
- v = vector(ring, A[k,k+1:n].list())
- b = v.column()*v.row()/alpha
for i in range(n-k-1):
for j in range(i+1):
- # Something goes wrong if I try to access the kth row/column
- # of A to save the intermediate "b" here...
- A[k+1+i,k+1+j] = A[k+1+i,k+1+j] - b[i,j]
+ A[k+1+i,k+1+j] = A[k+1+i,k+1+j] - A[k,k+1+i]*A[k,k+1+j]/alpha
A[k+1+j,k+1+i] = A[k+1+i,k+1+j] # keep it symmetric!
# Store the "new" (kth) column of L.
for i in range(n-k-1):
- L[k+i+1,k] = v[i]/alpha
+ # Set the lower-left "half" from the upper-right "half"...
+ L[k+i+1,k] = A[k,k+1+i]/alpha
I = A.matrix_space().identity_matrix()
P = matrix.column( I.row(p[j]) for j in range(n) )