Closed blegat closed 1 month ago
Still the same problem: https://github.com/jump-dev/MathOptInterface.jl/actions/runs/9531770131/job/26273074388
There's a suspicious 1 / sqrt(2)
there, so perhaps we need 1 / scale^2
somewhere?
The COPT failure is unrelated: https://github.com/COPT-Public/COPT.jl/pull/40
I don't fully understand the math logic, but the code does something like set_dot(scale * x, scale * y)
, which is more or less equivalent to sum(scale.^2 .* x .* y)
, so to reverse, we need to divide by scale.^2
.
Yes, the trick is to keep the same term in the Lagrangian. The equality constraints gives the term <dual, primal>
with the standard inner product but <dual, primal>_PSD
is like scaling each entry of dual
and primal
by the entry of SetDotScalingVector
so dividing by the square makes sense
Maybe we should add a test in test/Bridges/Constraint/slack.jl
I've added a test that triggers the scale
and tweaked the comments. I also needed to update the MOI.set
for ::ConstraintDualStart
because it didn't scale things either.
As a more general comment: our tests just check that get/set
is a round-trip. We can't easily automatically test that the numeric values are correct.
Let's just double check:
https://github.com/jump-dev/MathOptInterface.jl/actions/runs/9556803924
We can take inspiration from https://github.com/jump-dev/MathOptInterface.jl/blob/08d34003cd3d7500379d9440e92445bc4d9a8fa8/src/Bridges/Constraint/bridges/set_dot_scaling.jl#L64-L75
Closes https://github.com/jump-dev/MathOptInterface.jl/issues/2513