Centralize processing of monomial terms in LinearRepn compiler#3956
Open
jsiirola wants to merge 4 commits into
Open
Centralize processing of monomial terms in LinearRepn compiler#3956jsiirola wants to merge 4 commits into
jsiirola wants to merge 4 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3956 +/- ##
=======================================
Coverage 90.10% 90.10%
=======================================
Files 908 908
Lines 108344 108325 -19
=======================================
- Hits 97620 97606 -14
+ Misses 10724 10719 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 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:
This is the first step in reworking the core monomial recording logic in the "new" (LinearRepn / QuadraticRepn) compilers. Having a single method for recording monomial terms into an already-created Repn data structure will make it easier to do custom overloads (e.g., in ParameterizedRepn walkers) and to experiment with different Repn internal data formats. It also removes "in-lined" (copy/pasted) code.
The cost of this is an extra function call when processing terms. This has a measurable, albeit small impact on the LP writer:
Changes proposed in this PR:
record_monomialmethod_before_var,_before_monomialand_before_linearmethods.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: