| 36 | using pyvrp::Trip; |
| 37 | |
| 38 | PYBIND11_MODULE(_pyvrp, m) |
| 39 | { |
| 40 | py::class_<DynamicBitset>(m, "DynamicBitset", DOC(pyvrp, DynamicBitset)) |
| 41 | .def(py::init<size_t>(), py::arg("num_bits")) |
| 42 | .def(py::self == py::self, py::arg("other")) // this is __eq__ |
| 43 | .def("all", &DynamicBitset::all) |
| 44 | .def("any", &DynamicBitset::any) |
| 45 | .def("none", &DynamicBitset::none) |
| 46 | .def("count", &DynamicBitset::count) |
| 47 | .def("__len__", &DynamicBitset::size) |
| 48 | .def("set", &DynamicBitset::set) |
| 49 | .def("reset", &DynamicBitset::reset) |
| 50 | .def( |
| 51 | "__getitem__", |
| 52 | [](DynamicBitset const &bitset, size_t idx) { return bitset[idx]; }, |
| 53 | py::arg("idx")) |
| 54 | .def( |
| 55 | "__setitem__", |
| 56 | [](DynamicBitset &bitset, size_t idx, bool value) |
| 57 | { bitset[idx] = value; }, |
| 58 | py::arg("idx"), |
| 59 | py::arg("value")) |
| 60 | .def("__or__", &DynamicBitset::operator|, py::arg("other")) |
| 61 | .def("__and__", &DynamicBitset::operator&, py::arg("other")) |
| 62 | .def("__xor__", &DynamicBitset::operator^, py::arg("other")) |
| 63 | .def("__invert__", &DynamicBitset::operator~); |
| 64 | |
| 65 | py::class_<ProblemData::Client>( |
| 66 | m, "Client", DOC(pyvrp, ProblemData, Client)) |
| 67 | .def(py::init<pyvrp::Coordinate, |
| 68 | pyvrp::Coordinate, |
| 69 | std::vector<pyvrp::Load>, |
| 70 | std::vector<pyvrp::Load>, |
| 71 | pyvrp::Duration, |
| 72 | pyvrp::Duration, |
| 73 | pyvrp::Duration, |
| 74 | pyvrp::Duration, |
| 75 | pyvrp::Cost, |
| 76 | bool, |
| 77 | std::optional<size_t>, |
| 78 | char const *>(), |
| 79 | py::arg("x"), |
| 80 | py::arg("y"), |
| 81 | py::arg("delivery") = py::list(), |
| 82 | py::arg("pickup") = py::list(), |
| 83 | py::arg("service_duration") = 0, |
| 84 | py::arg("tw_early") = 0, |
| 85 | py::arg("tw_late") = std::numeric_limits<pyvrp::Duration>::max(), |
| 86 | py::arg("release_time") = 0, |
| 87 | py::arg("prize") = 0, |
| 88 | py::arg("required") = true, |
| 89 | py::arg("group") = py::none(), |
| 90 | py::kw_only(), |
| 91 | py::arg("name") = "") |
| 92 | .def_readonly("x", &ProblemData::Client::x) |
| 93 | .def_readonly("y", &ProblemData::Client::y) |
| 94 | .def_readonly("delivery", |
| 95 | &ProblemData::Client::delivery, |
nothing calls this directly
no test coverage detected