Temporary constraint #236
sebheger
started this conversation in
New features
Replies: 1 comment 2 replies
|
How do you see someone accidentally doing either of those things? I would argue that if the programmer starts adding things to constraints or trying to make new constraints out of existing constraints then they've well and truly lost track of what they're doing and there's really no helping them. The current implementation has traded simplicity of implementation for a slight onus on the programmer to keep track of their constraint objects, and I think that's probably a good balance. Another option might be to make a "temporary constraint" class which is a subclass of LinExpr with no modifications. That way, type checking might catch some of these issues. Although that probably wouldn't be enough. |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I would suggest introducing a temporary constraint object when setting the "equality/inequality sense" to a linear expression.
tc should be now a temporary constraint instead of a linear expression. What someone might do now:
A)
or even
B)
would - in my eyes lead - be undefined/unclear (A) or infeasible (B) operations. At the moment both operations are feasible. I would introduce separate functions to add "something" to the linear expression part (LHS) of the temporary constraint or to update the constant.
All reactions