Skip to content

Commit

Permalink
Merge branch 'main' of github.com:google/or-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
lperron committed Oct 9, 2023
2 parents 6d1a1b4 + 457e927 commit 0b393cc
Show file tree
Hide file tree
Showing 16 changed files with 1,739 additions and 163 deletions.
3 changes: 1 addition & 2 deletions ortools/algorithms/dynamic_partition.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#include <string>
#include <vector>

#include "absl/log/check.h"
#include "absl/types/span.h"
#include "ortools/base/logging.h"

namespace operations_research {

Expand Down Expand Up @@ -405,7 +405,6 @@ inline std::vector<absl::Span<const T>> SimpleDynamicPartition::GetParts(
starts.clear();
return result;
}

} // namespace operations_research

#endif // OR_TOOLS_ALGORITHMS_DYNAMIC_PARTITION_H_
6 changes: 0 additions & 6 deletions ortools/constraint_solver/python/constraint_solver.i
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ PY_CONVERT_HELPER_PTR(LocalSearchFilter);
PY_CONVERT_HELPER_PTR(LocalSearchFilterManager);
PY_CONVERT_HELPER_INTEXPR_AND_INTVAR();

%{

%}

// Actual conversions. This also includes the conversion to std::vector<Class>.
PY_CONVERT(IntVar);
PY_CONVERT(IntExpr);
Expand Down Expand Up @@ -2198,6 +2194,4 @@ class PyConstraint(Constraint):

def DebugString(self):
return "PyConstraint"


} // %pythoncode
2 changes: 1 addition & 1 deletion ortools/constraint_solver/python/pywrapcp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ class SumFilter(pywrapcp.IntVarLocalSearchFilter):
"""Filter to speed up LS computation."""

def __init__(self, int_vars):
pywrapcp.IntVarLocalSearchFilter.__init__(self, int_vars)
super.__init__(int_vars)
self.__sum = 0

def OnSynchronize(self, delta):
Expand Down
7 changes: 7 additions & 0 deletions ortools/constraint_solver/routing.h
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,13 @@ class RoutingModel {
const std::vector<std::pair<int, int> >&
GetDeliveryIndexPairs(int64_t node_index) const;
// clang-format on
/// Returns whether the node is a pickup (resp. delivery).
bool IsPickup(int64_t node_index) const {
return !GetPickupIndexPairs(node_index).empty();
}
bool IsDelivery(int64_t node_index) const {
return !GetDeliveryIndexPairs(node_index).empty();
}

/// Sets the Pickup and delivery policy of all vehicles. It is equivalent to
/// calling SetPickupAndDeliveryPolicyOfVehicle on all vehicles.
Expand Down
Loading

0 comments on commit 0b393cc

Please sign in to comment.