Thank you very much @odow and @jd-foster ! These are exactly what I was looking for!
Additionally, is there a way to do the following?
Say the model after presolve is:
variables: x[1:100], y[1:100, 1:50]
min x[1]+x[2]-6*y[1,2]
s.t. x[1]-2*x[3]+y[1,2] <= 1
...other constraints...
Can I get the coefficients and the corresponding variable indices in the constraints and objective? Also can I know if that constraint is <=, >= or ==? I would like get these in Julia vectors, matrices, dictionaries, or anything, but not as JuMP objects, so that I can play with them without JuMP.
In my example, for the constraint x[1]-2*x[3]+y[1,2] <= 1
this would be something like
LHS = [1;-2;1],
RHS = [1],
var = [x[1];x[3];y[1,2]],
constraint_sense = ["<="]
and similar for the objective function.
And if I have nonlinear constraints (or objective), like x[1]-5*x[3]*y[1,2] +x[4]<= 1
, can I have
LHS = [1;-5;1],
RHS = [1],
var = [x[1]; x[3]*y[1,2]; x[4]],
constraint_sense = ["<="]
Anything that can achieve something like this would be great!
Thanks!