RobotLocomotion / drake

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

Update single entry of coefficients in LinearCost and QuadraticCost. #22152

Closed hongkai-dai closed 1 week ago

hongkai-dai commented 1 week ago

Towards #22131

I tested with and without this change. For updating the coefficient in LinearCost for 1000 times

Use UpdateCoefficients: takes 0.130985ms
Use UpdateCoefficientEntry: takes 0.008051ms

This change is Reviewable