PGROUTING  3.2
Pgr_topologicalSort< G > Class Template Reference

#include "pgr_topologicalSort.hpp"

Public Types

typedef G::V V
 

Public Member Functions

std::vector< pgr_topologicalSort_ttopologicalSort (G &graph)
 

Private Member Functions

std::vector< pgr_topologicalSort_tgeneratetopologicalSort (const G &graph)
 

Detailed Description

template<class G>
class Pgr_topologicalSort< G >

Definition at line 47 of file pgr_topologicalSort.hpp.

Member Typedef Documentation

◆ V

template<class G >
typedef G::V Pgr_topologicalSort< G >::V

Definition at line 56 of file pgr_topologicalSort.hpp.

Member Function Documentation

◆ generatetopologicalSort()

template<class G >
std::vector< pgr_topologicalSort_t > Pgr_topologicalSort< G >::generatetopologicalSort ( const G &  graph)
inlineprivate

Definition at line 63 of file pgr_topologicalSort.hpp.

64  {
65  std::vector< pgr_topologicalSort_t > results;
66 
67  typedef typename std::vector< V > container;
68  container c;
69 
70  /* abort in case of an interruption occurs (e.g. the query is being cancelled) */
71  CHECK_FOR_INTERRUPTS();
72 
73  boost::topological_sort(graph.graph, std::back_inserter(c));
74 
75  typename std::vector< V >::reverse_iterator ii;
76  for (ii = c.rbegin(); ii != c.rend(); ++ii) {
77  auto t = *ii;
79  tmp.sorted_v = graph.graph[t].id;
80  results.push_back(tmp);
81  }
82 
83  return results;
84  }

References pgr_topologicalSort_t::sorted_v.

◆ topologicalSort()

template<class G >
std::vector< pgr_topologicalSort_t > Pgr_topologicalSort< G >::topologicalSort ( G &  graph)

Definition at line 89 of file pgr_topologicalSort.hpp.

90  {
92  graph);
93 }

Referenced by pgr_topologicalSort().


The documentation for this class was generated from the following file:
Pgr_topologicalSort::generatetopologicalSort
std::vector< pgr_topologicalSort_t > generatetopologicalSort(const G &graph)
Definition: pgr_topologicalSort.hpp:63
pgr_topologicalSort_t
Definition: pgr_topologicalSort_t.h:37
pgr_topologicalSort_t::sorted_v
int64_t sorted_v
Definition: pgr_topologicalSort_t.h:39