Skip to content

Commit

Permalink
Fix error with data ownership in cholesky
Browse files Browse the repository at this point in the history
Require that the fill-reducing permutation P of Cholesky factorizer owns its data before use. Fixes dswah#271
  • Loading branch information
craymichael authored Jan 9, 2021
1 parent b57b4cf commit 5e3f2e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pygam/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def cholesky(A, sparse=True, verbose=True):
# permutation matrix P
P = sp.sparse.lil_matrix(A.shape)
p = F.P()
# require OWNDATA = True
p = np.require(p, requirements='O')
P[np.arange(len(p)), p] = 1

# permute
Expand Down

0 comments on commit 5e3f2e1

Please sign in to comment.