How should we deal with doubled computation in the constraint builder class?
Akshay5312 opened this issue · 1 comments
Akshay5312 commented
We have "CreateBounds" and "CreateFunction" functions to create
b_min < g(x) < b_max
but often the computation of the bounds and the function are dependent on each other. In the instance of the contact constraint the number of constraints (size of b and g) is dependent on the current mode.
How should we implement a constraint builder where there is shared computation?
I propose we make the functions CreateApplyAt, CreateBounds and CreateFunction protected and empty virtual functions, and make BuildConstraint virtual.
That way, when extending the ConstraintBuilder, you can elect to implement the "constraint building" in BuildConstraint itself.
echandler5956f commented
Yep, let's do that.