Fix/dense box i scaled not reset on keep - #477
Open
FranekStark wants to merge 2 commits into
Open
Conversation
i_scaled is the only scaled quantity that dense::setup does not refresh from the unscaled model before scaling, so the branch of scale_qp_in_place which reuses the existing equilibration has to reset it. Otherwise it is multiplied by delta again at every update performed with update_preconditioner = false, and the box multipliers are returned scaled by the accumulated factor.
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.
Problem
In the dense backend with box constraints,
update(..., update_preconditioner = false)(the default since #250) returns box multipliers scaled by a factor which compounds on every call. Re-solving an unchanged model gives a growing dual error whileresults.info.statusstaysPROXQP_SOLVED. The primal solution is unaffected, so the error is invisible unless the stationarity residual is checked explicitly.The exact multipliers are
z = (2, 200):z(1)follows200 / 0.991046^k, i.e. the returned multiplier is the true one divided by theaccumulated
i_scaleddrift.Cause
dense/preconditioner/ruiz.hpp,scale_qp_in_place: the branch taken whenexecute_preconditioner == falsescalesi_scaledwithout resetting it first, while thetruebranch resets it viai_scaled.setOnes().i_scaledis also the only scaled quantity thatdense/helpers.hpp::setupdoes not refresh before scaling. The matrices/vectorsH_scaled,g_scaled,A_scaled,b_scaled,C_scaled,l/u_scaledandl/u_box_scaledare all re-copied from the unscaledqpmodelon every update, so they start clean.i_scaledhas no counterpart in the model to be copied from, and so carries the previous scaling into the next one.After
kupdates it holds(delta.head * delta.tail)^kinstead ofdelta.head * delta.tail.