-
Notifications
You must be signed in to change notification settings - Fork 93
[FileFormats.LP] write a proper recursive descent parser #2840
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
Conversation
c3: 2 x2 + 3 x4 <= 25 | ||
bounds | ||
0 <= x1 <= +infinity | ||
0 >= x2 <= 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now throws "Upper bound already set" which seems okay
@@ -1,13 +0,0 @@ | |||
\ File: lo1.lp | |||
maximize | |||
obj: 3 x1 + + x2 + 5 x3 + x4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can handle + +
now
obj: 3 x1 + x2 + 5 x3 + x4 | ||
subject to | ||
c1: 3 x1 + x2 + 2 x3 = 30 | ||
c2: 2 x1 + x2 + - 3 x3 + x4 >= 15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can handle + -
now
@@ -513,7 +510,7 @@ function test_read_model1_tricky() | |||
@test occursin("CON4: 1 V5 + 1 V6 + 1 V7 <= 1", file) | |||
@test occursin("CON1: 1 V1 >= 0", file) | |||
@test occursin("CON5: [ 1 Var4 ^ 2 - 1.2 V5 * V1 ] <= 0", file) | |||
@test occursin("R1: 1 V2 >= 2", file) | |||
@test occursin("1 V2 >= 2", file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The decision to arbitrarily give the constraint a name was ... suspect. If the user didn't provide a name. We don't need to add one.
At this point, I'm kind of over-engineering this. But LP files are finicky enough that having good error messages is a nice quality of life improvement.
|
I still need to do indicator constraints.
Closes #2836
Closes #2351