PGROUTING  3.2
pgrouting::algorithms::detail Namespace Reference

Functions

std::vector< pgr_components_rtcomponentsResult (std::vector< std::vector< int64_t > > &components)
 
std::vector< pgr_components_rtcomponentsResult (std::vector< std::vector< int64_t >> &components)
 

Function Documentation

◆ componentsResult() [1/2]

std::vector<pgr_components_rt> pgrouting::algorithms::detail::componentsResult ( std::vector< std::vector< int64_t > > &  components)

Definition at line 38 of file componentsResult.cpp.

39  {
40  // sort identifier
41  for (auto &component : components) {
42  std::sort(component.begin(), component.end());
43  }
44  sort(components.begin(), components.end());
45 
46  // generate results
47  std::vector< pgr_components_rt > results;
48  for (const auto& component : components) {
49  auto component_id = component[0];
50  for (const auto element : component) {
51  results.push_back({component_id, element});
52  }
53  }
54  return results;
55 }

Referenced by pgrouting::algorithms::biconnectedComponents(), pgrouting::algorithms::pgr_connectedComponents(), and pgrouting::algorithms::strongComponents().

◆ componentsResult() [2/2]

std::vector<pgr_components_rt> pgrouting::algorithms::detail::componentsResult ( std::vector< std::vector< int64_t >> &  components)