PGROUTING  2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pgrouting Namespace Reference

Book keeping class for swapping orders between vehicles. More...

Namespaces

 algorithms
 
 bidirectional
 
 contraction
 
 flow
 
 graph
 boost::graph simplified to pgRouting needs
 
 tsp
 
 vrp
 

Classes

class  Basic_edge
 
class  Basic_vertex
 
class  CH_edge
 
class  CH_vertex
 
class  Identifier
 
class  Line_vertex
 
class  Pgr_messages
 
class  XY_vertex
 

Typedefs

typedef boost::adjacency_list
< boost::listS, boost::vecS,
boost::directedS > 
BasicDirectedGraph
 
typedef boost::adjacency_list
< boost::listS, boost::vecS,
boost::undirectedS > 
BasicUndirectedGraph
 
typedef
graph::Pgr_contractionGraph
< boost::adjacency_list
< boost::listS, boost::vecS,
boost::bidirectionalS,
CH_vertex, CH_edge >
, CH_vertex, CH_edge
CHDirectedGraph
 
typedef
graph::Pgr_contractionGraph
< boost::adjacency_list
< boost::listS, boost::vecS,
boost::undirectedS, CH_vertex,
CH_edge >, CH_vertex, CH_edge
CHUndirectedGraph
 
typedef
graph::Pgr_componentsGraph
< boost::adjacency_list
< boost::vecS, boost::vecS,
boost::undirectedS,
Basic_vertex, Basic_edge >
, Basic_vertex, Basic_edge
ComponentsUndiGraph
 
typedef boost::adjacency_list
< boost::listS, boost::vecS,
boost::directedS,
boost::property
< boost::vertex_index_t,
int64_t, boost::property
< boost::vertex_color_t,
boost::default_color_type,
boost::property
< boost::vertex_distance_t,
int64_t, boost::property
< boost::vertex_predecessor_t,
Traits::edge_descriptor >
> > >, boost::property
< boost::edge_capacity_t,
int64_t, boost::property
< boost::edge_residual_capacity_t,
int64_t, boost::property
< boost::edge_reverse_t,
Traits::edge_descriptor > > > > 
FlowGraph
 
typedef graph::Pgr_lineGraph
< boost::adjacency_list
< boost::vecS, boost::vecS,
boost::bidirectionalS,
Line_vertex, Basic_edge >
, Line_vertex, Basic_edge
LinearDirectedGraph
 
typedef Simple_cartasian::Point_2 Point
 
typedef CGAL::Simple_cartesian
< double > 
Simple_cartasian
 
typedef
boost::adjacency_list_traits
< boost::vecS, boost::vecS,
boost::directedS > 
Traits
 
Graph types
Type pgRouting
UndirectedGraph Basic undirected graph
DirectedGraph Basic directed graph
xyUndirectedGraph X & Y values stored on the vertex
xyDirectedGraph X & Y values stored on the vertex
typedef graph::Pgr_base_graph
< boost::adjacency_list
< boost::vecS, boost::vecS,
boost::undirectedS,
Basic_vertex, Basic_edge >
, Basic_vertex, Basic_edge
UndirectedGraph
 
typedef graph::Pgr_base_graph
< boost::adjacency_list
< boost::vecS, boost::vecS,
boost::bidirectionalS,
Basic_vertex, Basic_edge >
, Basic_vertex, Basic_edge
DirectedGraph
 
typedef graph::Pgr_base_graph
< boost::adjacency_list
< boost::listS, boost::vecS,
boost::undirectedS, XY_vertex,
Basic_edge >, XY_vertex,
Basic_edge
xyUndirectedGraph
 
typedef graph::Pgr_base_graph
< boost::adjacency_list
< boost::listS, boost::vecS,
boost::bidirectionalS,
XY_vertex, Basic_edge >
, XY_vertex, Basic_edge
xyDirectedGraph
 

Functions

size_t check_vertices (std::vector< Basic_vertex > vertices)
 
size_t check_vertices (std::vector< XY_vertex > vertices)
 
size_t check_vertices (std::vector< CH_vertex > vertices)
 
std::vector< Basic_vertexextract_vertices (std::vector< Basic_vertex > vertices, const std::vector< pgr_edge_t > data_edges)
 
std::vector< XY_vertexextract_vertices (const std::vector< Pgr_edge_xy_t > &data_edges)
 
std::vector< Basic_vertexextract_vertices (const std::vector< pgr_edge_t > data_edges)
 
std::vector< XY_vertexextract_vertices (const Pgr_edge_xy_t *data_edges, int64_t count)
 
std::vector< Basic_vertexextract_vertices (const pgr_edge_t *data_edges, int64_t count)
 
std::vector< Basic_vertexextract_vertices (std::vector< Basic_vertex > vertices, const pgr_edge_t *data_edges, int64_t count)
 
std::ostream & operator<< (std::ostream &log, const XY_vertex &v)
 
std::ostream & operator<< (std::ostream &log, const Basic_vertex &v)
 
std::ostream & operator<< (std::ostream &log, const Identifier &ident)
 
std::ostream & operator<< (std::ostream &os, const CH_vertex &v)
 
std::ostream & operator<< (std::ostream &os, const CH_edge &e)
 

Detailed Description

Book keeping class for swapping orders between vehicles.

Typedef Documentation

typedef boost::adjacency_list<boost::listS, boost::vecS, boost::directedS> pgrouting::BasicDirectedGraph

Definition at line 50 of file pgr_maximumcardinalitymatching.hpp.

typedef boost::adjacency_list<boost::listS, boost::vecS, boost::undirectedS> pgrouting::BasicUndirectedGraph

Definition at line 48 of file pgr_maximumcardinalitymatching.hpp.

typedef graph::Pgr_contractionGraph< boost::adjacency_list < boost::listS, boost::vecS, boost::bidirectionalS, CH_vertex, CH_edge >, CH_vertex, CH_edge > pgrouting::CHDirectedGraph

Definition at line 61 of file pgr_contractionGraph.hpp.

typedef graph::Pgr_contractionGraph< boost::adjacency_list < boost::listS, boost::vecS, boost::undirectedS, CH_vertex, CH_edge >, CH_vertex, CH_edge > pgrouting::CHUndirectedGraph

Definition at line 55 of file pgr_contractionGraph.hpp.

typedef graph::Pgr_componentsGraph<boost::adjacency_list < boost::vecS, boost::vecS, boost::undirectedS, Basic_vertex, Basic_edge >, Basic_vertex, Basic_edge > pgrouting::ComponentsUndiGraph

Definition at line 53 of file pgr_componentsGraph.hpp.

typedef graph::Pgr_base_graph<boost::adjacency_list < boost::vecS, boost::vecS, boost::bidirectionalS, Basic_vertex, Basic_edge >, Basic_vertex, Basic_edge > pgrouting::DirectedGraph

Definition at line 239 of file pgr_base_graph.hpp.

typedef boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::property<boost::vertex_index_t, int64_t, boost::property<boost::vertex_color_t, boost::default_color_type, boost::property<boost::vertex_distance_t, int64_t, boost::property<boost::vertex_predecessor_t, Traits::edge_descriptor> > > >, boost::property<boost::edge_capacity_t, int64_t, boost::property<boost::edge_residual_capacity_t, int64_t, boost::property<boost::edge_reverse_t, Traits::edge_descriptor> > > > pgrouting::FlowGraph

Definition at line 50 of file pgr_flowgraph.hpp.

typedef graph::Pgr_lineGraph<boost::adjacency_list < boost::vecS, boost::vecS, boost::bidirectionalS, Line_vertex, Basic_edge >, Line_vertex, Basic_edge > pgrouting::LinearDirectedGraph

Definition at line 51 of file pgr_lineGraph.hpp.

typedef Simple_cartasian::Point_2 pgrouting::Point

Definition at line 48 of file xy_vertex.h.

typedef CGAL::Simple_cartesian<double> pgrouting::Simple_cartasian

Definition at line 47 of file xy_vertex.h.

typedef boost::adjacency_list_traits<boost::vecS, boost::vecS, boost::directedS> pgrouting::Traits

Definition at line 38 of file pgr_flowgraph.hpp.

typedef graph::Pgr_base_graph<boost::adjacency_list < boost::vecS, boost::vecS, boost::undirectedS, Basic_vertex, Basic_edge >, Basic_vertex, Basic_edge > pgrouting::UndirectedGraph

Definition at line 233 of file pgr_base_graph.hpp.

typedef graph::Pgr_base_graph<boost::adjacency_list < boost::listS, boost::vecS, boost::bidirectionalS, XY_vertex, Basic_edge >, XY_vertex, Basic_edge > pgrouting::xyDirectedGraph

Definition at line 251 of file pgr_base_graph.hpp.

typedef graph::Pgr_base_graph<boost::adjacency_list < boost::listS, boost::vecS, boost::undirectedS, XY_vertex, Basic_edge >, XY_vertex, Basic_edge > pgrouting::xyUndirectedGraph

Definition at line 245 of file pgr_base_graph.hpp.

Function Documentation

size_t pgrouting::check_vertices ( std::vector< Basic_vertex >  vertices)

Definition at line 42 of file basic_vertex.cpp.

References pgrouting::Basic_vertex::id.

Referenced by pgrouting::graph::Pgr_base_graph< G, T_V, T_E >::insert_edges(), and pgrouting::graph::Pgr_base_graph< G, T_V, T_E >::Pgr_base_graph().

43  {
44  auto count(vertices.size());
45  std::stable_sort(
46  vertices.begin(), vertices.end(),
47  [](const Basic_vertex &lhs, const Basic_vertex &rhs)
48  {return lhs.id < rhs.id;});
49  vertices.erase(
50  std::unique(
51  vertices.begin(), vertices.end(),
52  [](const Basic_vertex &lhs, const Basic_vertex &rhs)
53  {return lhs.id == rhs.id;}), vertices.end());
54 
55  return vertices.size() - count;
56  }

Here is the caller graph for this function:

size_t pgrouting::check_vertices ( std::vector< XY_vertex >  vertices)

Definition at line 49 of file xy_vertex.cpp.

References pgrouting::XY_vertex::id.

50  {
51  auto count(vertices.size());
52  std::stable_sort(
53  vertices.begin(), vertices.end(),
54  [](const XY_vertex &lhs, const XY_vertex &rhs)
55  {return lhs.id < rhs.id;});
56  vertices.erase(
57  std::unique(
58  vertices.begin(), vertices.end(),
59  [](const XY_vertex &lhs, const XY_vertex &rhs)
60  {return lhs.id == rhs.id;}), vertices.end());
61 
62  return count - vertices.size();
63 }
size_t pgrouting::check_vertices ( std::vector< CH_vertex >  vertices)
std::vector< Basic_vertex > pgrouting::extract_vertices ( std::vector< Basic_vertex >  vertices,
const std::vector< pgr_edge_t data_edges 
)

Definition at line 59 of file basic_vertex.cpp.

References pgrouting::Basic_vertex::id, edge::source, and edge::target.

Referenced by do_pgr_astarManyToMany(), do_pgr_bdAstar(), do_pgr_driving_many_to_dist(), do_pgr_test_c_edges(), do_pgr_testXYedges(), do_pgr_withPoints(), do_pgr_withPointsKsp(), extract_vertices(), and pgrouting::graph::Pgr_base_graph< G, T_V, T_E >::insert_edges().

61  {
62  if (data_edges.empty()) return vertices;
63 
64  vertices.reserve(vertices.size() + data_edges.size() * 2);
65 
66  for (const auto edge : data_edges) {
67  Basic_vertex vertex;
68 
69  vertex.id = edge.source;
70  vertices.push_back(vertex);
71 
72  vertex.id = edge.target;
73  vertices.push_back(vertex);
74  }
75 
76  /*
77  * sort and delete duplicates
78  */
79  std::stable_sort(vertices.begin(), vertices.end(),
80  [](const Basic_vertex &lhs, const Basic_vertex &rhs)
81  {return lhs.id < rhs.id;});
82 
83  vertices.erase(
84  std::unique(vertices.begin(), vertices.end(),
85  [](const Basic_vertex &lhs, const Basic_vertex &rhs)
86  {return lhs.id == rhs.id;}), vertices.end());
87 
88  return vertices;
89  }
Definition: trsp.h:31
long target
Definition: trsp.h:34
long source
Definition: trsp.h:33

Here is the caller graph for this function:

std::vector< XY_vertex > pgrouting::extract_vertices ( const std::vector< Pgr_edge_xy_t > &  data_edges)

Definition at line 66 of file xy_vertex.cpp.

References pgrouting::XY_vertex::id.

67  {
68 
69  std::vector< XY_vertex > vertices;
70  if (data_edges.empty()) return vertices;
71 
72  vertices.reserve(data_edges.size() * 2);
73 
74  for (const auto edge : data_edges) {
75  XY_vertex v_source(edge, true);
76  vertices.push_back(v_source);
77 
78  XY_vertex v_target(edge, false);
79  vertices.push_back(v_target);
80  }
81 
82  /*
83  * sort and delete duplicates
84  */
85  std::stable_sort(
86  vertices.begin(), vertices.end(),
87  [](const XY_vertex &lhs, const XY_vertex &rhs)
88  {return lhs.id < rhs.id;});
89  vertices.erase(
90  std::unique(
91  vertices.begin(), vertices.end(),
92  [](const XY_vertex &lhs, const XY_vertex &rhs)
93  {return lhs.id == rhs.id;}), vertices.end());
94  return vertices;
95 }
Definition: trsp.h:31
std::vector< Basic_vertex > pgrouting::extract_vertices ( const std::vector< pgr_edge_t data_edges)

Definition at line 92 of file basic_vertex.cpp.

References pgrouting::Basic_vertex::id, edge::source, and edge::target.

93  {
94  std::vector< Basic_vertex > vertices;
95  if (data_edges.empty()) return vertices;
96 
97  vertices.reserve(data_edges.size() * 2);
98 
99  for (const auto edge : data_edges) {
100  Basic_vertex vertex;
101 
102  vertex.id = edge.source;
103  vertices.push_back(vertex);
104 
105  vertex.id = edge.target;
106  vertices.push_back(vertex);
107  }
108 
109  /*
110  * sort and delete duplicates
111  */
112  std::stable_sort(vertices.begin(), vertices.end(),
113  [](const Basic_vertex &lhs, const Basic_vertex &rhs)
114  {return lhs.id < rhs.id;});
115 
116  vertices.erase(
117  std::unique(vertices.begin(), vertices.end(),
118  [](const Basic_vertex &lhs, const Basic_vertex &rhs)
119  {return lhs.id == rhs.id;}), vertices.end());
120 
121  return vertices;
122  }
Definition: trsp.h:31
long target
Definition: trsp.h:34
long source
Definition: trsp.h:33
std::vector< XY_vertex > pgrouting::extract_vertices ( const Pgr_edge_xy_t data_edges,
int64_t  count 
)

Definition at line 98 of file xy_vertex.cpp.

References extract_vertices().

99  {
100  return extract_vertices(
101  std::vector < Pgr_edge_xy_t >(data_edges, data_edges + count));
102 }
std::vector< XY_vertex > extract_vertices(const Pgr_edge_xy_t *data_edges, int64_t count)
Definition: xy_vertex.cpp:98

Here is the call graph for this function:

std::vector< Basic_vertex > pgrouting::extract_vertices ( const pgr_edge_t data_edges,
int64_t  count 
)

Definition at line 124 of file basic_vertex.cpp.

References extract_vertices().

125  {
126  return extract_vertices(
127  std::vector < pgr_edge_t >(
128  data_edges, data_edges + count));
129  }
std::vector< Basic_vertex > extract_vertices(std::vector< Basic_vertex > vertices, const pgr_edge_t *data_edges, int64_t count)

Here is the call graph for this function:

std::vector< Basic_vertex > pgrouting::extract_vertices ( std::vector< Basic_vertex >  vertices,
const pgr_edge_t data_edges,
int64_t  count 
)

Definition at line 131 of file basic_vertex.cpp.

References extract_vertices().

133  {
134  return extract_vertices(
135  vertices, std::vector < pgr_edge_t >(
136  data_edges, data_edges + count));
137  }
std::vector< Basic_vertex > extract_vertices(std::vector< Basic_vertex > vertices, const pgr_edge_t *data_edges, int64_t count)

Here is the call graph for this function:

std::ostream& pgrouting::operator<< ( std::ostream &  log,
const XY_vertex &  v 
)

Definition at line 36 of file xy_vertex.cpp.

References pgrouting::XY_vertex::id, and pgrouting::XY_vertex::point.

36  {
37  log << v.id << "(" << v.point.x() << "," << v.point.y() << ")";
38  return log;
39 }
std::ostream& pgrouting::operator<< ( std::ostream &  log,
const Basic_vertex &  v 
)

Definition at line 37 of file basic_vertex.cpp.

References pgrouting::Basic_vertex::id.

37  {
38  log << v.id;
39  return log;
40  }
std::ostream& pgrouting::operator<< ( std::ostream &  log,
const Identifier &  ident 
)

Definition at line 51 of file identifier.cpp.

References pgrouting::Identifier::id(), and pgrouting::Identifier::idx().

51  {
52  log << "id(idx) = " << ident.id() << "(" << ident.idx() << ")";
53  return log;
54 }

Here is the call graph for this function:

std::ostream& pgrouting::operator<< ( std::ostream &  os,
const CH_vertex &  v 
)

Definition at line 56 of file ch_vertex.cpp.

References pgrouting::CH_vertex::contracted_vertices(), and pgrouting::CH_vertex::id.

56  {
57  os << "{id: " << v.id << ",\t"
58  << "contracted vertices: "
59  << v.contracted_vertices()
60  << "}";
61  return os;
62 }

Here is the call graph for this function:

std::ostream& pgrouting::operator<< ( std::ostream &  os,
const CH_edge &  e 
)

Definition at line 66 of file ch_edge.cpp.

References pgrouting::CH_edge::contracted_vertices(), pgrouting::CH_edge::cost, pgrouting::CH_edge::id, pgrouting::CH_edge::source, and pgrouting::CH_edge::target.

66  {
67  os << "{id: " << e.id << ",\t"
68  << "source: " << e.source << ",\t"
69  << "target: " << e.target << ",\t"
70  << "cost: " << e.cost << ",\t"
71  << "contracted vertices: "
72  << e.contracted_vertices()
73  << "}";
74  return os;
75 }

Here is the call graph for this function: