I get an error when I try the sample code
model = Utilities.Model{Float64}()
from this documentation: Standard form · MathOptInterface
Should the documentation instead say model = MOI.Utilities.Model{Float64}() ?
julia> model = Utilities.Model{Float64}()
ERROR: UndefVarError: Utilities not defined
Stacktrace:
[1] top-level scope
@ REPL[5]:1
julia> model = MOI.Utilities.Model{Float64}()
MOIU.Model{Float64}
Why does the code below break from Standard form · MathOptInterface ?
julia> VectorOfVariables(vcat(n, x))
ERROR: UndefVarError: VectorOfVariables not defined
Stacktrace:
[1] top-level scope
@ REPL[17]:1
If you’re trying to use MOI directly, then MOI.Utilities.Model{Float64}() is a model which stores information. It is not an optimizer than can solve the problem so the answer to your question is “you can’t.”
You’d need to use instead something like model = MOI.instantiate(HiGHS.Optimizer; with_bridge_type = Float64). You’ll also need to use MOI.optimize! instead of JuMP’s optimize!, and you need to query solutions using MOI’s MOI.get(model, MOI.VariablePrimal(), x) instead of JuMP’s value(x).