clamp¶

clamp(left: Poly | VariableListBase, right: tuple) Constraint¶

Construct a user-defined inequality constraint that the given l.h.s. polynomial ranges between lower and upper bounds specified as r.h.s.

Parameters:
  • left (Poly | VariableListBase) – A polynomial of variables. If a ‘variable list’ is directly given, its sum is considered as the l.h.s. polynomial.

  • right (tuple) – Lower and upper bounds of the range as r.h.s. vlaue.

Raises:

ValueError – If the lower bound value is greater than the upper bound value.

Returns:

Constructed inequality constraint.

Return type:

Constraint