35 :Component(1,
"SoftConstraint-" + constraint->GetName())
44 b_(i++) = (b.upper_ + b.lower_)/2.;
48 W_.resize(n_constraints);
60 SoftConstraint::Jacobian
66 return grad.transpose().sparseView();
virtual Jacobian GetJacobian() const override
The row-vector of derivatives of the cost term.
ConstraintPtr constraint_
Component::Ptr ConstraintPtr
SoftConstraint(const ConstraintPtr &constraint)
Creates a soft constraint (=cost) from a hard constraint.
virtual VectorXd GetValues() const override
average value of each upper and lower bound.
VectorXd W_
weights how each constraint violation contributes to the cost.