-
-
Notifications
You must be signed in to change notification settings - Fork 411
Closed
Description
If you solve a problem, modify it, then query a solution, the result is undefined behavior.
We've had a few bites at this:
- Querying after modifying is undefined behaviour #2076
- Issues when fixing variable value using CPLEX #2400
- [docs] Clarify modify-then-query warning #2401
The docs currently say

but the warning is buried in the documentation and it keeps tripping people up.
I would propose we add a flag to check this at the JuMP level and throw OptimizeNotCalled. Asking every low-level solver to do so seems like too much work, and some solvers are fine with it.
The other option is to do it at the CachingOptimizer level.