less_equal¶
- less_equal(
- poly: Poly,
- right: float,
- label: str = '',
- *,
- penalty_formulation: Literal['Default', 'IntegerVariable', 'RealVariable', 'Relaxation', 'LinearRelaxation', 'QuadraticRelaxation'] | PenaltyFormulation = PenaltyFormulation.Default,
- less_equal(
- array: PolyArray[_Dim],
- right: float,
- label: str = '',
- *,
- penalty_formulation: Literal['Default', 'IntegerVariable', 'RealVariable', 'Relaxation', 'LinearRelaxation', 'QuadraticRelaxation'] | PenaltyFormulation = PenaltyFormulation.Default,
- axis: None = None,
- less_equal(
- array: PolyArray[Dim],
- right: float,
- label: str = '',
- *,
- penalty_formulation: Literal['Default', 'IntegerVariable', 'RealVariable', 'Relaxation', 'LinearRelaxation', 'QuadraticRelaxation'] | PenaltyFormulation = PenaltyFormulation.Default,
- axis: int | tuple[int, ...],
Create a less-than-or-equal constraint.
For a single polynomial
poly, constrainpoly <= right. For an array withaxis=None(default), constrain the sum of all elements ofarrayto be less than or equal to right, returning a singleConstraint. For an array withaxisspecified, reduce along the given axis or axes. Return aConstraintif all axes are reduced, or aConstraintListwith one constraint per remaining slice otherwise.Overload 1.
- Args:
poly (amplify.Poly): Left-hand side polynomial.
right (float): Right-hand side value.
label (str): Constraint label. Defaults to
''.penalty_formulation (typing.Literal[âDefaultâ, âIntegerVariableâ, âRealVariableâ, âRelaxationâ, âLinearRelaxationâ, âQuadraticRelaxationâ] | amplify.PenaltyFormulation): Penalty formulation method. Defaults to
PenaltyFormulation.Default.
- Returns:
amplify.Constraint: Constraint object.
Overload 2.
- Args:
array (amplify.PolyArray[_Dim]): Array of polynomials to reduce.
right (float): Right-hand side value.
label (str): Constraint label. Defaults to
''.penalty_formulation (typing.Literal[âDefaultâ, âIntegerVariableâ, âRealVariableâ, âRelaxationâ, âLinearRelaxationâ, âQuadraticRelaxationâ] | amplify.PenaltyFormulation): Penalty formulation method. Defaults to
PenaltyFormulation.Default.axis (None): Axis or axes to reduce. Defaults to
None.
- Returns:
amplify.Constraint: Single constraint when all axes are reduced; otherwise one constraint per remaining slice.
Overload 3.
- Args:
array (amplify.PolyArray[Dim]): Array of polynomials to reduce.
right (float): Right-hand side value.
label (str): Constraint label. Defaults to
''.penalty_formulation (typing.Literal[âDefaultâ, âIntegerVariableâ, âRealVariableâ, âRelaxationâ, âLinearRelaxationâ, âQuadraticRelaxationâ] | amplify.PenaltyFormulation): Penalty formulation method. Defaults to
PenaltyFormulation.Default.axis (int | tuple[int, âŠ]): Axis or axes to reduce.
- Returns:
amplify.Constraint | amplify.ConstraintList: Single constraint when all axes are reduced; otherwise one constraint per remaining slice.