Conversation
Collaborator
Author
|
Of course it had to fail on mac now. PS: Changed to open in binary mode only if windows. |
- fixes reading compressed input on windows by avoiding trouble with end-of-line conversions, see zstr/issues#15 - the lp+mps readers can handle \r in lines, fortunately
4f3bb32 to
c78f01d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sorry that things come in small pieces.
I had problems reading compressed input on Windows with zstr. (There was an exception from
std::stringthrown.)Turned out that this is due to mateidavid/zstr#15, i.e., not opening the input stream as binary. On Windows, there are some conversions of carriage-return (
\r) happening in that case that cause trouble.This PR changes the zstr library to always open the input stream in binary form.
As far as I understand zstr/issues#15, this means that
\rin the input are not converted away.Fortunately, your LP and MPS readers seem to handle this case:
\r, becauseisspace('\r')is true: https://github.com/ERGO-Code/HiGHS/blob/master/src/io/HMPSIO.cpp#L474-L484trim()function to remove white-space, which includes\r: https://github.com/ERGO-Code/HiGHS/blob/master/src/util/stringutil.h#L27\r: https://github.com/ERGO-Code/HiGHS/blob/master/extern/filereaderlp/reader.cpp#L898-L900