Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def solve(self, p):
# Convert Matrices in CSR format
p.A = p.A.tocsr()
p.P = p.P.tocsr()
# Define OSQP object
model = osqp.OSQP(**self.options)
# Define QP problem
model.problem(p.P, p.q, p.A, p.lA, p.uA)
# Solve QP with OSQP
res = model.solve()
# Return quadprogResults
return res