The use of templates gets a little messy, but allows a ton of code reuse. Note that in the test cases, we use solvers::internal::ParseCost and solvers::internal::ParseConstraint to convert Expression and Formula to Binding<Cost> and Binding<Constraint>, respectively.
+@Russtedrake for feature review, please! cc @wrangelvid
Towards #21981.
The use of templates gets a little messy, but allows a ton of code reuse. Note that in the test cases, we use
solvers::internal::ParseCost
andsolvers::internal::ParseConstraint
to convertExpression
andFormula
toBinding<Cost>
andBinding<Constraint>
, respectively.+@Russtedrake for feature review, please! cc @wrangelvid
This change is