Skip to content

Use MOI.Nonlinear.ModelWithQuad instead of QPBlockData - #276

Open
blegat wants to merge 4 commits into
bl/qp_block_datafrom
bl/model_with_quad
Open

Use MOI.Nonlinear.ModelWithQuad instead of QPBlockData#276
blegat wants to merge 4 commits into
bl/qp_block_datafrom
bl/model_with_quad

Conversation

@blegat

@blegat blegat commented Aug 19, 2026

Copy link
Copy Markdown
Member

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.64706% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.16%. Comparing base (741c469) to head (07adb69).

Files with missing lines Patch % Lines
ext/NLoptMathOptInterfaceExt.jl 97.64% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

blegat added 4 commits August 20, 2026 08:40
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
blegat force-pushed the bl/model_with_quad branch from 4ea0b42 to 07adb69 Compare August 20, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant