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

Detailed Description

Data structures for linear and quadratic constraints.

In contrast to BoundedLinearExpression and related structures, there is no
offset inside the inequality.

This is not part of the MathOpt public API, do not depend on it externally.

Classes

class  NormalizedLinearInequality
class  NormalizedQuadraticInequality

Functions

TypeError _bool_error ()
NormalizedLinearInequality _normalize_bounded_linear_expression (variables.BoundedLinearTypes bounded_expr)
NormalizedLinearInequality as_normalized_linear_inequality (Optional[Union[bool, variables.BoundedLinearTypes]] bounded_expr=None, *, Optional[float] lb=None, Optional[float] ub=None, Optional[variables.LinearTypes] expr=None)
NormalizedQuadraticInequality _normalize_bounded_quadratic_expression (Union[variables.BoundedQuadraticTypes, variables.BoundedLinearTypes] bounded_expr)
NormalizedQuadraticInequality as_normalized_quadratic_inequality (Optional[Union[bool, variables.BoundedLinearTypes, variables.BoundedQuadraticTypes]] bounded_expr=None, *, Optional[float] lb=None, Optional[float] ub=None, Optional[variables.QuadraticTypes] expr=None)

Variables

tuple _BoundedLinearExpressions
tuple _BoundedQuadraticExpressions
tuple _BoundedExpressions

Function Documentation

◆ _bool_error()

TypeError ortools.math_opt.python.normalized_inequality._bool_error ( )
protected

Definition at line 51 of file normalized_inequality.py.

◆ _normalize_bounded_linear_expression()

NormalizedLinearInequality ortools.math_opt.python.normalized_inequality._normalize_bounded_linear_expression ( variables.BoundedLinearTypes bounded_expr)
protected
Converts a bounded linear expression into a NormalizedLinearInequality.

Definition at line 96 of file normalized_inequality.py.

◆ _normalize_bounded_quadratic_expression()

NormalizedQuadraticInequality ortools.math_opt.python.normalized_inequality._normalize_bounded_quadratic_expression ( Union[variables.BoundedQuadraticTypes, variables.BoundedLinearTypes] bounded_expr)
protected
Converts a bounded quadratic expression into a NormalizedQuadraticInequality.

Definition at line 210 of file normalized_inequality.py.

◆ as_normalized_linear_inequality()

NormalizedLinearInequality ortools.math_opt.python.normalized_inequality.as_normalized_linear_inequality ( Optional[Union[bool, variables.BoundedLinearTypes]] bounded_expr = None,
* ,
Optional[float] lb = None,
Optional[float] ub = None,
Optional[variables.LinearTypes] expr = None )
Builds a NormalizedLinearInequality.

If bounded_expr is not None, then all other arguments must be None.

If expr has a nonzero offset, it will be subtracted from both lb and ub.

When bounded_expr is unset and a named argument is unset, we use the defaults:
  * lb: -math.inf
  * ub: math.inf
  * expr: 0

Args:
  bounded_expr: a linear inequality describing the constraint.
  lb: The lower bound when bounded_expr is None.
  ub: The upper bound if bounded_expr is None.
  expr: The expression when bounded_expr is None.

Returns:
  A NormalizedLinearInequality representing the linear constraint.

Definition at line 125 of file normalized_inequality.py.

◆ as_normalized_quadratic_inequality()

NormalizedQuadraticInequality ortools.math_opt.python.normalized_inequality.as_normalized_quadratic_inequality ( Optional[ Union[bool, variables.BoundedLinearTypes, variables.BoundedQuadraticTypes] ] bounded_expr = None,
* ,
Optional[float] lb = None,
Optional[float] ub = None,
Optional[variables.QuadraticTypes] expr = None )
Builds a NormalizedLinearInequality.

If bounded_expr is not None, then all other arguments must be None.

If expr has a nonzero offset, it will be subtracted from both lb and ub.

When bounded_expr is unset and a named argument is unset, we use the defaults:
  * lb: -math.inf
  * ub: math.inf
  * expr: 0

Args:
  bounded_expr: a quadratic inequality describing the constraint.
  lb: The lower bound when bounded_expr is None.
  ub: The upper bound if bounded_expr is None.
  expr: The expression when bounded_expr is None.

Returns:
  A NormalizedLinearInequality representing the linear constraint.

Definition at line 242 of file normalized_inequality.py.

Variable Documentation

◆ _BoundedExpressions

tuple ortools.math_opt.python.normalized_inequality._BoundedExpressions
protected
Initial value:
1= (
2 bounded_expressions.LowerBoundedExpression,
3 bounded_expressions.UpperBoundedExpression,
4 bounded_expressions.BoundedExpression,
5)

Definition at line 44 of file normalized_inequality.py.

◆ _BoundedLinearExpressions

tuple ortools.math_opt.python.normalized_inequality._BoundedLinearExpressions
protected
Initial value:
1= (
2 variables.LowerBoundedLinearExpression,
3 variables.UpperBoundedLinearExpression,
4 variables.BoundedLinearExpression,
5)

Definition at line 29 of file normalized_inequality.py.

◆ _BoundedQuadraticExpressions

tuple ortools.math_opt.python.normalized_inequality._BoundedQuadraticExpressions
protected
Initial value:
1= (
2 variables.LowerBoundedLinearExpression,
3 variables.UpperBoundedLinearExpression,
4 variables.BoundedLinearExpression,
5 variables.LowerBoundedQuadraticExpression,
6 variables.UpperBoundedQuadraticExpression,
7 variables.BoundedQuadraticExpression,
8)

Definition at line 35 of file normalized_inequality.py.