Use MOI.Nonlinear.ModelWithQuad instead of QPBlockData - #276
Open
blegat wants to merge 4 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## bl/qp_block_data #276 +/- ##
====================================================
- Coverage 99.86% 99.16% -0.71%
====================================================
Files 2 2
Lines 755 715 -40
====================================================
- Hits 754 709 -45
- Misses 1 6 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Store the affine and quadratic objective and constraints in a MOI.Nonlinear.ModelWithQuad whose inner model is the nonlinear model, and build a single MOI.Nonlinear.EvaluatorWithQuad in optimize! that stacks the quadratic rows before the NLPBlock rows. The equality/inequality classification and the Jacobian assembly are now uniform over all rows, which removes the separate QP scatter machinery (qp_eq_pos/qp_le_pos) and the direct use of the private product functions of QPBlockData.
MOI.Nonlinear.ModelWithQuad no longer implements MOI.set for the objective; Nonlinear.set_objective is the single way to set it.
MOI.Nonlinear.ModelWithQuad now owns the variables (with indices guaranteed to be 1:n), so the variables, quad_data and nlp_model fields collapse into a single model field. A uses_nlp_block flag replaces the nlp_model !== nothing test to tell the legacy MOI.NLPBlock API apart, because optimize! overwrites nlp_data; the NLPBlock is rebuilt on every solve unless that flag is set, so that a stale objective cannot survive an objective switch.
blegat
force-pushed
the
bl/model_with_quad
branch
from
August 20, 2026 06:40
4ea0b42 to
07adb69
Compare
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.
Proof of concept refactor after