diff --git a/docs/python/ortools/sat/python/cp_model.html b/docs/python/ortools/sat/python/cp_model.html index ceb9a0ee59..8474938065 100644 --- a/docs/python/ortools/sat/python/cp_model.html +++ b/docs/python/ortools/sat/python/cp_model.html @@ -119,6 +119,13 @@ from ortools.util import sorted_interval_list Domain = sorted_interval_list.Domain +# Documentation cleaning. +__pdoc__ = {} +__pdoc__['DisplayBounds'] = False +__pdoc__['EvaluateLinearExpr'] = False +__pdoc__['EvaluateBooleanExpression'] = False +__pdoc__['ShortName'] = False + # The classes below allow linear expressions to be expressed naturally with the # usual arithmetic operators +-*/ and with constant numbers, which makes the # python API very intuitive. See ../samples/*.py for examples. @@ -1885,104 +1892,6 @@ class VarArraySolutionPrinter(CpSolverSolutionCallback):
-

Functions

-
-
-def DisplayBounds(bounds) -
-
-

Displays a flattened list of intervals.

-
-Source code -
def DisplayBounds(bounds):
-    """Displays a flattened list of intervals."""
-    out = ''
-    for i in range(0, len(bounds), 2):
-        if i != 0:
-            out += ', '
-        if bounds[i] == bounds[i + 1]:
-            out += str(bounds[i])
-        else:
-            out += str(bounds[i]) + '..' + str(bounds[i + 1])
-    return out
-
-
-
-def EvaluateBooleanExpression(literal, solution) -
-
-

Evaluate a boolean expression against a solution.

-
-Source code -
def EvaluateBooleanExpression(literal, solution):
-    """Evaluate a boolean expression against a solution."""
-    if isinstance(literal, numbers.Integral):
-        return bool(literal)
-    elif isinstance(literal, IntVar) or isinstance(literal,
-                                                   _NotBooleanVariable):
-        index = literal.Index()
-        if index >= 0:
-            return bool(solution.solution[index])
-        else:
-            return not solution.solution[-index - 1]
-    else:
-        raise TypeError(
-            'Cannot interpret %s as a boolean expression.' % literal)
-
-
-
-def EvaluateLinearExpr(expression, solution) -
-
-

Evaluate a linear expression against a solution.

-
-Source code -
def EvaluateLinearExpr(expression, solution):
-    """Evaluate a linear expression against a solution."""
-    if isinstance(expression, numbers.Integral):
-        return expression
-    value = 0
-    to_process = [(expression, 1)]
-    while to_process:
-        expr, coef = to_process.pop()
-        if isinstance(expr, _ProductCst):
-            to_process.append((expr.Expression(), coef * expr.Coefficient()))
-        elif isinstance(expr, _SumArray):
-            for e in expr.Expressions():
-                to_process.append((e, coef))
-            value += expr.Constant() * coef
-        elif isinstance(expr, _ScalProd):
-            for e, c in zip(expr.Expressions(), expr.Coefficients()):
-                to_process.append((e, coef * c))
-            value += expr.Constant() * coef
-        elif isinstance(expr, IntVar):
-            value += coef * solution.solution[expr.Index()]
-        elif isinstance(expr, _NotBooleanVariable):
-            value += coef * (1 - solution.solution[expr.Not().Index()])
-    return value
-
-
-
-def ShortName(model, i) -
-
-

Returns a short name of an integer variable, or its negation.

-
-Source code -
def ShortName(model, i):
-    """Returns a short name of an integer variable, or its negation."""
-    if i < 0:
-        return 'Not(%s)' % ShortName(model, -i - 1)
-    v = model.variables[i]
-    if v.name:
-        return v.name
-    elif len(v.domain) == 2 and v.domain[0] == v.domain[1]:
-        return str(v.domain[0])
-    else:
-        return '[%s]' % DisplayBounds(v.domain)
-
-
-

Classes

@@ -5971,14 +5880,6 @@ def Sum(cls, expressions):