contrib.piecewise: Add special case for single-segment "piecewise" linear functions#3990
Open
emma58 wants to merge 4 commits into
Open
contrib.piecewise: Add special case for single-segment "piecewise" linear functions#3990emma58 wants to merge 4 commits into
emma58 wants to merge 4 commits into
Conversation
…-segment piecewise-linear functions
…re we will not create GDP/MIP formulations in this case. Currently is not applied to the epigraph/hypograph transformation. I'm tempted to leave that alone.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3990 +/- ##
=======================================
Coverage 90.13% 90.14%
=======================================
Files 917 917
Lines 109091 109101 +10
=======================================
+ Hits 98333 98344 +11
+ Misses 10758 10757 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes # .
Summary/Motivation:
@michaelbynum and others have observed that we don't have any way to handle the special case of piecewise-linear in which the model is just plain linear (one segment). This catches that case before all of the GDP/MIP transformations so that we don't create unnecessary Booleans/binaries in this case.
Changes proposed in this PR:
AI-Use Disclosure
or
AI tools contributed to the development of this PR
Review process (select ONE):
Notes for reviewers (optional): Note that this is completely independent of #3989: The epigraph/hypograph should not have this same handling because then it does something unexpected, which is to not return an epigraph/hypograph. So the fact that it will still redefine
_transform_pw_linear_expris good.Legal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: