MathOptInterface.jl
MathOptInterface.jl copied to clipboard
Bridge request: number type conversion
It was recently brought up on Gitter (both with @freemin7 on 29th of November, and with @chriscoey on 3rd of November).
We could define a bridge NumberConversionBridge{T,S} converting constraints with numbers of type T to S.
Then, the solver expecting constraints of type S would add MOI.NumberConversionBridge{T,S} in MOI.ListOfNonstandardBridges{T}().
This came up in https://github.com/jump-dev/MiniZinc.jl. I'd like to be able to use MiniZinc.Optimizer{Int}(MiniZinc.Chuffed()) and have all coefficients converted to Int, and throw an appropriate error if they can't be converted. That would allow JuMP to start with Float64 input data and pass to an MOI solver with a different number type.
Is there still motivation for this? I think the conclusion from https://github.com/jump-dev/JuMP.jl/pull/3191 was that we should allow JuMP to pass things other than Float64.
Yes but you could model your CP with Int and then want to use HiGHS which would want everything in Float64.