Austin Schuh | 9049e20 | 2022-02-20 17:34:16 -0800 | [diff] [blame] | 1 | JuMP |
| 2 | ===== |
| 3 | |
| 4 | `JuMP <https://github.com/JuliaOpt/JuMP.jl>`_ supports the OSQP solver using the `MathOptInterface interface <https://github.com/JuliaOpt/MathOptInterface.jl>`_. |
| 5 | You can define a JuMP model to be solved via OSQP as follows |
| 6 | |
| 7 | |
| 8 | .. code:: julia |
| 9 | |
| 10 | # Load JuMP and OSQP |
| 11 | using JuMP, OSQP |
| 12 | |
| 13 | # Create OSQP Solver instance |
| 14 | s = OSQPMathProgBaseInterface.OSQPSolver(verbose=false) |
| 15 | |
| 16 | # Create JuMP model |
| 17 | model = Model(solver=s) |
| 18 | |
| 19 | ... |
| 20 | |
| 21 | Note that here we set the verbosity to :code:`false`. |
| 22 | After defining your model, you can solve it by just calling |
| 23 | |
| 24 | .. code:: julia |
| 25 | |
| 26 | solve(model) |
| 27 | |
| 28 | |
| 29 | For more details on how to create and modify the models, see the `JuMP Documentation <https://www.juliaopt.org/JuMP.jl/stable/>`_. |