Model queries
There are a number of things you can query about a model after constructing it. These can be useful to check that the model was defined correctly, or in post-processing after optimization.
getminreturns the lower bounds of the variables; with an index argument, the lower bound of one variable.getmaxreturns the upper bounds of the variables; with an index argument, the upper bound of one variable.getinitreturns the initial solution.getobjectivereturns the objective function.getineqconstraintsreturns the collection of inequality constraint functions.geteqconstraintsreturns the collection of equality constraint functions.getobjectiveconstraintsreturns the objective and constraint functions together, optionally including the semidefinite constraints withsd = true.getnvarsreturns the number of variables.getnconstraintsreturns the number of constraints.
The setmin!, setmax! and setinteger! functions update the bounds and integrality constraints after construction, which is useful for iterative procedures that resolve the same model with updated bounds.