clampΒΆ

clamp(
poly: Poly,
bounds: tuple[float | None, float | None],
label: str = '',
penalty_formulation: str | PenaltyFormulation = Default,
) ConstraintΒΆ
clamp(
array: PolyArray,
bounds: tuple[float | None, float | None],
label: str = '',
penalty_formulation: str | PenaltyFormulation = Default,
axis: Literal[None] | None = None,
) Constraint
clamp(
array: PolyArray,
bounds: tuple[float | None, float | None],
label: str = '',
penalty_formulation: str | PenaltyFormulation = Default,
axis: int | tuple[int, ...] | None = None,
) Constraint | ConstraintList

clamp

Overloading:

1. clamp(poly: amplify.Poly, bounds: tuple[Optional[float], Optional[float]], label: str = β€˜β€™, penalty_formulation: Union[str, amplify.PenaltyFormulation] = Default) -> amplify.Constraint

Args:
  • poly (amplify.Poly):

  • bounds (tuple[Optional[float], Optional[float]]):

  • label (str): Defaults to ''.

  • penalty_formulation (str | amplify.PenaltyFormulation): Defaults to Default.

Returns:

amplify.Constraint:

2. clamp(array: amplify.PolyArray, bounds: tuple[Optional[float], Optional[float]], label: str = β€˜β€™, penalty_formulation: Union[str, amplify.PenaltyFormulation] = Default, axis: Optional[Literal[None]] = None) -> amplify.Constraint

Args:
  • array (amplify.PolyArray):

  • bounds (tuple[Optional[float], Optional[float]]):

  • label (str): Defaults to ''.

  • penalty_formulation (str | amplify.PenaltyFormulation): Defaults to Default.

  • axis (Literal[None] | None): Defaults to None.

Returns:

amplify.Constraint:

3. clamp(array: amplify.PolyArray, bounds: tuple[Optional[float], Optional[float]], label: str = β€˜β€™, penalty_formulation: Union[str, amplify.PenaltyFormulation] = Default, axis: Optional[Union[int, tuple[int, …]]] = None) -> Union[amplify.Constraint, amplify.ConstraintList]

Args:
  • array (amplify.PolyArray):

  • bounds (tuple[Optional[float], Optional[float]]):

  • label (str): Defaults to ''.

  • penalty_formulation (str | amplify.PenaltyFormulation): Defaults to Default.

  • axis (int | tuple[int, …] | None): Defaults to None.

Returns:

amplify.Constraint | amplify.ConstraintList: