You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Converting disabled box bounds (i.e. coordinates at $-\infty$ for a lower or $+\infty$ for an upper bound) using the internal linear_from_box_inequalities function will result in new linear inequalities $G', h'$ where some values in $h'$ can be $\pm\infty$.
The qpSWIFT interface, for instance, does not handle this correctly, with the solver returning None (no solution) for problems that have solutions.
Reproduction steps
Here is an example reproducing this issue:
importnumpyasnpfromqpsolversimportsolve_qpM=np.array([[1.0, 2.0, 0.0], [-8.0, 3.0, 2.0], [0.0, 1.0, 1.0]])
P=np.dot(M.T, M) # this is a positive definite matrixq=np.dot(np.array([3.0, 2.0, 3.0]), M)
G=np.array([[4.0, 2.0, 0.0], [-1.0, 2.0, -1.0]])
h=np.array([np.inf, -2.0])
A=np.array([1.0, 1.0, 1.0]).reshape((1, 3))
b=np.array([1.0])
lb=np.array([-0.5, -0.4, -0.5])
ub=np.array([1.0, 1.0, 1.0])
x_cvx=solve_qp(P, q, G, h, lb=lb, ub=ub, solver="cvxopt")
print(f"CVXOPT solution: {x_cvx}")
x_scs=solve_qp(P, q, G, h, lb=lb, ub=ub, solver="scs")
print(f"SCSsolution: {x_scs}")
Outcome:
python bug_scs.py ✔ 38s
CVXOPT solution: [ 0.32941177 -0.4 0.87058824]
/home/nelson/src/qpsolvers/qpsolvers/conversions/warnings.py:35: UserWarning: Converted P to scipy.sparse.csc.csc_matrix
For best performance, build P as a scipy.sparse.csc_matrix rather than as a numpy.ndarray
warnings.warn(
/home/nelson/src/qpsolvers/qpsolvers/conversions/warnings.py:35: UserWarning: Converted G to scipy.sparse.csc.csc_matrix
For best performance, build G as a scipy.sparse.csc_matrix rather than as a numpy.ndarray
warnings.warn(
/home/nelson/src/qpsolvers/qpsolvers/solvers/scs_.py:246: UserWarning: SCS returned -6: UNBOUNDED_INACCURATE
warnings.warn(
SCSsolution: None
The text was updated successfully, but these errors were encountered:
Converting disabled box bounds (i.e. coordinates at$-\infty$ for a lower or $+\infty$ for an upper bound) using the internal $G', h'$ where some values in $h'$ can be $\pm\infty$ .
linear_from_box_inequalities
function will result in new linear inequalitiesThe qpSWIFT interface, for instance, does not handle this correctly, with the solver returning
None
(no solution) for problems that have solutions.Reproduction steps
Here is an example reproducing this issue:
Outcome:
The text was updated successfully, but these errors were encountered: