pgRouting
pgRouting extends the PostGIS / PostgreSQL geospatial database to provide geospatial routing functionality.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Pgr_dijkstra< G > Class Template Reference

#include "pgr_dijkstra.hpp"

Classes

class  dijkstra_distance_visitor
 class for stopping when a distance/cost has being surpassed More...
 
class  dijkstra_many_goal_visitor
 class for stopping when all targets are found More...
 
class  dijkstra_one_goal_visitor
 class for stopping when 1 target is found More...
 
struct  found_goals
 exception for termination More...
 

Public Types

typedef G::V V
 

Public Member Functions

drivingDistance
void drivingDistance (G &graph, Path &path, int64_t start_vertex, double distance)
 1 to distance More...
 
void drivingDistance (G &graph, std::deque< Path > &paths, std::vector< int64_t > start_vertex, double distance, bool equiCostFlag)
 many to distance More...
 
Dijkstra
void dijkstra (G &graph, Path &path, int64_t start_vertex, int64_t end_vertex, bool only_cost=false)
 one to one More...
 
void dijkstra (G &graph, std::deque< Path > &paths, const std::vector< int64_t > &start_vertex, int64_t end_vertex, bool only_cost=false)
 Many to one. More...
 
void dijkstra (G &graph, std::deque< Path > &paths, const std::vector< int64_t > &start_vertex, const std::vector< int64_t > &end_vertex, bool only_cost=false)
 Many to Many. More...
 
void dijkstra (G &graph, std::deque< Path > &paths, int64_t start_vertex, const std::vector< int64_t > &end_vertex, bool only_cost=false)
 one to Many More...
 

Private Member Functions

void clear ()
 
bool dijkstra_1_to_1 (G &graph, V source, V target)
 Call to Dijkstra 1 source to 1 target. More...
 
bool dijkstra_1_to_distance (G &graph, V source, double distance)
 Call to Dijkstra 1 source to distance. More...
 
bool dijkstra_1_to_many (G &graph, V source, const std::vector< V > &targets)
 Call to Dijkstra 1 source to many targets. More...
 
void get_cost (const G &graph, V source, V target, Path &path) const
 
void get_cost (const G &graph, std::deque< Path > &paths, V source, std::vector< V > &targets) const
 
void get_nodesInDistance (G &graph, Path &path, V source, double distance)
 
void get_path (const G &graph, V source, V target, Path &path) const
 
void get_path (const G &graph, std::deque< Path > &paths, V source, std::vector< V > &targets) const
 

Private Attributes

members;
std::vector< Vpredecessors
 
std::vector< double > distances
 
std::deque< VnodesInDistance
 

Detailed Description

template<class G>
class Pgr_dijkstra< G >

Definition at line 54 of file pgr_dijkstra.hpp.

Member Typedef Documentation

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

Definition at line 135 of file pgr_dijkstra.hpp.

Member Function Documentation

template<class G>
void Pgr_dijkstra< G >::clear ( )
inlineprivate
template<class G >
void Pgr_dijkstra< G >::dijkstra ( G &  graph,
Path path,
int64_t  start_vertex,
int64_t  end_vertex,
bool  only_cost = false 
)

one to one

Dijkstra 1 to 1.

Definition at line 535 of file pgr_dijkstra.hpp.

References Path::clear(), and get_path().

Referenced by Pgr_ksp< G >::doNextCycle(), Pgr_ksp< G >::getFirstSolution(), and pgr_dijkstra().

template<class G >
void Pgr_dijkstra< G >::dijkstra ( G &  graph,
std::deque< Path > &  paths,
const std::vector< int64_t > &  start_vertex,
int64_t  end_vertex,
bool  only_cost = false 
)

Many to one.

Definition at line 618 of file pgr_dijkstra.hpp.

References path, and Path::start_id().

template<class G >
void Pgr_dijkstra< G >::dijkstra ( G &  graph,
std::deque< Path > &  paths,
const std::vector< int64_t > &  start_vertex,
const std::vector< int64_t > &  end_vertex,
bool  only_cost = false 
)

Many to Many.

Definition at line 642 of file pgr_dijkstra.hpp.

References Path::end_id(), and Path::start_id().

template<class G >
void Pgr_dijkstra< G >::dijkstra ( G &  graph,
std::deque< Path > &  paths,
int64_t  start_vertex,
const std::vector< int64_t > &  end_vertex,
bool  only_cost = false 
)

one to Many

Dijkstra 1 to many.

Definition at line 573 of file pgr_dijkstra.hpp.

References Path::end_id(), and get_path().

template<class G >
bool Pgr_dijkstra< G >::dijkstra_1_to_1 ( G &  graph,
V  source,
V  target 
)
private

Call to Dijkstra 1 source to 1 target.

Definition at line 667 of file pgr_dijkstra.hpp.

References pgrouting::Basic_edge::cost.

template<class G >
bool Pgr_dijkstra< G >::dijkstra_1_to_distance ( G &  graph,
V  source,
double  distance 
)
private

Call to Dijkstra 1 source to distance.

Definition at line 689 of file pgr_dijkstra.hpp.

References pgrouting::Basic_edge::cost.

template<class G >
bool Pgr_dijkstra< G >::dijkstra_1_to_many ( G &  graph,
V  source,
const std::vector< V > &  targets 
)
private

Call to Dijkstra 1 source to many targets.

Definition at line 710 of file pgr_dijkstra.hpp.

References pgrouting::Basic_edge::cost.

template<class G >
void Pgr_dijkstra< G >::drivingDistance ( G &  graph,
Path path,
int64_t  start_vertex,
double  distance 
)

1 to distance

Definition at line 499 of file pgr_dijkstra.hpp.

References Path_t::agg_cost, Path::begin(), Path::end(), Path_t::node, and Path::push_back().

Referenced by pgr_drivingDistance().

template<class G >
void Pgr_dijkstra< G >::drivingDistance ( G &  graph,
std::deque< Path > &  paths,
std::vector< int64_t >  start_vertex,
double  distance,
bool  equiCostFlag 
)

many to distance

Definition at line 476 of file pgr_dijkstra.hpp.

References path.

template<class G >
void Pgr_dijkstra< G >::get_cost ( const G &  graph,
V  source,
V  target,
Path path 
) const
private

Definition at line 453 of file pgr_dijkstra.hpp.

References Path::clear(), path, and Path::push_front().

template<class G >
void Pgr_dijkstra< G >::get_cost ( const G &  graph,
std::deque< Path > &  paths,
V  source,
std::vector< V > &  targets 
) const
private

Definition at line 437 of file pgr_dijkstra.hpp.

References Path::clear(), and path.

template<class G >
void Pgr_dijkstra< G >::get_nodesInDistance ( G &  graph,
Path path,
V  source,
double  distance 
)
private

Definition at line 335 of file pgr_dijkstra.hpp.

References Path::clear(), and Path::push_back().

template<class G >
void Pgr_dijkstra< G >::get_path ( const G &  graph,
V  source,
V  target,
Path path 
) const
private

Definition at line 376 of file pgr_dijkstra.hpp.

References Path::clear(), path, and Path::push_front().

template<class G >
void Pgr_dijkstra< G >::get_path ( const G &  graph,
std::deque< Path > &  paths,
V  source,
std::vector< V > &  targets 
) const
private

Definition at line 360 of file pgr_dijkstra.hpp.

References Path::clear(), get_path(), and path.

Member Data Documentation

template<class G>
std::vector< double > Pgr_dijkstra< G >::distances
private

Definition at line 252 of file pgr_dijkstra.hpp.

Referenced by Pgr_dijkstra< G >::clear().

template<class G>
std::deque< V > Pgr_dijkstra< G >::nodesInDistance
private

Definition at line 253 of file pgr_dijkstra.hpp.

Referenced by Pgr_dijkstra< G >::clear().

template<class G>
std::vector< V > Pgr_dijkstra< G >::predecessors
private

Definition at line 251 of file pgr_dijkstra.hpp.

Referenced by Pgr_dijkstra< G >::clear().


The documentation for this class was generated from the following file: