Skip to content

Commit

Permalink
Add lu diff_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bamos committed Nov 28, 2019
1 parent 0a28ed9 commit 7004b69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,9 @@ def adjoint_derivative(self, dx=None, dy_u=None, dy_l=None,
d_sol = np.concatenate([dx, dy_u, dy_l])

if diff_mode == 'lsqr':

r_sol = - sla.lsqr(self._derivative_cache['M'].T, d_sol)[0]

elif diff_mode == 'lu':
r_sol = - sla.spsolve(self._derivative_cache['M'].T, d_sol)
elif diff_mode == 'qr':
# TODO: Add something like https://github.com/oxfordcontrol/osqpth/pull/5
# but use slack variables too
Expand Down

0 comments on commit 7004b69

Please sign in to comment.