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

Blank lines aren't ignored #25

Closed
ahenshaw opened this issue Jan 2, 2024 · 10 comments · Fixed by #30
Closed

Blank lines aren't ignored #25

ahenshaw opened this issue Jan 2, 2024 · 10 comments · Fixed by #30
Labels
bug Something isn't working

Comments

@ahenshaw
Copy link
Collaborator

ahenshaw commented Jan 2, 2024

In this simple LP file

\ LP format example

Minimize
obj:  x + 10 y
Subject To
r01:  x + y  >= 1
Binaries
 x y
End

if I add a blank line before "Binaries", then the Binaries section is not read. Looking at the Pest file, it seems that blank lines aren't handled as specified in the IBM specs.

@dandxy89
Copy link
Owner

dandxy89 commented Jan 2, 2024

Thanks for all the feedback much appreciated.

I'll take a look at all three in the morning.

@ahenshaw
Copy link
Collaborator Author

ahenshaw commented Jan 2, 2024 via email

@ahenshaw
Copy link
Collaborator Author

ahenshaw commented Jan 3, 2024

I don't think this is fixed everywhere. The specific example that I gave above is fixed, but if I add the blank line after "Binaries", then it doesn't work. My understanding of the spec is that blank lines should be ignored everywhere.

@ahenshaw
Copy link
Collaborator Author

ahenshaw commented Jan 3, 2024

Also, I believe comments should be more universally allowed. In the example below, I wanted to comment out two constraints, but the parser gives this error:```

Caused by:
--> 4:1
|
4 | \ c001: - 2 x1 + 6 x2 - 3 x3 + 4 x4 + 1 x5 - 2 x6 >= 2
| ^---
|
= expected CONSTRAINT

Minimize
obj: 3x1 + 5x2 + 6x3 + 9x4 + 10x5 + 10x6
Subject To
\ c001: - 2 x1 + 6 x2 - 3 x3 + 4 x4 + 1 x5 - 2 x6 >= 2
\ c002: - 5 x1 - 3 x2 + 1 x3 + 3 x4 - 2 x5 + 1 x6 >= -2
c003: 5 x1 - 1 x2 + 4 x3 - 2 x4 + 2 x5 - 1 x6 >= 3
Binaries
x1 x2 x3 x4 x5 x6
End

@dandxy89
Copy link
Owner

dandxy89 commented Jan 3, 2024

Appreciate all the feedback. Let me take another look at this tonight.

@ahenshaw
Copy link
Collaborator Author

ahenshaw commented Jan 4, 2024

Blank lines everywhere seem to work properly. However, still can't put comments everywhere. I believe that is the last issue that I've run across. Great job on this!

@dandxy89
Copy link
Owner

dandxy89 commented Jan 4, 2024

I'm not going to have any time this evening to look into this.

Will take a look at this tomorrow

@dandxy89 dandxy89 added the bug Something isn't working label Jan 4, 2024
@dandxy89
Copy link
Owner

dandxy89 commented Jan 5, 2024

@ahenshaw, could you give it another shot? If it doesn't work out, could you share examples of what's not functioning properly?

Would you mind pointing me to the repository/project you're working on?

@ahenshaw
Copy link
Collaborator Author

ahenshaw commented Jan 5, 2024

This passes all of the tests that I have. Great job!
My repo is https://github.com/ahenshaw/balas

@dandxy89
Copy link
Owner

dandxy89 commented Jan 5, 2024

Thanks for sharing - will review it over the weekend and see if there is anything I can do in lp_parser that could assist with the work you're doing over there.

@dandxy89 dandxy89 closed this as completed Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants