Getting problem data from jump model (semidefinite programming, etc.)

Hi everyone, after a quick search here and the API, I have not seen this question addressed to my liking so let me raise it:

  • How to get the problem data in canonical form min dot(C,x) subject to Ax=b, that is from a model return the data C,A,b? This is very similar to print(model) or write a model to file. Also I dont know if this should be a MOI question instead of JuMP.
  • How about other problems where there are canonical forms like polynomial optimization?

JuMP uses a novel standard form for representing problems, so we don’t store the problem in the canonical form min dot(C,x) subject to Ax=b. (For reasons and motivation, see: [2002.03447] MathOptInterface: a data structure for mathematical optimization problems)

We currently don’t provide tools to access the matrix data because there are a variety of different forms people could want. However, there’s a work-in-process: https://github.com/jump-dev/MatrixOptInterface.jl.

For now, you can access the constraints in the model using: Constraints · JuMP

This code should give you the general idea: JuMP.jl/lp_sensitivity2.jl at e2b6ee959c827d60f0c8178a813fddb6e21048b2 · jump-dev/JuMP.jl · GitHub
You could call it from JuMP using JuMP._standard_form_matrix, but functions beginning with _ are private, and could change in any future release so you shouldn’t rely on this.

How about other problems where there are canonical forms like polynomial optimization?

You can solve polynomial optimization problems using SumOfSquares. See this example.