43 std::vector < Basic_vertex > vertices) {
44 auto count(vertices.size());
46 vertices.begin(), vertices.end(),
48 {return lhs.id < rhs.id;});
51 vertices.begin(), vertices.end(),
53 {return lhs.id == rhs.id;}), vertices.end());
55 return vertices.size() - count;
60 std::vector < Basic_vertex > vertices,
61 const std::vector <pgr_edge_t > data_edges) {
62 if (data_edges.empty())
return vertices;
64 vertices.reserve(vertices.size() + data_edges.size() * 2);
66 for (
const auto edge : data_edges) {
70 vertices.push_back(vertex);
73 vertices.push_back(vertex);
79 std::stable_sort(vertices.begin(), vertices.end(),
81 {return lhs.id < rhs.id;});
84 std::unique(vertices.begin(), vertices.end(),
86 {return lhs.id == rhs.id;}), vertices.end());
93 const std::vector <pgr_edge_t > &data_edges) {
94 std::vector< Basic_vertex > vertices;
95 if (data_edges.empty())
return vertices;
97 vertices.reserve(data_edges.size() * 2);
99 for (
const auto edge : data_edges) {
103 vertices.push_back(vertex);
106 vertices.push_back(vertex);
112 std::stable_sort(vertices.begin(), vertices.end(),
114 {return lhs.id < rhs.id;});
117 std::unique(vertices.begin(), vertices.end(),
119 {return lhs.id == rhs.id;}), vertices.end());
127 std::vector < pgr_edge_t >(
128 data_edges, data_edges + count));
132 const std::vector < Basic_vertex > &vertices,
135 vertices, std::vector < pgr_edge_t >(
136 data_edges, data_edges + count));