Skip to content

Preserve coefficient types in LP export - #3152

Merged
blegat merged 3 commits into
jump-dev:masterfrom
Kiril1Shevtsov:fix/lp-export-abstract-float
Nov 26, 2026
Merged

blegat merged 3 commits into
jump-dev:masterfrom
Kiril1Shevtsov:fix/lp-export-abstract-float

Conversation

@Kiril1Shevtsov

@Kiril1Shevtsov Kiril1Shevtsov commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

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, and BigFloat.

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, and BigFloat coefficients.

Results:

  • 507/507 LP format tests passed, including 27 new tests.
  • 21 additional independent checks passed.

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.

Kiril1Shevtsov and others added 3 commits November 24, 2026 01:44
Apply JuliaFormatter to the LP round-trip test

Wrap the quadratic-term assertion as required by JuliaFormatter. No logic changes.

@blegat blegat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, looks good to me once ci is passing.

@blegat
blegat merged commit 9db32a1 into jump-dev:master Nov 26, 2026
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants