Problems with Generic numeric type in JuMP

For type T = Float64 the following works, but it fails for either T = Float32 and T = BigFloat:

using JuMP, COSMO
m = Model( COSMO.Optimizer{T}
@variable( m, t >= zero(T) )
@objective( m, Min, t )
optimize!( m )

It also fails for Clarabel and Tulip.
Can someone tell me where Im going wrong ?

1 Like

You have to use GenericModel{T} (not Model which is an alias for GenericModel{Float64} Models · JuMP

using JuMP, COSMO
T = Float32
m = GenericModel{T}( COSMO.Optimizer{T} )
@variable( m, t >= zero(T) )
optimize!( m )

typeof(objective_value(m)) # Float32
2 Likes

See also this tutorial: Arbitrary precision arithmetic · JuMP

1 Like