HavoqGT
havoqgt::mpi::sssp_visitor< Graph, PathData, EdgeWeight > Class Template Reference

#include <single_source_shortest_path.hpp>

Public Types

typedef Graph::vertex_locator vertex_locator
 
typedef PathData::value_type path_type
 

Public Member Functions

 sssp_visitor ()
 
 sssp_visitor (vertex_locator _vertex, path_type _level)
 
 sssp_visitor (vertex_locator _vertex)
 
bool pre_visit () const
 
template<typename VisitorQueueHandle >
bool visit (Graph &g, VisitorQueueHandle vis_queue) const
 

Static Public Member Functions

static void set_path_data (PathData *_data)
 
static PathData *& path_data ()
 
static void set_edge_weight (EdgeWeight *_data)
 
static EdgeWeight *& edge_data ()
 

Public Attributes

vertex_locator vertex
 
path_type m_path
 

Friends

bool operator> (const sssp_visitor &v1, const sssp_visitor &v2)
 
bool operator< (const sssp_visitor &v1, const sssp_visitor &v2)
 

Detailed Description

template<typename Graph, typename PathData, typename EdgeWeight>
class havoqgt::mpi::sssp_visitor< Graph, PathData, EdgeWeight >

Definition at line 107 of file single_source_shortest_path.hpp.

Member Typedef Documentation

template<typename Graph, typename PathData, typename EdgeWeight>
typedef PathData::value_type havoqgt::mpi::sssp_visitor< Graph, PathData, EdgeWeight >::path_type

Definition at line 110 of file single_source_shortest_path.hpp.

template<typename Graph, typename PathData, typename EdgeWeight>
typedef Graph::vertex_locator havoqgt::mpi::sssp_visitor< Graph, PathData, EdgeWeight >::vertex_locator

Definition at line 109 of file single_source_shortest_path.hpp.

Constructor & Destructor Documentation

template<typename Graph, typename PathData, typename EdgeWeight>
havoqgt::mpi::sssp_visitor< Graph, PathData, EdgeWeight >::sssp_visitor ( )
inline

Definition at line 111 of file single_source_shortest_path.hpp.

111 : m_path(std::numeric_limits<path_type>::max()) { }
template<typename Graph, typename PathData, typename EdgeWeight>
havoqgt::mpi::sssp_visitor< Graph, PathData, EdgeWeight >::sssp_visitor ( vertex_locator  _vertex,
path_type  _level 
)
inline

Definition at line 112 of file single_source_shortest_path.hpp.

112  :
113  vertex(_vertex), m_path(_level) { }
template<typename Graph, typename PathData, typename EdgeWeight>
havoqgt::mpi::sssp_visitor< Graph, PathData, EdgeWeight >::sssp_visitor ( vertex_locator  _vertex)
inline

Definition at line 115 of file single_source_shortest_path.hpp.

Member Function Documentation

template<typename Graph, typename PathData, typename EdgeWeight>
static EdgeWeight*& havoqgt::mpi::sssp_visitor< Graph, PathData, EdgeWeight >::edge_data ( )
inlinestatic

Definition at line 161 of file single_source_shortest_path.hpp.

161  {
162  static EdgeWeight* data;
163  return data;
164  }

Here is the caller graph for this function:

template<typename Graph, typename PathData, typename EdgeWeight>
static PathData*& havoqgt::mpi::sssp_visitor< Graph, PathData, EdgeWeight >::path_data ( )
inlinestatic

Definition at line 154 of file single_source_shortest_path.hpp.

154  {
155  static PathData* data;
156  return data;
157  }

Here is the caller graph for this function:

template<typename Graph, typename PathData, typename EdgeWeight>
bool havoqgt::mpi::sssp_visitor< Graph, PathData, EdgeWeight >::pre_visit ( ) const
inline

Definition at line 119 of file single_source_shortest_path.hpp.

119  {
120  bool do_visit = (*path_data())[vertex] > m_path;
121  if(do_visit) {
122  (*path_data())[vertex] = m_path;
123  }
124  return do_visit;
125  }

Here is the call graph for this function:

template<typename Graph, typename PathData, typename EdgeWeight>
static void havoqgt::mpi::sssp_visitor< Graph, PathData, EdgeWeight >::set_edge_weight ( EdgeWeight *  _data)
inlinestatic

Definition at line 159 of file single_source_shortest_path.hpp.

159 { edge_data() = _data; }

Here is the call graph for this function:

template<typename Graph, typename PathData, typename EdgeWeight>
static void havoqgt::mpi::sssp_visitor< Graph, PathData, EdgeWeight >::set_path_data ( PathData *  _data)
inlinestatic

Definition at line 152 of file single_source_shortest_path.hpp.

152 { path_data() = _data; }

Here is the call graph for this function:

template<typename Graph, typename PathData, typename EdgeWeight>
template<typename VisitorQueueHandle >
bool havoqgt::mpi::sssp_visitor< Graph, PathData, EdgeWeight >::visit ( Graph &  g,
VisitorQueueHandle  vis_queue 
) const
inline

Definition at line 128 of file single_source_shortest_path.hpp.

128  {
129  if(m_path == (*path_data())[vertex])
130  {
131  typedef typename Graph::edge_iterator eitr_type;
132  for(eitr_type eitr = g.edges_begin(vertex); eitr != g.edges_end(vertex); ++eitr) {
133  vertex_locator neighbor = eitr.target();
134  path_type weight = (*edge_data())[eitr];
135  //std::cout << "Visiting neighbor: " << g.locator_to_label(neighbor) << std::endl;
136  sssp_visitor new_visitor( neighbor, weight + m_path);
137  vis_queue->queue_visitor(new_visitor);
138  }
139  return true;
140  }
141  return false;
142  }

Here is the call graph for this function:

Friends And Related Function Documentation

template<typename Graph, typename PathData, typename EdgeWeight>
bool operator< ( const sssp_visitor< Graph, PathData, EdgeWeight > &  v1,
const sssp_visitor< Graph, PathData, EdgeWeight > &  v2 
)
friend

Definition at line 148 of file single_source_shortest_path.hpp.

148  {
149  return v1.m_path < v2.m_path;
150  }
template<typename Graph, typename PathData, typename EdgeWeight>
bool operator> ( const sssp_visitor< Graph, PathData, EdgeWeight > &  v1,
const sssp_visitor< Graph, PathData, EdgeWeight > &  v2 
)
friend

Definition at line 144 of file single_source_shortest_path.hpp.

144  {
145  return v1.m_path > v2.m_path;
146  }

Member Data Documentation

template<typename Graph, typename PathData, typename EdgeWeight>
path_type havoqgt::mpi::sssp_visitor< Graph, PathData, EdgeWeight >::m_path

Definition at line 167 of file single_source_shortest_path.hpp.

template<typename Graph, typename PathData, typename EdgeWeight>
vertex_locator havoqgt::mpi::sssp_visitor< Graph, PathData, EdgeWeight >::vertex

Definition at line 166 of file single_source_shortest_path.hpp.


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