How to use the osqp.osqp function in osqp

To help you get started, we’ve selected a few osqp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oxfordcontrol / osqp / quadprog / solvers / osqp_qpif.py View on Github external
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

osqp

OSQP: The Operator Splitting QP Solver

Apache-2.0
Latest version published 28 days ago

Package Health Score

79 / 100
Full package analysis