Repository navigation
Preserve coefficient types in LP export - #3152
Open
Kiril1Shevtsov wants to merge 1 commit into
Open
Kiril1Shevtsov wants to merge 1 commit into
Kiril1Shevtsov wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Summary
Fix LP file writing to support coefficient types other than
Float64.Previously, the LP writer assumed that coefficients were
Float64, which could cause problems when writing models using other floating-point types.The change removes this assumption and allows coefficients to be written using different numeric precisions, including
Float16,Float32, andBigFloat.Motivation
LP file writing should not depend on coefficients being represented specifically as
Float64. Models using other supported floating-point types should be handled correctly without requiring users to convert their coefficients beforehand.This fix addresses that limitation while keeping the change focused on LP serialization.
Testing
The updated implementation was tested with
Float16,Float32, andBigFloatcoefficients.Results:
These results cover the tested coefficient types and LP-writing behavior, rather than establishing support for every possible numeric type.
Notes
ChatGPT was used to translate this PR description into English, review the code for potential issues, suggest fixes that I subsequently verified myself, assist with writing tests, and help assess their correctness.