diff --git a/docs/python/ortools/algorithms/pywrapknapsack_solver.html b/docs/python/ortools/algorithms/pywrapknapsack_solver.html index 21e8c28c5d..84e93903ce 100644 --- a/docs/python/ortools/algorithms/pywrapknapsack_solver.html +++ b/docs/python/ortools/algorithms/pywrapknapsack_solver.html @@ -3,7 +3,7 @@ - + pywrapknapsack_solver API documentation @@ -670,7 +670,7 @@ if the limit is reached.

diff --git a/docs/python/ortools/constraint_solver/pywrapcp.html b/docs/python/ortools/constraint_solver/pywrapcp.html index ae37e5600c..b611472e8e 100644 --- a/docs/python/ortools/constraint_solver/pywrapcp.html +++ b/docs/python/ortools/constraint_solver/pywrapcp.html @@ -3,7 +3,7 @@ - + pywrapcp API documentation @@ -746,7 +746,7 @@ class Solver(object): return _pywrapcp.Solver_SortingConstraint(self, vars, sorted) def LexicalLess(self, left: "std::vector< operations_research::IntVar * > const &", right: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *": - r""" std::vector<IntVar*>* const sorted); Creates a constraint that enforces that left is lexicographically less than right.""" + r""" Creates a constraint that enforces that left is lexicographically less than right.""" return _pywrapcp.Solver_LexicalLess(self, left, right) def LexicalLessOrEqual(self, left: "std::vector< operations_research::IntVar * > const &", right: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *": @@ -3316,7 +3316,7 @@ class ChangeValue(IntVarLocalSearchOperator): _pywrapcp.ChangeValue_swigregister(ChangeValue) class PathOperator(IntVarLocalSearchOperator): - r""" Base class of the local search operators dedicated to path modifications (a path is a set of nodes linked together by arcs). This family of neighborhoods supposes they are handling next variables representing the arcs (var[i] represents the node immediately after i on a path). Several services are provided: - arc manipulators (SetNext(), ReverseChain(), MoveChain()) - path inspectors (Next(), IsPathEnd()) - path iterators: operators need a given number of nodes to define a neighbor; this class provides the iteration on a given number of (base) nodes which can be used to define a neighbor (through the BaseNode method) Subclasses only need to override MakeNeighbor to create neighbors using the services above (no direct manipulation of assignments).""" + r""" Base class of the local search operators dedicated to path modifications (a path is a set of nodes linked together by arcs). This family of neighborhoods supposes they are handling next variables representing the arcs (var[i] represents the node immediately after i on a path). Several services are provided: - arc manipulators (SetNext(), ReverseChain(), MoveChain()) - path inspectors (Next(), Prev(), IsPathEnd()) - path iterators: operators need a given number of nodes to define a neighbor; this class provides the iteration on a given number of (base) nodes which can be used to define a neighbor (through the BaseNode method) Subclasses only need to override MakeNeighbor to create neighbors using the services above (no direct manipulation of assignments).""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -3675,7 +3675,7 @@ class RoutingModel(object): r""" For every vehicle of the routing model: - if total_slacks[vehicle] is not nullptr, constrains it to be the sum of slacks on that vehicle, that is, dimension->CumulVar(end) - dimension->CumulVar(start) - sum_{node in path of vehicle} dimension->FixedTransitVar(node). - if spans[vehicle] is not nullptr, constrains it to be dimension->CumulVar(end) - dimension->CumulVar(start) This does stronger propagation than a decomposition, and takes breaks into account.""" return _pywrapcp.RoutingModel_MakePathSpansAndTotalSlacks(self, dimension, spans, total_slacks) - def GetAllDimensionNames(self) -> "std::vector< ::std::string >": + def GetAllDimensionNames(self) -> "std::vector< std::string >": r""" Outputs the names of all dimensions added to the routing engine.""" return _pywrapcp.RoutingModel_GetAllDimensionNames(self) @@ -3694,6 +3694,9 @@ class RoutingModel(object): def GetLocalDimensionCumulOptimizers(self) -> "std::vector< std::unique_ptr< operations_research::LocalDimensionCumulOptimizer > > const &": return _pywrapcp.RoutingModel_GetLocalDimensionCumulOptimizers(self) + def GetLocalDimensionCumulMPOptimizers(self) -> "std::vector< std::unique_ptr< operations_research::LocalDimensionCumulOptimizer > > const &": + return _pywrapcp.RoutingModel_GetLocalDimensionCumulMPOptimizers(self) + def GetMutableGlobalCumulOptimizer(self, dimension: "RoutingDimension") -> "operations_research::GlobalDimensionCumulOptimizer *": r""" Returns the global/local dimension cumul optimizer for a given dimension, or nullptr if there is none.""" return _pywrapcp.RoutingModel_GetMutableGlobalCumulOptimizer(self, dimension) @@ -3701,6 +3704,9 @@ class RoutingModel(object): def GetMutableLocalCumulOptimizer(self, dimension: "RoutingDimension") -> "operations_research::LocalDimensionCumulOptimizer *": return _pywrapcp.RoutingModel_GetMutableLocalCumulOptimizer(self, dimension) + def GetMutableLocalCumulMPOptimizer(self, dimension: "RoutingDimension") -> "operations_research::LocalDimensionCumulOptimizer *": + return _pywrapcp.RoutingModel_GetMutableLocalCumulMPOptimizer(self, dimension) + def HasDimension(self, dimension_name: "std::string const &") -> "bool": r""" Returns true if a dimension exists for a given dimension name.""" return _pywrapcp.RoutingModel_HasDimension(self, dimension_name) @@ -3718,7 +3724,7 @@ class RoutingModel(object): return _pywrapcp.RoutingModel_SetPrimaryConstrainedDimension(self, dimension_name) def GetPrimaryConstrainedDimension(self) -> "std::string const &": - r""" Get the primary constrained dimension, or an empty std::string if it is unset.""" + r""" Get the primary constrained dimension, or an empty string if it is unset.""" return _pywrapcp.RoutingModel_GetPrimaryConstrainedDimension(self) def AddDisjunction(self, *args) -> "operations_research::RoutingModel::DisjunctionIndex": @@ -6094,15 +6100,15 @@ int index_; };

Subclasses

Instance variables

@@ -6640,10 +6646,10 @@ by the demons Posted during the post() method.

Subclasses

Methods

@@ -11530,7 +11536,7 @@ This dimension imposes that for all bins b, the weighted sum (weights->Run(i, (*args, **kwargs)
-

Base class of the local search operators dedicated to path modifications (a path is a set of nodes linked together by arcs). This family of neighborhoods supposes they are handling next variables representing the arcs (var[i] represents the node immediately after i on a path). Several services are provided: - arc manipulators (SetNext(), ReverseChain(), MoveChain()) - path inspectors (Next(), IsPathEnd()) - path iterators: operators need a given number of nodes to define a +

Base class of the local search operators dedicated to path modifications (a path is a set of nodes linked together by arcs). This family of neighborhoods supposes they are handling next variables representing the arcs (var[i] represents the node immediately after i on a path). Several services are provided: - arc manipulators (SetNext(), ReverseChain(), MoveChain()) - path inspectors (Next(), Prev(), IsPathEnd()) - path iterators: operators need a given number of nodes to define a neighbor; this class provides the iteration on a given number of (base) nodes which can be used to define a neighbor (through the BaseNode method) Subclasses only need to override MakeNeighbor to create neighbors using the services above (no direct manipulation of assignments).

@@ -11538,7 +11544,7 @@ nodes which can be used to define a neighbor (through the BaseNode method) Subcl Expand source code
class PathOperator(IntVarLocalSearchOperator):
-    r""" Base class of the local search operators dedicated to path modifications (a path is a set of nodes linked together by arcs). This family of neighborhoods supposes they are handling next variables representing the arcs (var[i] represents the node immediately after i on a path). Several services are provided: - arc manipulators (SetNext(), ReverseChain(), MoveChain()) - path inspectors (Next(), IsPathEnd()) - path iterators: operators need a given number of nodes to define a   neighbor; this class provides the iteration on a given number of (base)   nodes which can be used to define a neighbor (through the BaseNode method) Subclasses only need to override MakeNeighbor to create neighbors using the services above (no direct manipulation of assignments)."""
+    r""" Base class of the local search operators dedicated to path modifications (a path is a set of nodes linked together by arcs). This family of neighborhoods supposes they are handling next variables representing the arcs (var[i] represents the node immediately after i on a path). Several services are provided: - arc manipulators (SetNext(), ReverseChain(), MoveChain()) - path inspectors (Next(), Prev(), IsPathEnd()) - path iterators: operators need a given number of nodes to define a   neighbor; this class provides the iteration on a given number of (base)   nodes which can be used to define a neighbor (through the BaseNode method) Subclasses only need to override MakeNeighbor to create neighbors using the services above (no direct manipulation of assignments)."""
 
     thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 
@@ -11630,11 +11636,11 @@ nodes which can be used to define a neighbor (through the BaseNode method) Subcl
 
 

Subclasses

Methods

@@ -13120,7 +13126,7 @@ RoutingModel model(manager);

r""" For every vehicle of the routing model: - if total_slacks[vehicle] is not nullptr, constrains it to be the sum of slacks on that vehicle, that is, dimension->CumulVar(end) - dimension->CumulVar(start) - sum_{node in path of vehicle} dimension->FixedTransitVar(node). - if spans[vehicle] is not nullptr, constrains it to be dimension->CumulVar(end) - dimension->CumulVar(start) This does stronger propagation than a decomposition, and takes breaks into account.""" return _pywrapcp.RoutingModel_MakePathSpansAndTotalSlacks(self, dimension, spans, total_slacks) - def GetAllDimensionNames(self) -> "std::vector< ::std::string >": + def GetAllDimensionNames(self) -> "std::vector< std::string >": r""" Outputs the names of all dimensions added to the routing engine.""" return _pywrapcp.RoutingModel_GetAllDimensionNames(self) @@ -13139,6 +13145,9 @@ RoutingModel model(manager);

def GetLocalDimensionCumulOptimizers(self) -> "std::vector< std::unique_ptr< operations_research::LocalDimensionCumulOptimizer > > const &": return _pywrapcp.RoutingModel_GetLocalDimensionCumulOptimizers(self) + def GetLocalDimensionCumulMPOptimizers(self) -> "std::vector< std::unique_ptr< operations_research::LocalDimensionCumulOptimizer > > const &": + return _pywrapcp.RoutingModel_GetLocalDimensionCumulMPOptimizers(self) + def GetMutableGlobalCumulOptimizer(self, dimension: "RoutingDimension") -> "operations_research::GlobalDimensionCumulOptimizer *": r""" Returns the global/local dimension cumul optimizer for a given dimension, or nullptr if there is none.""" return _pywrapcp.RoutingModel_GetMutableGlobalCumulOptimizer(self, dimension) @@ -13146,6 +13155,9 @@ RoutingModel model(manager);

def GetMutableLocalCumulOptimizer(self, dimension: "RoutingDimension") -> "operations_research::LocalDimensionCumulOptimizer *": return _pywrapcp.RoutingModel_GetMutableLocalCumulOptimizer(self, dimension) + def GetMutableLocalCumulMPOptimizer(self, dimension: "RoutingDimension") -> "operations_research::LocalDimensionCumulOptimizer *": + return _pywrapcp.RoutingModel_GetMutableLocalCumulMPOptimizer(self, dimension) + def HasDimension(self, dimension_name: "std::string const &") -> "bool": r""" Returns true if a dimension exists for a given dimension name.""" return _pywrapcp.RoutingModel_HasDimension(self, dimension_name) @@ -13163,7 +13175,7 @@ RoutingModel model(manager);

return _pywrapcp.RoutingModel_SetPrimaryConstrainedDimension(self, dimension_name) def GetPrimaryConstrainedDimension(self) -> "std::string const &": - r""" Get the primary constrained dimension, or an empty std::string if it is unset.""" + r""" Get the primary constrained dimension, or an empty string if it is unset.""" return _pywrapcp.RoutingModel_GetPrimaryConstrainedDimension(self) def AddDisjunction(self, *args) -> "operations_research::RoutingModel::DisjunctionIndex": @@ -14334,7 +14346,7 @@ to2: the variable index of the second candidate destination node.

Expand source code -
def GetAllDimensionNames(self) -> "std::vector< ::std::string >":
+
def GetAllDimensionNames(self) -> "std::vector< std::string >":
     r""" Outputs the names of all dimensions added to the routing engine."""
     return _pywrapcp.RoutingModel_GetAllDimensionNames(self)
@@ -14618,6 +14630,19 @@ and end at the same node (single depot), this is the node returned.

+
+def GetLocalDimensionCumulMPOptimizers(self) +
+
+
+
+ +Expand source code + +
def GetLocalDimensionCumulMPOptimizers(self) -> "std::vector< std::unique_ptr< operations_research::LocalDimensionCumulOptimizer > > const &":
+    return _pywrapcp.RoutingModel_GetLocalDimensionCumulMPOptimizers(self)
+
+
def GetLocalDimensionCumulOptimizers(self)
@@ -14659,6 +14684,19 @@ and end at the same node (single depot), this is the node returned.

+
+def GetMutableLocalCumulMPOptimizer(self, dimension) +
+
+
+
+ +Expand source code + +
def GetMutableLocalCumulMPOptimizer(self, dimension: "RoutingDimension") -> "operations_research::LocalDimensionCumulOptimizer *":
+    return _pywrapcp.RoutingModel_GetMutableLocalCumulMPOptimizer(self, dimension)
+
+
def GetMutableLocalCumulOptimizer(self, dimension)
@@ -14799,13 +14837,13 @@ and end at the same node (single depot), this is the node returned.

def GetPrimaryConstrainedDimension(self)
-

Get the primary constrained dimension, or an empty std::string if it is unset.

+

Get the primary constrained dimension, or an empty string if it is unset.

Expand source code
def GetPrimaryConstrainedDimension(self) -> "std::string const &":
-    r""" Get the primary constrained dimension, or an empty std::string if it is unset."""
+    r""" Get the primary constrained dimension, or an empty string if it is unset."""
     return _pywrapcp.RoutingModel_GetPrimaryConstrainedDimension(self)
@@ -16085,9 +16123,9 @@ errors defaults to 'strict'.

Subclasses

Methods

@@ -18042,7 +18080,7 @@ solver() through the AddConstraint() method, return _pywrapcp.Solver_SortingConstraint(self, vars, sorted) def LexicalLess(self, left: "std::vector< operations_research::IntVar * > const &", right: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *": - r""" std::vector<IntVar*>* const sorted); Creates a constraint that enforces that left is lexicographically less than right.""" + r""" Creates a constraint that enforces that left is lexicographically less than right.""" return _pywrapcp.Solver_LexicalLess(self, left, right) def LexicalLessOrEqual(self, left: "std::vector< operations_research::IntVar * > const &", right: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *": @@ -20734,14 +20772,13 @@ Collect the last solution of the search. The variables will need to be added lat def LexicalLess(self, left, right)
-

std::vector* const -sorted); Creates a constraint that enforces that left is lexicographically less than right.

+

Creates a constraint that enforces that left is lexicographically less than right.

Expand source code
def LexicalLess(self, left: "std::vector< operations_research::IntVar * > const &", right: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *":
-    r"""                                         std::vector<IntVar*>* const                                         sorted); Creates a constraint that enforces that left is lexicographically less than right."""
+    r""" Creates a constraint that enforces that left is lexicographically less than right."""
     return _pywrapcp.Solver_LexicalLess(self, left, right)
@@ -23052,9 +23089,11 @@ p2/d2. - For a temporal requirement, p2 must be visited between p1 and d1.

GetGlobalDimensionCumulOptimizers
  • GetHardTypeIncompatibilitiesOfType
  • GetHomogeneousCost
  • +
  • GetLocalDimensionCumulMPOptimizers
  • GetLocalDimensionCumulOptimizers
  • GetMutableDimension
  • GetMutableGlobalCumulOptimizer
  • +
  • GetMutableLocalCumulMPOptimizer
  • GetMutableLocalCumulOptimizer
  • GetNonZeroCostClassesCount
  • GetNumOfSingletonNodes
  • @@ -23536,7 +23575,7 @@ p2/d2. - For a temporal requirement, p2 must be visited between p1 and d1.

    diff --git a/docs/python/ortools/graph/pywrapgraph.html b/docs/python/ortools/graph/pywrapgraph.html index f673fd96c3..9dcef27fdd 100644 --- a/docs/python/ortools/graph/pywrapgraph.html +++ b/docs/python/ortools/graph/pywrapgraph.html @@ -3,7 +3,7 @@ - + pywrapgraph API documentation @@ -1458,7 +1458,7 @@ Base 0 means to interpret the base from the string as an integer literal.

    diff --git a/docs/python/ortools/linear_solver/pywraplp.html b/docs/python/ortools/linear_solver/pywraplp.html index 669f8d11e4..9eacc5e653 100644 --- a/docs/python/ortools/linear_solver/pywraplp.html +++ b/docs/python/ortools/linear_solver/pywraplp.html @@ -3,7 +3,7 @@ - + pywraplp API documentation @@ -987,6 +987,9 @@ def ExportModelAsLpFormat(*args) -> "std::string": def ExportModelAsMpsFormat(*args) -> "std::string": return _pywraplp.ExportModelAsMpsFormat(*args) +def FindErrorInModelProto(input_model: "operations_research::MPModelProto const &") -> "std::string": + return _pywraplp.FindErrorInModelProto(input_model) + def setup_variable_operator(opname): setattr(Variable, opname, lambda self, *args: getattr(VariableExpr(self), opname)(*args)) @@ -1027,6 +1030,19 @@ for opname in LinearExpr.OVERRIDDEN_OPERATOR_METHODS: return _pywraplp.ExportModelAsMpsFormat(*args) +
    +def FindErrorInModelProto(input_model) +
    +
    +
    +
    + +Expand source code + +
    def FindErrorInModelProto(input_model: "operations_research::MPModelProto const &") -> "std::string":
    +    return _pywraplp.FindErrorInModelProto(input_model)
    +
    +
    @@ -3953,6 +3969,7 @@ automatically rounds it to the nearest integer; see: man 3 round).

  • Classes

    @@ -4122,7 +4139,7 @@ automatically rounds it to the nearest integer; see: man 3 round).

    diff --git a/docs/python/ortools/sat/python/cp_model.html b/docs/python/ortools/sat/python/cp_model.html index 777e641439..d919cb61b6 100644 --- a/docs/python/ortools/sat/python/cp_model.html +++ b/docs/python/ortools/sat/python/cp_model.html @@ -3,7 +3,7 @@ - + cp_model API documentation @@ -1588,6 +1588,10 @@ def EvaluateLinearExpr(expression, solution): """Evaluate a linear expression against a solution.""" if isinstance(expression, numbers.Integral): return expression + if not isinstance(expression, LinearExpr): + raise TypeError('Cannot interpret %s as a linear expression.' % + expression) + value = 0 to_process = [(expression, 1)] while to_process: @@ -1810,6 +1814,10 @@ class CpSolverSolutionCallback(pywrapsat.SolutionCallback): raise RuntimeError('Solve() has not be called.') if isinstance(expression, numbers.Integral): return expression + if not isinstance(expression, LinearExpr): + raise TypeError('Cannot interpret %s as a linear expression.' % + expression) + value = 0 to_process = [(expression, 1)] while to_process: @@ -5093,6 +5101,10 @@ and Value() methods.

    raise RuntimeError('Solve() has not be called.') if isinstance(expression, numbers.Integral): return expression + if not isinstance(expression, LinearExpr): + raise TypeError('Cannot interpret %s as a linear expression.' % + expression) + value = 0 to_process = [(expression, 1)] while to_process: @@ -5228,6 +5240,10 @@ Raises: raise RuntimeError('Solve() has not be called.') if isinstance(expression, numbers.Integral): return expression + if not isinstance(expression, LinearExpr): + raise TypeError('Cannot interpret %s as a linear expression.' % + expression) + value = 0 to_process = [(expression, 1)] while to_process: @@ -5552,7 +5568,6 @@ intervals into the schedule.

    class LinearExpr -(*args, **kwargs)

    Holds an integer linear expression.

    @@ -5765,11 +5780,11 @@ model.Add(cp_model.LinearExpr.ScalProd(expressions, coefficients) >= 0)

    Subclasses

      -
    • cp_model._ProductCst
    • -
    • cp_model._SumArray
    • -
    • cp_model._ScalProd
    • IntVar
    • cp_model._NotBooleanVariable
    • +
    • cp_model._ProductCst
    • +
    • cp_model._ScalProd
    • +
    • cp_model._SumArray

    Static methods

    @@ -6280,7 +6295,7 @@ def Term(cls, expression, coefficient): diff --git a/docs/python/ortools/util/sorted_interval_list.html b/docs/python/ortools/util/sorted_interval_list.html index 13b16f089a..3c523f4a3d 100644 --- a/docs/python/ortools/util/sorted_interval_list.html +++ b/docs/python/ortools/util/sorted_interval_list.html @@ -3,7 +3,7 @@ - + sorted_interval_list API documentation @@ -231,10 +231,7 @@ class Domain(object): return _sorted_interval_list.Domain_AdditionWith(self, domain) def __str__(self) -> "std::string": - r""" - Returns a compact std::string of a vector of intervals like - "[1,4][6][10,20]". - """ + r"""Returns a compact string of a vector of intervals like "[1,4][6][10,20]".""" return _sorted_interval_list.Domain___str__(self) def __lt__(self, other: "Domain") -> "bool": @@ -443,10 +440,7 @@ If left > right, this will result in the empty domain.

    return _sorted_interval_list.Domain_AdditionWith(self, domain) def __str__(self) -> "std::string": - r""" - Returns a compact std::string of a vector of intervals like - "[1,4][6][10,20]". - """ + r"""Returns a compact string of a vector of intervals like "[1,4][6][10,20]".""" return _sorted_interval_list.Domain___str__(self) def __lt__(self, other: "Domain") -> "bool": @@ -763,7 +757,7 @@ Int64 \ {kint64min} !!