30 #ifndef TOWR_COSTS_SOFT_CONSTRAINT_H_ 31 #define TOWR_COSTS_SOFT_CONSTRAINT_H_ Jacobian GetJacobian() const override
The row-vector of derivatives of the cost term.
VecBound GetBounds() const final
virtual ~SoftConstraint()=default
ConstraintPtr constraint_
Component::Ptr ConstraintPtr
static const Bounds NoBound
SoftConstraint(const ConstraintPtr &constraint)
Creates a soft constraint (=cost) from a hard constraint.
Eigen::SparseMatrix< double, Eigen::RowMajor > Jacobian
void SetVariables(const VectorXd &x) final
std::vector< Bounds > VecBound
VectorXd GetValues() const override
average value of each upper and lower bound.
Converts a constraint to a cost by weighing the quadratic violations.
VectorXd W_
weights how each constraint violation contributes to the cost.