Add a QuadraticExpression node
Fixes #1761, #230.
Summary/Motivation:
This PR adds a QuadraticExpression node to the expression system. This PR does not add any special handling of QuadraticExpression (that can be added later as needed).
This can reduce the construction time for quadratic constraints and it allows Pyomo-based algorithms to add special handling of quadratic constraints.
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:
- I agree my contributions are submitted under the BSD license.
- I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.
Codecov Report
Merging #2329 (5c72529) into main (b48c886) will increase coverage by
0.00%. The diff coverage is97.19%.
@@ Coverage Diff @@
## main #2329 +/- ##
========================================
Coverage 85.61% 85.62%
========================================
Files 618 618
Lines 76206 76313 +107
========================================
+ Hits 65241 65340 +99
- Misses 10965 10973 +8
| Flag | Coverage Δ | |
|---|---|---|
| linux | 82.44% <97.19%> (+0.02%) |
:arrow_up: |
| osx | 72.70% <97.19%> (+0.03%) |
:arrow_up: |
| other | 82.39% <97.19%> (+0.02%) |
:arrow_up: |
| win | 79.49% <97.19%> (+0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| pyomo/core/expr/current.py | 100.00% <ø> (ø) |
|
| pyomo/repn/standard_repn.py | 88.54% <ø> (ø) |
|
| pyomo/core/expr/numeric_expr.py | 98.16% <97.00%> (-0.13%) |
:arrow_down: |
| pyomo/core/expr/compare.py | 98.87% <100.00%> (+0.09%) |
:arrow_up: |
| pyomo/common/env.py | 89.15% <0.00%> (-2.01%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update b48c886...5c72529. Read the comment docs.
I think a QuadraticExpression node can make a lot of sense. However, I wonder if this is the right data structure, or rather if the right answer is to store it as ?
This has been added to the Archived design discussions wiki; will close for now.