pyomo icon indicating copy to clipboard operation
pyomo copied to clipboard

Add a QuadraticExpression node

Open michaelbynum opened this issue 3 years ago • 2 comments

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:

  1. I agree my contributions are submitted under the BSD license.
  2. 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.

michaelbynum avatar Mar 04 '22 06:03 michaelbynum

Codecov Report

Merging #2329 (5c72529) into main (b48c886) will increase coverage by 0.00%. The diff coverage is 97.19%.

Impacted file tree graph

@@           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 data Powered by Codecov. Last update b48c886...5c72529. Read the comment docs.

codecov[bot] avatar Mar 04 '22 09:03 codecov[bot]

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 ?

jsiirola avatar Mar 10 '22 16:03 jsiirola

This has been added to the Archived design discussions wiki; will close for now.

mrmundt avatar Feb 16 '23 15:02 mrmundt