Skip to content
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

Error solving QPSUT03 problem #5

Closed
lvjonok opened this issue Sep 13, 2024 · 2 comments
Closed

Error solving QPSUT03 problem #5

lvjonok opened this issue Sep 13, 2024 · 2 comments

Comments

@lvjonok
Copy link
Contributor

lvjonok commented Sep 13, 2024

Hello! I face issue solving the following test problem with qpax solver.

Here is a script to reproduce:

import jax.numpy as np

from qpax import solve_qp

# Defining the problem data using JAX numpy arrays
P = np.array([[122.0, 59.0, 39.0, 9.0], [59.0, 95.0, 48.0, 24.0], [39.0, 48.0, 26.0, 19.0], [9.0, 24.0, 19.0, 90.0]])

q = np.array([66.0, 93.0, 47.0, 11.0])

# No equality constraints
A = np.array([]).reshape(0, 4)  # No equality constraint matrix
b = np.array([])  # No equality constraint vector

G = np.array(
    [
        [-1.0, -0.0, -0.0, -0.0],
        [-0.0, -1.0, -0.0, -0.0],
        [-0.0, -0.0, -1.0, -0.0],
        [-0.0, -0.0, -0.0, -1.0],
        [1.0, 0.0, 0.0, 0.0],
        [0.0, 1.0, 0.0, 0.0],
        [0.0, 0.0, 1.0, 0.0],
        [0.0, 0.0, 0.0, 1.0],
    ]
)

h = np.array([np.inf, 0.4, np.inf, 1.0, np.inf, np.inf, 0.5, 1.0])

# Solving the QP
x = solve_qp(P, q, A, b, G, h)[0]

# Check that answer is not nan
assert not np.isnan(
    x
).any(), "Solution contains NaN values, expected [0.18143455,  0.00843864, -2.35442995,  0.35443034]"
@kevin-tracy
Copy link
Owner

Same issue as #4

@kevin-tracy
Copy link
Owner

Fixed with 2cbd04e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants