Quadratic programming solver. Solves problems with the following form:
Where
import numpy as np
from qp import *
# Problem data
m = 30
n = 40
Q = np.random.randn(n, n)
Q = Q.T @ Q
c = np.random.randn(n)
# Two constraints. Variables sum up to 1, and x[0] is equal to 0.1.
a1 = np.ones(n)
a2 = np.zeros(n)
a2[0] = 1
A = np.vstack((a1, a2))
b = np.array([1, 0.1])
# Generate an instance of the solver
problem = QP(c, Q, A, b, verbose=True)
x, f = problem.solve()
print("Decision variables:", x)
print("Objective function value:", f)
[DONE] Implement solver for CPU
[DONE] Handle exceptions
[DONE] Output formatting
[DONE] README.md
[x] Add CUDA support
Implementation is based on the work by Jacek Gondzio: Interior Point Methods 25 Years Later