PGROUTING  2.6-dev
Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init Class Reference

class for stopping when a distance/cost has being surpassed More...

Inheritance diagram for Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init:
Collaboration diagram for Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init:

Public Member Functions

 dijkstra_distance_visitor_no_init (std::ostringstream &p_log, V source, double distance_goal, std::vector< V > &predecessors, std::vector< double > &distances, std::vector< boost::default_color_type > &color_map)
 
template<class B_G >
void discover_vertex (V u, B_G &)
 
template<class B_G >
void edge_not_relaxed (E e, B_G &g)
 
template<class B_G >
void edge_relaxed (E, B_G &)
 
template<class B_G >
void examine_edge (E e, B_G &g)
 
template<class B_G >
void examine_vertex (V u, B_G &)
 
template<class B_G >
void finish_vertex (V, B_G &)
 

Private Attributes

V first
 
std::ostringstream & log
 
std::vector< boost::default_color_type > & m_color
 
std::vector< double > & m_dist
 
double m_distance_goal
 
size_t m_num_examined
 
std::vector< V > & m_predecessors
 

Detailed Description

template<class G>
class Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init

class for stopping when a distance/cost has being surpassed

Definition at line 771 of file pgr_dijkstra.hpp.

Constructor & Destructor Documentation

template<class G>
Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init::dijkstra_distance_visitor_no_init ( std::ostringstream &  p_log,
V  source,
double  distance_goal,
std::vector< V > &  predecessors,
std::vector< double > &  distances,
std::vector< boost::default_color_type > &  color_map 
)
inlineexplicit

Definition at line 774 of file pgr_dijkstra.hpp.

References pgassert.

780  :
781  log(p_log),
782  first(source),
783  m_distance_goal(distance_goal),
784  m_num_examined(0),
785  m_predecessors(predecessors),
786  m_dist(distances),
787  m_color(color_map) {
788  pgassert(m_num_examined == 0);
790  }
std::vector< boost::default_color_type > & m_color
#define pgassert(expr)
Uses the standard assert syntax.
Definition: pgr_assert.h:81

Member Function Documentation

template<class G>
template<class B_G >
void Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init::discover_vertex ( V  u,
B_G &   
)
inline

Definition at line 833 of file pgr_dijkstra.hpp.

833  {
834  if (u != first && m_predecessors[u] == u) {
835  m_color[u] = boost::black_color;
836  }
837  }
std::vector< boost::default_color_type > & m_color
template<class G>
template<class B_G >
void Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init::edge_not_relaxed ( E  e,
B_G &  g 
)
inline

Definition at line 819 of file pgr_dijkstra.hpp.

819  {
820  if (source(e, g) != first
821  && m_predecessors[source(e, g)] == source(e, g)) {
822  m_color[target(e, g)] = boost::black_color;
823  }
824  }
std::vector< boost::default_color_type > & m_color
template<class G>
template<class B_G >
void Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init::edge_relaxed ( E  ,
B_G &   
)
inline

Definition at line 813 of file pgr_dijkstra.hpp.

813  {
814  }
template<class G>
template<class B_G >
void Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init::examine_edge ( E  e,
B_G &  g 
)
inline

Definition at line 804 of file pgr_dijkstra.hpp.

804  {
805  if (source(e, g) != first
806  && m_predecessors[source(e, g)] == source(e, g)) {
807  m_color[target(e, g)] = boost::black_color;
808  }
809  }
std::vector< boost::default_color_type > & m_color
template<class G>
template<class B_G >
void Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init::examine_vertex ( V  u,
B_G &   
)
inline

Definition at line 793 of file pgr_dijkstra.hpp.

793  {
794  if ( 0 == m_num_examined++) first = u;
795  if (m_dist[u] > m_distance_goal) {
796  throw found_goals();
797  }
798  if (u != first && m_predecessors[u] == u) {
799  m_color[u] = boost::black_color;
800  }
801  }
std::vector< boost::default_color_type > & m_color
template<class G>
template<class B_G >
void Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init::finish_vertex ( V  ,
B_G &   
)
inline

Definition at line 828 of file pgr_dijkstra.hpp.

828  {
829  }

Member Data Documentation

template<class G>
V Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init::first
private

Definition at line 841 of file pgr_dijkstra.hpp.

template<class G>
std::ostringstream& Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init::log
private

Definition at line 840 of file pgr_dijkstra.hpp.

template<class G>
std::vector<boost::default_color_type>& Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init::m_color
private

Definition at line 846 of file pgr_dijkstra.hpp.

template<class G>
std::vector< double >& Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init::m_dist
private

Definition at line 845 of file pgr_dijkstra.hpp.

template<class G>
double Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init::m_distance_goal
private

Definition at line 842 of file pgr_dijkstra.hpp.

template<class G>
size_t Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init::m_num_examined
private

Definition at line 843 of file pgr_dijkstra.hpp.

template<class G>
std::vector< V >& Pgr_dijkstra< G >::dijkstra_distance_visitor_no_init::m_predecessors
private

Definition at line 844 of file pgr_dijkstra.hpp.


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