You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the dual values are taken out of a big vector of dual values returned by MPB by using the constraint's size to determine the indexing. However, for complex dual values, they have been written as a long vector, and we only take the first half-- the real parts. Then the next dual value takes the next bit of the big vector of dual values, which is then can include the complex part of the previous dual value. So here, (p.constraints[1]).dual + im*(p.constraints[2]).dual is actually the true dual value for the first constraint (and hence matches cvx_dual1). And we've totally lost the dual value for the 2nd constraint (i.e. cvx_dual2).
I found this because MOI doesn't return a big vector of dual values, but instead returns the dual values for each constraint as you ask for it. Then when I ported the tests from #332 to the MOI branch (#330), I found I was missing a reshape in the MOI code. Adding the reshape added a size check, and I found MOI was returning double the number of values than the size expected (since it returns the real and complex parts). When I went to check how we handled this with MPB, I found that we did not, hence this issue.
This will be fixed with #330 (once I push some commits up), and I'll add this example as a test there.
The text was updated successfully, but these errors were encountered:
E.g.
yields
Why? In
https://github.com/JuliaOpt/Convex.jl/blob/e0513acc7a2fa3c22325c7ea9e528b0a340f068b/src/solution.jl#L194-L214
the dual values are taken out of a big vector of dual values returned by MPB by using the constraint's size to determine the indexing. However, for complex dual values, they have been written as a long vector, and we only take the first half-- the real parts. Then the next dual value takes the next bit of the big vector of dual values, which is then can include the complex part of the previous dual value. So here,
(p.constraints[1]).dual + im*(p.constraints[2]).dual
is actually the true dual value for the first constraint (and hence matchescvx_dual1
). And we've totally lost the dual value for the 2nd constraint (i.e.cvx_dual2
).I found this because MOI doesn't return a big vector of dual values, but instead returns the dual values for each constraint as you ask for it. Then when I ported the tests from #332 to the MOI branch (#330), I found I was missing a reshape in the MOI code. Adding the reshape added a size check, and I found MOI was returning double the number of values than the size expected (since it returns the real and complex parts). When I went to check how we handled this with MPB, I found that we did not, hence this issue.
This will be fixed with #330 (once I push some commits up), and I'll add this example as a test there.
The text was updated successfully, but these errors were encountered: