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

Handle input file line endings #183

Merged
merged 14 commits into from
Oct 11, 2024

Conversation

vneiger
Copy link
Contributor

@vneiger vneiger commented Sep 27, 2024

This solves #182.

This also does minor cleaning in two functions of iofiles, the only difference in behaviour should be that get_nvars returns -1 on failure (it used to return 0).

Before merging: related to the FIXME's I put in get_data_from_file, shouldn't this function fail as soon as one of its "data retrieval" components fail?

Also, in this function, is it really necessary to allocate 1073741824 bytes (1GB) for line? I assume only a very small part of it will ever be used so it will sit mostly in virtual memory, but still... say we read line by line using getline (which is not exactly the case currently), we could simply let getline do the necessary reallocs.

@mohabsafey
Copy link
Contributor

If we go for this, could you add some tests?

@vneiger
Copy link
Contributor Author

vneiger commented Sep 30, 2024 via email

@vneiger
Copy link
Contributor Author

vneiger commented Oct 3, 2024

Let's wait for CI to complete, but up to some minor fix, but this now should work with several tests added (3 files with DOS endings ; 1 file with DOS endings + no end of line in last line). In case this can be re-used: this contains a function that tests that two data_gens_ff_t contain the same data.

@ederc
Copy link
Contributor

ederc commented Oct 11, 2024

but up to some minor fix,

@vneiger So is this ready to be merged or do we expect some fix?

@vneiger
Copy link
Contributor Author

vneiger commented Oct 11, 2024

It is ready for review. (The "up to some minor fix" was in case CI had complained, I should have made that clear.)

@ederc ederc merged commit 8a19435 into algebraic-solving:master Oct 11, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants