PGROUTING  3.2
pgrouting::details Namespace Reference

Functions

std::vector< int64_t > clean_vids (std::vector< int64_t > vids)
 
std::vector< pgr_mst_rtget_no_edge_graph_result (std::vector< int64_t > vids)
 

Function Documentation

◆ clean_vids()

std::vector< int64_t > pgrouting::details::clean_vids ( std::vector< int64_t >  vids)

Definition at line 33 of file details.cpp.

33  {
34  std::sort(vids.begin(), vids.end());
35  vids.erase(
36  std::unique(vids.begin(), vids.end()),
37  vids.end());
38  vids.erase(
39  std::remove(vids.begin(), vids.end(), 0),
40  vids.end());
41  return vids;
42 }

Referenced by get_no_edge_graph_result(), pgrouting::functions::Pgr_mst< G >::mstBFS(), pgrouting::functions::Pgr_mst< G >::mstDD(), and pgrouting::functions::Pgr_mst< G >::mstDFS().

◆ get_no_edge_graph_result()

std::vector< pgr_mst_rt > pgrouting::details::get_no_edge_graph_result ( std::vector< int64_t >  vids)

Definition at line 45 of file details.cpp.

46  {
47  std::vector<pgr_mst_rt> results;
48  if (vids.empty()) return results;
49  for (auto const root : clean_vids(vids)) {
50  results.push_back({root, 0, root, -1, 0.0, 0.0});
51  }
52  return results;
53 }

References clean_vids().

Referenced by do_pgr_kruskal(), and do_pgr_prim().

pgrouting::details::clean_vids
std::vector< int64_t > clean_vids(std::vector< int64_t > vids)
Definition: details.cpp:33