Skip to content

Generic numeric type in JuMP #2025

@matbesancon

Description

@matbesancon

MOI parameterizes function and set types with the number type used to store the data, example:

julia> using JuMP
julia> MOI.LessThan(big"3.5")
MathOptInterface.LessThan{BigFloat}(3.5)

For the moment, JuMP uses and assumes Float64:

julia> @variable(m, x[1:3])
julia> @constraint(m, sum(x) <= 1//7)
x[1] + x[2] + x[3]  0.14285714285714285

Julia-native solvers should support more numeric types (see jump-dev/Convex.jl#262 (comment)), using them through JuMP would in the current state block this genericity.

From the user perspective, generic number types could allow chosen precision, Unitful.jl and others

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions