Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ortools.math_opt.python.variables Namespace Reference

Detailed Description

Define Variables and Linear Expressions.

Classes

class  VarEqVar
class  QuadraticTermKey
class  _ProcessedElements
class  _QuadraticProcessedElements
class  _ToProcessElements
class  _ToProcessElementsImplementation
class  LinearBase
class  QuadraticBase
class  Variable
class  LinearTerm
class  QuadraticTerm
class  LinearExpression
class  QuadraticExpression
class  LinearSum
class  QuadraticSum
class  LinearProduct
class  QuadraticProduct
class  LinearLinearProduct

Functions

NoReturn _raise_binary_operator_type_error (str operator, Type[Any] lhs, Type[Any] rhs, Optional[str] extra_message=None)
NoReturn _raise_ne_not_supported ()
LinearExpression as_flat_linear_expression (LinearTypes value)
QuadraticExpression as_flat_quadratic_expression (QuadraticTypes value)

Variables

 LinearTypes = Union[int, float, "LinearBase"]
 QuadraticTypes = Union[int, float, "LinearBase", "QuadraticBase"]
 LinearTypesExceptVariable
tuple _EXPRESSION_COMP_EXPRESSION_MESSAGE
 LowerBoundedLinearExpression = bounded_expressions.LowerBoundedExpression["LinearBase"]
 UpperBoundedLinearExpression = bounded_expressions.UpperBoundedExpression["LinearBase"]
 BoundedLinearExpression = bounded_expressions.BoundedExpression["LinearBase"]
tuple BoundedLinearTypesList
 BoundedLinearTypes = Union[BoundedLinearTypesList]
 LowerBoundedQuadraticExpression
 UpperBoundedQuadraticExpression
 BoundedQuadraticExpression = bounded_expressions.BoundedExpression["QuadraticBase"]
tuple BoundedQuadraticTypesList
 BoundedQuadraticTypes = Union[BoundedQuadraticTypesList]
 _T = TypeVar("_T", "LinearBase", Union["LinearBase", "QuadraticBase"])
 _LinearToProcessElements = _ToProcessElementsImplementation["LinearBase"]
 _QuadraticToProcessElements

Function Documentation

◆ _raise_binary_operator_type_error()

NoReturn ortools.math_opt.python.variables._raise_binary_operator_type_error ( str operator,
Type[Any] lhs,
Type[Any] rhs,
Optional[str] extra_message = None )
protected
Raises TypeError on unsupported operators.

Definition at line 61 of file variables.py.

◆ _raise_ne_not_supported()

NoReturn ortools.math_opt.python.variables._raise_ne_not_supported ( )
protected

Definition at line 77 of file variables.py.

◆ as_flat_linear_expression()

LinearExpression ortools.math_opt.python.variables.as_flat_linear_expression ( LinearTypes value)
Converts floats, ints and Linear objects to a LinearExpression.

Definition at line 1396 of file variables.py.

◆ as_flat_quadratic_expression()

QuadraticExpression ortools.math_opt.python.variables.as_flat_quadratic_expression ( QuadraticTypes value)
Converts floats, ints, LinearBase and QuadraticBase objects to a QuadraticExpression.

Definition at line 1403 of file variables.py.

Variable Documentation

◆ _EXPRESSION_COMP_EXPRESSION_MESSAGE

tuple ortools.math_opt.python.variables._EXPRESSION_COMP_EXPRESSION_MESSAGE
protected
Initial value:
1= (
2 "This error can occur when adding "
3 "inequalities of the form `(a <= b) <= "
4 "c` where (a, b, c) includes two or more"
5 " non-constant linear expressions"
6)

Definition at line 53 of file variables.py.

◆ _LinearToProcessElements

ortools.math_opt.python.variables._LinearToProcessElements = _ToProcessElementsImplementation["LinearBase"]
protected

Definition at line 241 of file variables.py.

◆ _QuadraticToProcessElements

ortools.math_opt.python.variables._QuadraticToProcessElements
protected
Initial value:
1= _ToProcessElementsImplementation[
2 Union["LinearBase", "QuadraticBase"]
3]

Definition at line 242 of file variables.py.

◆ _T

ortools.math_opt.python.variables._T = TypeVar("_T", "LinearBase", Union["LinearBase", "QuadraticBase"])
protected

Definition at line 220 of file variables.py.

◆ BoundedLinearExpression

ortools.math_opt.python.variables.BoundedLinearExpression = bounded_expressions.BoundedExpression["LinearBase"]

Definition at line 83 of file variables.py.

◆ BoundedLinearTypes

ortools.math_opt.python.variables.BoundedLinearTypes = Union[BoundedLinearTypesList]

Definition at line 137 of file variables.py.

◆ BoundedLinearTypesList

tuple ortools.math_opt.python.variables.BoundedLinearTypesList
Initial value:
1= (
2 LowerBoundedLinearExpression,
3 UpperBoundedLinearExpression,
4 BoundedLinearExpression,
5 VarEqVar,
6)

Definition at line 131 of file variables.py.

◆ BoundedQuadraticExpression

ortools.math_opt.python.variables.BoundedQuadraticExpression = bounded_expressions.BoundedExpression["QuadraticBase"]

Definition at line 145 of file variables.py.

◆ BoundedQuadraticTypes

ortools.math_opt.python.variables.BoundedQuadraticTypes = Union[BoundedQuadraticTypesList]

Definition at line 152 of file variables.py.

◆ BoundedQuadraticTypesList

tuple ortools.math_opt.python.variables.BoundedQuadraticTypesList
Initial value:
1= (
2 LowerBoundedQuadraticExpression,
3 UpperBoundedQuadraticExpression,
4 BoundedQuadraticExpression,
5)

Definition at line 147 of file variables.py.

◆ LinearTypes

ortools.math_opt.python.variables.LinearTypes = Union[int, float, "LinearBase"]

Definition at line 46 of file variables.py.

◆ LinearTypesExceptVariable

ortools.math_opt.python.variables.LinearTypesExceptVariable
Initial value:
1= Union[
2 float, int, "LinearTerm", "LinearExpression", "LinearSum", "LinearProduct"
3]

Definition at line 48 of file variables.py.

◆ LowerBoundedLinearExpression

ortools.math_opt.python.variables.LowerBoundedLinearExpression = bounded_expressions.LowerBoundedExpression["LinearBase"]

Definition at line 81 of file variables.py.

◆ LowerBoundedQuadraticExpression

ortools.math_opt.python.variables.LowerBoundedQuadraticExpression
Initial value:
1= bounded_expressions.LowerBoundedExpression[
2 "QuadraticBase"
3]

Definition at line 139 of file variables.py.

◆ QuadraticTypes

ortools.math_opt.python.variables.QuadraticTypes = Union[int, float, "LinearBase", "QuadraticBase"]

Definition at line 47 of file variables.py.

◆ UpperBoundedLinearExpression

ortools.math_opt.python.variables.UpperBoundedLinearExpression = bounded_expressions.UpperBoundedExpression["LinearBase"]

Definition at line 82 of file variables.py.

◆ UpperBoundedQuadraticExpression

ortools.math_opt.python.variables.UpperBoundedQuadraticExpression
Initial value:
1= bounded_expressions.UpperBoundedExpression[
2 "QuadraticBase"
3]

Definition at line 142 of file variables.py.