From 7004b6982c2a0ab83bca3134e0c811d2c3e635bd Mon Sep 17 00:00:00 2001 From: Brandon Amos Date: Thu, 28 Nov 2019 14:23:18 -0800 Subject: [PATCH] Add lu diff_mode --- module/interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/interface.py b/module/interface.py index 10e0c633..e8a0f472 100644 --- a/module/interface.py +++ b/module/interface.py @@ -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