Skip to content

Commit

Permalink
Clean up unbounded linear inequalities
Browse files Browse the repository at this point in the history
Fixes #19
  • Loading branch information
stephane-caron committed Nov 11, 2022
1 parent 9a9f5c8 commit 8d27670
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions qpsolvers_benchmark/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ def from_double_sided_ineq(P, q, C, l, u, lb, ub, name: str, r: float):
ineq_rows = np.where(np.logical_not(bounds_are_equal))
G = spa.vstack([C[ineq_rows], -C[ineq_rows]], format="csc")
h = np.hstack([u[ineq_rows], -l[ineq_rows]])
h_finite = h < np.inf
if not h_finite.all():
G = G[h_finite]
h = h[h_finite]

return Problem(P, q, G, h, A, b, lb, ub, name=name, r=r)

Expand Down

0 comments on commit 8d27670

Please sign in to comment.