It’s by design and guaranteed that when you use direct_model
, the indices of the variables in JuMP match the indices in the solver’s MOI wrapper. The solver’s MOI wrapper could add an extra level of indirection, but I don’t think CPLEX does.
Fully agreed that solver-dependent callbacks are poorly documented and incomplete at the moment. We’re lacking contributors in this area.