Poly#

class Poly#

Methods

__init__

__init__

as_dict

as_dict

as_variable

as_variable

asdict

alias of as_dict()

decode

decode

degree

degree

evaluate

evaluate

is_linear

is_linear

is_number

is_number

is_quadratic

is_quadratic

is_variable

is_variable

substitute

substitute

Attributes

id

id property

lower_bound

lower_bound property

name

name property

type

type property

upper_bound

upper_bound property

variables

variables property

class Iterator#
__init__(*args, **kwargs)#
__iter__(self) Iterator#

__iter__

Return type:

Iterator

__next__(self) tuple[tuple[Poly, ...], float]#

__next__

Return type:

tuple[tuple[Poly, …], float]

__add__(self, arg: Poly | float, /) Poly#
__add__(self, arg: ndarray, /) PolyArray
__add__(self, arg: Constraint | ConstraintList, /) Model

__add__

Overloading:

1. __add__(self, arg: Union[amplify.Poly, float], /) -> amplify.Poly

Args:
  • arg (amplify.Poly | float):

Returns:

amplify.Poly:

2. __add__(self, arg: numpy.ndarray, /) -> amplify.PolyArray

Args:
  • arg (numpy.ndarray):

Returns:

amplify.PolyArray:

3. __add__(self, arg: Union[amplify.Constraint, amplify.ConstraintList], /) -> amplify.Model

Args:
  • arg (amplify.Constraint | amplify.ConstraintList):

Returns:

amplify.Model:

__and__(self, arg: Poly | bool, /) Poly#
__and__(self, arg: ndarray[Any, dtype[bool_]], /) PolyArray

__and__

Overloading:

1. __and__(self, arg: Union[amplify.Poly, bool], /) -> amplify.Poly

Args:
  • arg (amplify.Poly | bool):

Returns:

amplify.Poly:

2. __and__(self, arg: numpy.ndarray[Any, numpy.dtype[numpy.bool_]], /) -> amplify.PolyArray

Args:
  • arg (numpy.ndarray):

Returns:

amplify.PolyArray:

__bool__(self) bool#

__bool__

Return type:

bool

__eq__(self, arg: Poly | float, /) bool#

__eq__

Parameters:

arg (Poly | float) –

Return type:

bool

__float__(self) float#

__float__

Return type:

float

__iadd__(self, arg: Poly | float, /) Poly#

__iadd__

Parameters:

arg (Poly | float) –

Return type:

Poly

__iand__(self, arg: Poly | bool, /) Poly#

__iand__

Parameters:

arg (Poly | bool) –

Return type:

Poly

__imul__(self, arg: Poly | float, /) Poly#

__imul__

Parameters:

arg (Poly | float) –

Return type:

Poly

__index__(self) int#

__index__

Return type:

int

__init__(self) None#
__init__(self, arg: float, /) None

__init__

Parameters:

arg (float) –

__int__(self) int#

__int__

Return type:

int

__invert__(self) Poly#

__invert__

Return type:

Poly

__ior__(self, arg: Poly | bool, /) Poly#

__ior__

Parameters:

arg (Poly | bool) –

Return type:

Poly

__ipow__(self, arg: int, /) Poly#

__ipow__

Parameters:

arg (int) –

Return type:

Poly

__isub__(self, arg: Poly | float, /) Poly#

__isub__

Parameters:

arg (Poly | float) –

Return type:

Poly

__iter__(self) Iterator#

__iter__

Return type:

Iterator

__itruediv__(self, arg: float, /) Poly#

__itruediv__

Parameters:

arg (float) –

Return type:

Poly

__ixor__(self, arg: Poly | bool, /) Poly#

__ixor__

Parameters:

arg (Poly | bool) –

Return type:

Poly

__len__(self) int#

__len__

Return type:

int

__mul__(self, arg: Poly | float, /) Poly#
__mul__(self, arg: ndarray, /) PolyArray

__mul__

Overloading:

1. __mul__(self, arg: Union[amplify.Poly, float], /) -> amplify.Poly

Args:
  • arg (amplify.Poly | float):

Returns:

amplify.Poly:

2. __mul__(self, arg: numpy.ndarray, /) -> amplify.PolyArray

Args:
  • arg (numpy.ndarray):

Returns:

amplify.PolyArray:

__ne__(self, arg: Poly | float, /) bool#

__ne__

Parameters:

arg (Poly | float) –

Return type:

bool

__neg__(self) Poly#

__neg__

Return type:

Poly

__or__(self, arg: Poly | bool, /) Poly#
__or__(self, arg: ndarray[Any, dtype[bool_]], /) PolyArray

__or__

Overloading:

1. __or__(self, arg: Union[amplify.Poly, bool], /) -> amplify.Poly

Args:
  • arg (amplify.Poly | bool):

Returns:

amplify.Poly:

2. __or__(self, arg: numpy.ndarray[Any, numpy.dtype[numpy.bool_]], /) -> amplify.PolyArray

Args:
  • arg (numpy.ndarray):

Returns:

amplify.PolyArray:

__pos__(self) Poly#

__pos__

Return type:

Poly

__pow__(self, arg: int, /) Poly#

__pow__

Parameters:

arg (int) –

Return type:

Poly

__radd__(self, arg: float, /) Poly#
__radd__(self, arg: ndarray, /) PolyArray
__radd__(self, arg: Constraint | ConstraintList, /) Model

__radd__

Overloading:

1. __radd__(self, arg: float, /) -> amplify.Poly

Args:
  • arg (float):

Returns:

amplify.Poly:

2. __radd__(self, arg: numpy.ndarray, /) -> amplify.PolyArray

Args:
  • arg (numpy.ndarray):

Returns:

amplify.PolyArray:

3. __radd__(self, arg: Union[amplify.Constraint, amplify.ConstraintList], /) -> amplify.Model

Args:
  • arg (amplify.Constraint | amplify.ConstraintList):

Returns:

amplify.Model:

__rand__(self, arg: bool, /) Poly#
__rand__(self, arg: ndarray[Any, dtype[bool_]], /) PolyArray

__rand__

Overloading:

1. __rand__(self, arg: bool, /) -> amplify.Poly

Args:
  • arg (bool):

Returns:

amplify.Poly:

2. __rand__(self, arg: numpy.ndarray[Any, numpy.dtype[numpy.bool_]], /) -> amplify.PolyArray

Args:
  • arg (numpy.ndarray):

Returns:

amplify.PolyArray:

__repr__(self) str#

__repr__

Return type:

str

__rmul__(self, arg: float, /) Poly#
__rmul__(self, arg: ndarray, /) PolyArray

__rmul__

Overloading:

1. __rmul__(self, arg: float, /) -> amplify.Poly

Args:
  • arg (float):

Returns:

amplify.Poly:

2. __rmul__(self, arg: numpy.ndarray, /) -> amplify.PolyArray

Args:
  • arg (numpy.ndarray):

Returns:

amplify.PolyArray:

__ror__(self, arg: bool, /) Poly#
__ror__(self, arg: ndarray[Any, dtype[bool_]], /) PolyArray

__ror__

Overloading:

1. __ror__(self, arg: bool, /) -> amplify.Poly

Args:
  • arg (bool):

Returns:

amplify.Poly:

2. __ror__(self, arg: numpy.ndarray[Any, numpy.dtype[numpy.bool_]], /) -> amplify.PolyArray

Args:
  • arg (numpy.ndarray):

Returns:

amplify.PolyArray:

__rsub__(self, arg: float, /) Poly#
__rsub__(self, arg: ndarray, /) PolyArray

__rsub__

Overloading:

1. __rsub__(self, arg: float, /) -> amplify.Poly

Args:
  • arg (float):

Returns:

amplify.Poly:

2. __rsub__(self, arg: numpy.ndarray, /) -> amplify.PolyArray

Args:
  • arg (numpy.ndarray):

Returns:

amplify.PolyArray:

__rxor__(self, arg: bool, /) Poly#
__rxor__(self, arg: ndarray[Any, dtype[bool_]], /) PolyArray

__rxor__

Overloading:

1. __rxor__(self, arg: bool, /) -> amplify.Poly

Args:
  • arg (bool):

Returns:

amplify.Poly:

2. __rxor__(self, arg: numpy.ndarray[Any, numpy.dtype[numpy.bool_]], /) -> amplify.PolyArray

Args:
  • arg (numpy.ndarray):

Returns:

amplify.PolyArray:

__str__(self) str#

__str__

Return type:

str

__sub__(self, arg: Poly | float, /) Poly#
__sub__(self, arg: ndarray, /) PolyArray

__sub__

Overloading:

1. __sub__(self, arg: Union[amplify.Poly, float], /) -> amplify.Poly

Args:
  • arg (amplify.Poly | float):

Returns:

amplify.Poly:

2. __sub__(self, arg: numpy.ndarray, /) -> amplify.PolyArray

Args:
  • arg (numpy.ndarray):

Returns:

amplify.PolyArray:

__truediv__(self, arg: float, /) Poly#
__truediv__(self, arg: ndarray, /) PolyArray

__truediv__

Overloading:

1. __truediv__(self, arg: float, /) -> amplify.Poly

Args:
  • arg (float):

Returns:

amplify.Poly:

2. __truediv__(self, arg: numpy.ndarray, /) -> amplify.PolyArray

Args:
  • arg (numpy.ndarray):

Returns:

amplify.PolyArray:

__xor__(self, arg: Poly | bool, /) Poly#
__xor__(self, arg: ndarray[Any, dtype[bool_]], /) PolyArray

__xor__

Overloading:

1. __xor__(self, arg: Union[amplify.Poly, bool], /) -> amplify.Poly

Args:
  • arg (amplify.Poly | bool):

Returns:

amplify.Poly:

2. __xor__(self, arg: numpy.ndarray[Any, numpy.dtype[numpy.bool_]], /) -> amplify.PolyArray

Args:
  • arg (numpy.ndarray):

Returns:

amplify.PolyArray:

as_dict(self) dict[tuple[int, ...], float]#

as_dict

Return type:

dict[tuple[int, …], float]

as_variable(self) Variable#

as_variable

Return type:

Variable

asdict(self) dict[tuple[int, ...], float]#

alias of as_dict()

Return type:

dict[tuple[int, …], float]

decode(self, values: Values) float#
decode(self, values: Values, default: float) float
decode(self, values: Values, default: None | None) Poly

decode

Overloading:

1. decode(self, values: amplify.Values) -> float

Args:
  • values (amplify.Values):

Returns:

float:

2. decode(self, values: amplify.Values, default: float) -> float

Args:
  • values (amplify.Values):

  • default (float):

Returns:

float:

3. decode(self, values: amplify.Values, default: Optional[None]) -> amplify.Poly

Args:
  • values (amplify.Values):

  • default (None | None):

Returns:

amplify.Poly:

degree(self) int#

degree

Return type:

int

evaluate(self, values: Values) float#
evaluate(self, values: Values, default: float) float
evaluate(self, values: Values, default: None | None) Poly

evaluate

Overloading:

1. evaluate(self, values: amplify.Values) -> float

Args:
  • values (amplify.Values):

Returns:

float:

2. evaluate(self, values: amplify.Values, default: float) -> float

Args:
  • values (amplify.Values):

  • default (float):

Returns:

float:

3. evaluate(self, values: amplify.Values, default: Optional[None]) -> amplify.Poly

Args:
  • values (amplify.Values):

  • default (None | None):

Returns:

amplify.Poly:

is_linear(self) bool#

is_linear

Return type:

bool

is_number(self) bool#

is_number

Return type:

bool

is_quadratic(self) bool#

is_quadratic

Return type:

bool

is_variable(self) bool#

is_variable

Return type:

bool

substitute(self, mapping: dict[Poly, Poly | float | int]) Poly#

substitute

Parameters:

mapping (dict[Poly, Union[Poly, float, int]]) –

Return type:

Poly

property id#

id property

Return type:

int

property lower_bound#

lower_bound property

Return type:

float | None

property name#

name property

Return type:

str

property type#

type property

Return type:

VariableType

property upper_bound#

upper_bound property

Return type:

float | None

property variables#

variables property

Return type:

list[Variable]