I am interested in obtaining particular solution attributes (e.g., `DualVio`

) of my Gurobi model constructed by JuMP. Can I use the Gurobi.jl C interface to query a solved JuMP model to obtain solution quality attributes?

See GitHub - jump-dev/Gurobi.jl: Julia interface for Gurobi Optimizer

```
using JuMP, Gurobi
model = direct_model(Gurobi.Optimizer())
@variable(model, 0 <= x[1:10] <= 1)
@constraint(model, rand(10)' * x <= 3)
@objective(model, Max, rand(10)' * x)
optimize!(model)
MOI.get(model, Gurobi.ModelAttribute("DualVio"))
```

You can also use the C API:

```
using JuMP, Gurobi
model = Model(Gurobi.Optimizer)
@variable(model, 0 <= x[1:10] <= 1)
@constraint(model, rand(10)' * x <= 3)
@objective(model, Max, rand(10)' * x)
optimize!(model)
grb = unsafe_backend(model)
attrP = Ref{Cdouble}()
GRBgetdblattr(grb, "DualVio", attrP)
attrP[]
```

2 Likes

Thanks! Sorry, I missed that in the readme!