How to define a heuristic callback using JuMP?

We probably need to relax the signature in CPLEX.jl to accept any real number. Currently, it requires Float64: https://github.com/jump-dev/CPLEX.jl/blob/02d4ef57d143e49c158e59ea14095e84f7916dcd/src/MOI/MOI_callbacks.jl#L207

Just use

x_sol = Float64[v < 0.5 ? 0 : 1 for v in x_val]
1 Like