Closed kibaekkim closed 4 years ago
Real
is not an AbstractJuMPScalar
as it does not corresponds to any MOI scalar function.
We should rather do as in https://github.com/JuliaOpt/JuMP.jl/pull/2247
Real
is not anAbstractJuMPScalar
as it does not corresponds to any MOI scalar function. We should rather do as in jump-dev/JuMP.jl#2247
@blegat Can you elaborate a bit more about your suggestion? Is this comment on https://github.com/StructJuMP/StructJuMP.jl/pull/80/commits/b25afc99ea311bc79536a6be6923c1190ef06185? My fix was base on https://github.com/jump-dev/JuMP.jl/blob/release-0.21/src/objective.jl#L107-L114
Add a method
function JuMP.set_objective_function(m::StructuredModel, f::Real)
JuMP.set_objective_function(m, convert(AffExpr, f))
end
It should work once https://github.com/jump-dev/JuMP.jl/pull/2247 is merged. We should do a patch release of JuMP including this PR soon so that won't block this PR for long
@blegat can you check if the changes are compatible to the PR?
Add in Project.toml
that we require at least JuMP v0.21.3
@blegat any other concerns or suggestions?
It is strange that
Real <: AbstractJuMPScalar
returnsfalse
. This could have been addressed inJuMP
. But, this commit would resolve that.