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

Classes

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

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

Detailed Description

Define Variables and Linear Expressions.

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 60 of file variables.py.

◆ _raise_ne_not_supported()

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

Definition at line 76 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 1407 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 1414 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 52 of file variables.py.

◆ _LinearToProcessElements

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

Definition at line 240 of file variables.py.

◆ _QuadraticToProcessElements

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

Definition at line 241 of file variables.py.

◆ _T

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

Definition at line 219 of file variables.py.

◆ BoundedLinearExpression

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

Definition at line 82 of file variables.py.

◆ BoundedLinearTypes

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

Definition at line 136 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 130 of file variables.py.

◆ BoundedQuadraticExpression

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

Definition at line 144 of file variables.py.

◆ BoundedQuadraticTypes

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

Definition at line 151 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 146 of file variables.py.

◆ LinearTypes

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

Definition at line 45 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 47 of file variables.py.

◆ LowerBoundedLinearExpression

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

Definition at line 80 of file variables.py.

◆ LowerBoundedQuadraticExpression

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

Definition at line 138 of file variables.py.

◆ QuadraticTypes

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

Definition at line 46 of file variables.py.

◆ UpperBoundedLinearExpression

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

Definition at line 81 of file variables.py.

◆ UpperBoundedQuadraticExpression

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

Definition at line 141 of file variables.py.