-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to SCS 3.0 #50
Conversation
By the way, you can support the |
As in the original question there bodono/scs-python#36 (comment), I reduced the default feasibility tolerances (same as in the Python example: |
I had forgotten 😊 Yes, let's try this as well. But since there is some extra logic (adding the |
Well |
qpsolvers/solvers/scs_.py
Outdated
data["b"] = h | ||
cone["l"] = h.shape[0] # positive orthant | ||
else: # no constraint | ||
return sparse.linalg.lsqr(P, -q)[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only issue is if q
has a component in the null space of P
, in which case the problem is unbounded below, since we can set Px = 0
and q'x
to be as negative as we want. We can check this using something like:
x_star = sparse.linalg.lsqr(P, -q)[0]
if np.linalg.norm(P @ x_star + q) > 1e-9:
# return something to say this problem is unbounded
else:
return x_star
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OSQP's feasibility tolerances are indeed at When we use
(Precisely a test where the box cone would help, so we'll come back to that.) For the other ones, the returned solution is slightly beyond the current tolerance but stays in the same ballpark. This approach for CI testing of solvers has its drawbacks 😅 and it is rather designed to catch regressions. Here it would make sense to me to increase the tests' |
Ok I see, yes likely the polishing is providing the high tolerances when it succeeds. In that case it would make sense to tighten SCS tolerances to something like |
Sounds good. I tried the values below until all tests pass:
It seems we get most of the effect for The last test,
|
Follows from #50 (comment) Actually, also increase the inequality tolerance to 1e-7 for this test.
Ok, looks good! |
Thank you very much for your help on this PR 😃 |
Discussion at bodono/scs-python#36.