-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
infinity in constraints causes CPLEX LP generator to fail #364
Comments
Are you testing this on a Pyomo release or master? I suspect this might be handled on master, where we have a check when looping through constraints that looks like the following:
if (not constraint.has_lb()) and \
(not constraint.has_ub()):
assert not constraint_data.equality
continue # non-binding, so skip
Gabe
… On Feb 26, 2018, at 11:57 AM, Bryn Pickering ***@***.***> wrote:
If I have a constraint that happens to set an upper bound as infinity (i.e. np.inf), it passes 'inf' into the pyomo LP file, not '+inf'. As a result, CPLEX/GLPK doesn't read it as infinity, but as a string.
'inf' -> '+inf' already exists for decision variable upper/lower bounds (cpxlp.py:856), but not for RHS of constraints.
I realise that these constraints are redundant, given that infinity == no constraint, but want to be able to chuck in information without worrying about that. Redundant constraints will come out in the wash anyway!
If it's an easy fix, happy to do it, but I can't really find where the constraints are converted to the correct LP format in the Pyomo source code...
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#364>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ACM5ZonlrTjRScYLlqGWp1f4ZSYLHvlGks5tYuJugaJpZM4STkuK>.
|
release, I'll give it a go on master! |
That's done the trick. Have you got a timeline for the next release of Pyomo? Need to check if it fits with our next release timeline to make sure we're not relying on unreleased functionality to make some parts of our code work. |
Will keep an eye out. Good luck & thanks for the rapid responses! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I have a constraint that happens to set an upper bound as infinity (i.e. np.inf), it passes 'inf' into the pyomo LP file, not '+inf'. As a result, CPLEX/GLPK doesn't read it as infinity, but as a string.
Error:
CPLEX Error 1615: Line 10452: Expected number, found 'i'.
i.e. it's just seeing the first letter of 'inf' and failing'inf' -> '+inf' already exists for decision variable upper/lower bounds (cpxlp.py:856), but not for RHS of constraints.
I realise that these constraints are redundant, given that infinity == no constraint, but want to be able to chuck in information without worrying about that. Redundant constraints will come out in the wash anyway!
If it's an easy fix, happy to do it, but I can't really find where the constraints are converted to the correct LP format in the Pyomo source code...
The text was updated successfully, but these errors were encountered: