RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.35k stars 1.27k forks source link

Return dual solution for PSD constraint in SCS and Clarabel. #22147

Closed hongkai-dai closed 1 week ago

hongkai-dai commented 1 week ago

Include dual for both PositiveSemidefiniteConstraint and LinearMatrixInequalityConstraint.


This change is Reviewable

xuchenhan-tri commented 1 week ago

solvers/scs_clarabel_common.cc line 151 at r2 (raw file):

Previously, xuchenhan-tri wrote…
BTW, I believe you can prevent a copy here by using auto psd_dual = dual.segment(...) and change the signature of `ScalePsdConeDualVariable` to take an `EigenPtr`. Although if you do that, you can't change the size of the input like I suggested above.

Looking more closely at this, there are some constness violation here. SetDualSolution has dual passed in as a const eigen ref, but somehow its being modified in ScalePsdConeDualVariable

xuchenhan-tri commented 1 week ago

CI is still failing with both linter errors and what appears to be actual failures.