jump-dev / JuMP.jl

Modeling language for Mathematical Optimization (linear, mixed-integer, conic, semidefinite, nonlinear)
http://jump.dev/JuMP.jl/
Other
2.17k stars 390 forks source link

Coefficients of complex variables created with a GenericModel are always Float64 #3689

Closed araujoms closed 4 months ago

araujoms commented 4 months ago

MWE:

using JuMP
model = GenericModel{Float32}()
@variable(model, x in ComplexPlane())
typeof(x)
typeof(Float32(1)*x)

In contrast, the real case works as expected:

using JuMP
model = GenericModel{Float32}()
@variable(model, x)
typeof(Float64(1)*x)
typeof(BigFloat(1)*x)