-
Notifications
You must be signed in to change notification settings - Fork 87
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
[FileFormats.LP] more parsing issues #2223
Comments
😞 I think I just need to rewrite the LP reader to be a proper parser... julia> import MathOptInterface as MOI
julia> io = IOBuffer("""
maximize
subject to
bounds
-infinity <= x1 <= +infinity
-10 <= x2 <= 10
0 <= x3 <= +infinity
10 <= x4 <= +infinity
end
""");
julia> model = MOI.FileFormats.Model(format = MOI.FileFormats.FORMAT_LP)
A .LP-file model
julia> read!(io, model)
julia> print(model)
Maximize ScalarAffineFunction{Float64}:
0.0
Subject to:
VariableIndex-in-GreaterThan{Float64}
x1 >= 0.0
x3 >= 0.0
x4 >= 10.0
VariableIndex-in-LessThan{Float64}
x1 <= Inf
VariableIndex-in-Interval{Float64}
x2 ∈ [-10.0, 10.0] |
To clarify, the only issue was that the lower bound of x2 was added as an interval constraint. |
Fix is here: #2225 |
Ok, makes sense! Sorry for the user error with x2. Didn’t realize |
LP files have a default lower bound of |
This is on 1.18.0:
So x1's lower bound is erroneously set to zero and upper bound isn't dropped (does that matter?), while x2's upper and lower bounds both get dropped.
Code to reproduce:
The text was updated successfully, but these errors were encountered: