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[numpy.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[numpy.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[numpy.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[numpy.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[numpy.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[numpy.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]