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

[FileFormats.LP] fix new lines in middle of quadratic objective #2184

Merged
merged 3 commits into from
Jun 1, 2023

Conversation

odow
Copy link
Member

@odow odow commented May 31, 2023

Closes #2181

cc @inversed-ru can you try this branch? You can install it with ] add MathOptInterface#od/fix-quadratic-newlinne

@inversed-ru
Copy link

Just tested this fix on ~100 QPLIB instances and got no objective value inconsistencies. I did run into a different issue though: some instances aren't loading with "Unable to parse bound" error. For example, instance 3533 throws:
Unable to parse bound: 0.1 <= x26 <= 3.4 -0.35 <= x27 <= 0.35 -0.35 <= x28 <= 0.35

@odow
Copy link
Member Author

odow commented May 31, 2023

Ah. Now I remember the problem... let me take another attempt.

@odow
Copy link
Member Author

odow commented May 31, 2023

Try now wait a bit.

julia> model = MOI.FileFormats.LP.Model()
A .LP-file model

julia> MOI.read_from_file(model, "/Users/Oscar/Downloads/QPLIB_3533.lp")

julia> print(model)
Minimize ScalarAffineFunction{Float64}:
... lots of stuff ...

The LP file reader really needs to be re-written with an explicit tokenizer. it currently works by parsing line by line, and then we get complications when the file breaks up things over multiple lines in an inconsistent manner.

@odow odow merged commit 9019dae into master Jun 1, 2023
@odow odow deleted the od/fix-quadratic-newlinne branch June 1, 2023 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

FileFormats/LP: read_from_file returns incorrect quadratic terms
2 participants