87 lines
3.3 KiB
Python
87 lines
3.3 KiB
Python
|
from __future__ import annotations
|
||
|
|
||
|
from typing import overload
|
||
|
|
||
|
from docplex.mp.basic import Expr
|
||
|
from docplex.mp.operand import LinearOperand
|
||
|
from docplex.mp.quad import QuadExpr
|
||
|
|
||
|
class AbstractLinearExpr(LinearOperand, Expr): ...
|
||
|
|
||
|
class MonomialExpr(AbstractLinearExpr):
|
||
|
def __sub__(self, e: LinearOperand | float) -> LinearExpr: ...
|
||
|
def __rsub__(self, e: LinearOperand | float) -> LinearExpr: ...
|
||
|
def __neg__(self) -> MonomialExpr: ...
|
||
|
def __add__(self, other: LinearOperand | float) -> LinearExpr: ...
|
||
|
def __radd__(self, other: LinearOperand | float) -> LinearExpr: ...
|
||
|
@overload
|
||
|
def __mul__(self, other: float) -> MonomialExpr: ...
|
||
|
@overload
|
||
|
def __mul__(self, other: LinearExpr) -> QuadExpr: ...
|
||
|
def __rmul__(self, other: float) -> MonomialExpr: ...
|
||
|
def __div__(self, other: float) -> MonomialExpr: ...
|
||
|
def __truediv__(self, e: float) -> MonomialExpr: ...
|
||
|
|
||
|
class LinearExpr(AbstractLinearExpr):
|
||
|
def __sub__(self, e: LinearOperand | float) -> LinearExpr: ...
|
||
|
def __rsub__(self, e: LinearOperand | float) -> LinearExpr: ...
|
||
|
def __neg__(self) -> LinearExpr: ...
|
||
|
def __add__(self, e: LinearOperand | float) -> LinearExpr: ...
|
||
|
def __radd__(self, e: LinearOperand | float) -> LinearExpr: ...
|
||
|
@overload
|
||
|
def __mul__(self, e: float) -> LinearExpr: ...
|
||
|
@overload
|
||
|
def __mul__(self, e: LinearOperand) -> QuadExpr: ...
|
||
|
def __rmul__(self, e: float) -> LinearExpr: ...
|
||
|
def __div__(self, e: float) -> LinearExpr: ...
|
||
|
def __truediv__(self, e: float) -> LinearExpr: ...
|
||
|
|
||
|
class ZeroExpr(AbstractLinearExpr):
|
||
|
@overload
|
||
|
def __sub__(self, e: float) -> ConstantExpr: ...
|
||
|
@overload
|
||
|
def __sub__(self, e: LinearOperand) -> LinearExpr: ...
|
||
|
@overload
|
||
|
def __rsub__(self, e: float) -> ConstantExpr: ...
|
||
|
@overload
|
||
|
def __rsub__(self, e: LinearOperand) -> LinearExpr: ...
|
||
|
@overload
|
||
|
def __add__(self, e: float) -> ConstantExpr: ...
|
||
|
@overload
|
||
|
def __add__(self, e: LinearOperand) -> LinearExpr: ...
|
||
|
@overload
|
||
|
def __radd__(self, e: float) -> ConstantExpr: ...
|
||
|
@overload
|
||
|
def __radd__(self, e: LinearOperand) -> LinearExpr: ...
|
||
|
def __neg__(self) -> ZeroExpr: ...
|
||
|
def __mul__(self, e: float | LinearOperand) -> ZeroExpr: ...
|
||
|
def __rmul__(self, e: float | LinearOperand) -> ZeroExpr: ...
|
||
|
def __div__(self, e: float) -> ZeroExpr: ...
|
||
|
def __truediv__(self, e: float) -> ZeroExpr: ...
|
||
|
|
||
|
class ConstantExpr(AbstractLinearExpr):
|
||
|
@overload
|
||
|
def __sub__(self, e: float) -> ConstantExpr: ...
|
||
|
@overload
|
||
|
def __sub__(self, e: LinearOperand) -> LinearExpr: ...
|
||
|
@overload
|
||
|
def __rsub__(self, e: float) -> ConstantExpr: ...
|
||
|
@overload
|
||
|
def __rsub__(self, e: LinearOperand) -> LinearExpr: ...
|
||
|
@overload
|
||
|
def __add__(self, e: float) -> ConstantExpr: ...
|
||
|
@overload
|
||
|
def __add__(self, e: LinearOperand) -> LinearExpr: ...
|
||
|
@overload
|
||
|
def __radd__(self, e: float) -> ConstantExpr: ...
|
||
|
@overload
|
||
|
def __radd__(self, e: LinearOperand) -> LinearExpr: ...
|
||
|
def __neg__(self) -> ConstantExpr: ...
|
||
|
@overload
|
||
|
def __mul__(self, e: float) -> ConstantExpr: ...
|
||
|
@overload
|
||
|
def __mul__(self, e: LinearOperand) -> LinearExpr: ...
|
||
|
def __rmul__(self, e: float | LinearOperand) -> ConstantExpr: ...
|
||
|
def __div__(self, e: float) -> ConstantExpr: ...
|
||
|
def __truediv__(self, e: float) -> ConstantExpr: ...
|