-
Notifications
You must be signed in to change notification settings - Fork 42
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
is_sense parsing error when <
at position 1023 in a constraint line
#144
Comments
As other solvers seem to allow any length line, I suppose we ought to
fix. Will see how easy it is to fix in a reasonably elegant way.
John Forrest
…On 17/02/2021 16:04, David Laehnemann wrote:
I've been tripped up by a very weird bug, that led to a line parsing
failure and then down the line to renamed variables, so that I could not
use the eventual solution. Here's the minimal example to reproduce the
problem (simply rename to the extension |'.lp|, GitHub doesn't allow
uploads with that extension...):
buffer_size_issue.txt
<https://github.com/coin-or/CoinUtils/files/5996907/buffer_size_issue.txt>
When running |cbc buffer_size_issue.lp solve| on it, it throws:
|Welcome to the CBC MILP Solver Version: 2.10.5 Build Date: Dec 8 2020
command line - cbc weird_corner_case.lp solve (default strategy 1) ###
ERROR: CoinLpIO: is_sense(): string: < CoinLpIO::readLp(): Maximization
problem reformulated as minimization ### CoinLpIO::is_invalid_name():
Name < contains illegal character '<' ### CoinLpIO::are_invalid_names():
Invalid name: vnames[63]: < ### CoinLpIO::readLp(): Invalid column names
Now using default column names. |
As deleting any single char in the |c6708:| line makes this error go
away, and the |<| char (from |<=|) is in position 1023 of the line, and
the buffer size for parsing is 1024, I am assuming it is something to do
with this combination chopping up the |<=| and then |is_sense|
complaining that there's only the |<| and no |=| following it in the
buffer. I guess this special requires explicit handling in is_sense and
maybe elsewhere, as well?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#144>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWJYHAXO6GSNZEDXSUSNGDS7PSKNANCNFSM4XYTUD7Q>.
|
dlaehnemann
added a commit
to dlaehnemann/rust-lp-modeler
that referenced
this issue
Feb 17, 2021
David,
Hopefully fixed in master.
I think the code should now cope with lines of any length and give the
correct line number. I am not very familiar with code, so have not
tried to redo error messages entirely. I agree that some error messags
are not obviously easy to decode - this partly because the format is so
flexible. So to test error handling I added a random ++. This was only
picked up as error at very end when the code said + was an invalid name
- because it had taken the first + as part of equation. It found the
error and fixing everything may not be worthwhile.
John Forrest
…On 17/02/2021 16:04, David Laehnemann wrote:
I've been tripped up by a very weird bug, that led to a line parsing
failure and then down the line to renamed variables, so that I could not
use the eventual solution. Here's the minimal example to reproduce the
problem (simply rename to the extension |'.lp|, GitHub doesn't allow
uploads with that extension...):
buffer_size_issue.txt
<https://github.com/coin-or/CoinUtils/files/5996907/buffer_size_issue.txt>
When running |cbc buffer_size_issue.lp solve| on it, it throws:
|Welcome to the CBC MILP Solver Version: 2.10.5 Build Date: Dec 8 2020
command line - cbc weird_corner_case.lp solve (default strategy 1) ###
ERROR: CoinLpIO: is_sense(): string: < CoinLpIO::readLp(): Maximization
problem reformulated as minimization ### CoinLpIO::is_invalid_name():
Name < contains illegal character '<' ### CoinLpIO::are_invalid_names():
Invalid name: vnames[63]: < ### CoinLpIO::readLp(): Invalid column names
Now using default column names. |
As deleting any single char in the |c6708:| line makes this error go
away, and the |<| char (from |<=|) is in position 1023 of the line, and
the buffer size for parsing is 1024, I am assuming it is something to do
with this combination chopping up the |<=| and then |is_sense|
complaining that there's only the |<| and no |=| following it in the
buffer. I guess this special requires explicit handling in is_sense and
maybe elsewhere, as well?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#144>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWJYHAXO6GSNZEDXSUSNGDS7PSKNANCNFSM4XYTUD7Q>.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've been tripped up by a very weird bug, that led to a line parsing failure and then down the line to renamed variables, so that I could not use the eventual solution. Here's the minimal example to reproduce the problem (simply rename to the extension
'.lp
, GitHub doesn't allow uploads with that extension...):buffer_size_issue.txt
When running
cbc buffer_size_issue.lp solve
on it, it throws:As deleting any single char in the
c6708:
line makes this error go away, and the<
char (from<=
) is in position 1023 of the line, and the buffer size for parsing is 1024, I am assuming it is something to do with this combination chopping up the<=
and thenis_sense
complaining that there's only the<
and no=
following it in the buffer. I guess this special requires explicit handling in is_sense and maybe elsewhere, as well?The text was updated successfully, but these errors were encountered: