Skip to content

Commit

Permalink
Fix liveness problems in _dposv
Browse files Browse the repository at this point in the history
  • Loading branch information
mdekstrand committed Aug 16, 2022
1 parent ad4d306 commit adf1a7f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lenskit/math/solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ def _dposv(A, b, lower):
# invert the meaning of 'lower' and 'trans', and the function will work fine.
# We also need to swap index orders
uplo = __uplo_U if lower else __uplo_L
n_p = __ffi.from_buffer(np.array([A.shape[0]], dtype=np.intc))
nrhs_p = __ffi.from_buffer(np.ones(1, dtype=np.intc))
narr = np.array([A.shape[0]], dtype=np.intc)
n_p = __ffi.from_buffer(narr)
nrhs = np.ones(1, dtype=np.intc)
nrhs_p = __ffi.from_buffer(nrhs)
info = np.zeros(1, dtype=np.intc)
info_p = __ffi.from_buffer(info)

Expand All @@ -52,7 +54,7 @@ def _dposv(A, b, lower):
__ffi.from_buffer(b), n_p,
info_p)

_ref_sink(n_p, nrhs_p, info, info_p)
_ref_sink(narr, n_p, nrhs, nrhs_p, info, info_p)

return info[0]

Expand Down

0 comments on commit adf1a7f

Please sign in to comment.