Skip to content
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

Closed
brynpickering opened this issue Feb 26, 2018 · 5 comments
Closed

infinity in constraints causes CPLEX LP generator to fail #364

brynpickering opened this issue Feb 26, 2018 · 5 comments

Comments

@brynpickering
Copy link

brynpickering commented Feb 26, 2018

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...

@ghackebeil
Copy link
Member

ghackebeil commented Feb 26, 2018 via email

@brynpickering
Copy link
Author

release, I'll give it a go on master!

@brynpickering
Copy link
Author

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.

@jsiirola
Copy link
Member

I am hoping to convince @whart222 to review PR #354 today and cut the 5.4 release tonight...

@brynpickering
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants