MCPcopy Index your code
hub / github.com/PyVRP/PyVRP / operator[]

Method operator[]

pyvrp/cpp/Route.cpp:358–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356size_t Route::numTrips() const { return trips_.size(); }
357
358Client Route::operator[](size_t idx) const
359{
360 for (auto const &trip : trips_)
361 if (idx < trip.size())
362 return trip[idx];
363 else
364 idx -= trip.size();
365
366 throw std::out_of_range("Index out of range.");
367}
368
369Route::Iterator Route::begin() const { return Iterator(*this, 0); }
370

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected