MathOptInterface.jl icon indicating copy to clipboard operation
MathOptInterface.jl copied to clipboard

Bridge request: number type conversion

Open blegat opened this issue 3 years ago • 1 comments

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}().

blegat avatar Nov 30 '21 14:11 blegat

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.

odow avatar Jun 28 '22 21:06 odow

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.

odow avatar Feb 06 '23 20:02 odow

Yes but you could model your CP with Int and then want to use HiGHS which would want everything in Float64.

blegat avatar Feb 07 '23 15:02 blegat