35 :Component(1,
"soft-" + constraint->GetName())
44 b_(i++) = (b.upper_ + b.lower_)/2.;
48 W_.resize(n_constraints);
66 return grad.transpose().sparseView();
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.
Eigen::SparseMatrix< double, Eigen::RowMajor > Jacobian
VectorXd GetValues() const override
average value of each upper and lower bound.
VectorXd W_
weights how each constraint violation contributes to the cost.