I am modeling an LP in JuMP using Gurobi. How can I obtain the optimal simplex tableau?
For example, consider the below LP:
A = [1; 2; 3]'
c = [4; 5; 6]
b = 7
M = Model(Gurobi.Optimizer)
set_optimizer_attribute(M, "Presolve", 0)
set_optimizer_attribute(M, "Method", 2)
@variable(M, x[1:3])
@objective(M, Min, c' * x)
@constraint(M, A * x >= b)
@constraint(M, x .>= 0)
optimize!(M)
value.(x)
and I have tried
y = zeros(3)
m = backend(M)
julia> Gurobi.GRBBinvRowi(m,1,y)
ERROR: MethodError: no method matching unsafe_convert(::Type{Ptr{Nothing}}, ::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{Gurobi.Optimizer}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}})
Closest candidates are:
unsafe_convert(::Union{Type{Ptr{Nothing}}, Type{Ptr{Base.Libc.FILE}}}, ::Base.Libc.FILE) at libc.jl:94
unsafe_convert(::Type{Ptr{T}}, ::Base.RefValue{SA}) where {S, T, D, L, SA<:StaticArrays.SArray{S, T, D, L}} at /Users/.julia/packages/StaticArrays/12k3X/src/SArray.jl:125
unsafe_convert(::Type{Ptr{T}}, ::Base.RefValue{FA}) where {N, T, D, FA<:StaticArrays.FieldArray{N, T, D}} at /Users/.julia/packages/StaticArrays/12k3X/src/FieldArray.jl:124
...
Stacktrace:
[1] GRBBinvRowi(model::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{Gurobi.Optimizer}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, i::Int64, x::Float64)
@ Gurobi ~/.julia/packages/Gurobi/WjZv8/src/gen91/libgrb_api.jl:594
[2] top-level scope
@ REPL[27]:1
It’s not clear to me how to update internalModel
from here.