If a group of variables has been defined within certain bounds, then it is not possible to fix the value of one of them. In many applications, it is valuable to create a group of variables over a set and then be able to fix only of them.
This code will reproduce the error on Master
m = Model()
@variable(m, 0.0 <= x[1:2] <= 10.0)
JuMP.fix(x[1],0.0)
AssertionError: !(has_upper_bound(v)) && !(has_lower_bound(v))
Stacktrace:
[1] fix(::VariableRef, ::Float64) at /Users/jdlara/.julia/packages/JuMP/aU7VH/src/variables.jl:407
[2] top-level scope at In[50]:3
What would you expect to happen if you called JuMP.unfix(x[1])? Should it revert to it's bounds?
I haven't thought about the reverse operation; it seems that reverting to the original bounds would be a nice thing but is cumbersome if it requires to keep in memory what the original binding was.
In my opinion, If a user needs to unfree the variable, then it can easily redefine the bounds and having the variable be free is enough
Maybe we want a JuMP.force_fix to remove bounds (if any) and then fix?
And of course a better error message for JuMP.fix when bounds are present.
JuMP.fix(x, 1; force = true)