Obtaining variable scalar coefficients in objective

See https://github.com/jump-dev/JuMP.jl/issues/2371.

You can look in the obj.terms dictionary if affine, or the obj.aff.terms if quadratic.

PRs accepted if you have time to implement the get so this works as obj[x].

3 Likes