HavoqGT
havoqgt::mpi::pr_visitor< Graph, PRData > Class Template Reference

#include <page_rank.hpp>

Public Types

typedef Graph::vertex_locator vertex_locator
 

Public Member Functions

 pr_visitor ()
 
 pr_visitor (vertex_locator _vertex, double _rank)
 
 pr_visitor (vertex_locator _vertex)
 
bool pre_visit () const
 
template<typename VisitorQueueHandle >
bool visit (Graph &g, VisitorQueueHandle vis_queue) const
 

Static Public Member Functions

static PRData & rank_data (PRData *_data=NULL)
 

Public Attributes

vertex_locator vertex
 
double rank
 

Friends

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

Detailed Description

template<typename Graph, typename PRData>
class havoqgt::mpi::pr_visitor< Graph, PRData >

Definition at line 108 of file page_rank.hpp.

Member Typedef Documentation

template<typename Graph, typename PRData>
typedef Graph::vertex_locator havoqgt::mpi::pr_visitor< Graph, PRData >::vertex_locator

Definition at line 110 of file page_rank.hpp.

Constructor & Destructor Documentation

template<typename Graph, typename PRData>
havoqgt::mpi::pr_visitor< Graph, PRData >::pr_visitor ( )
inline

Definition at line 111 of file page_rank.hpp.

111 : rank(0) { }
template<typename Graph, typename PRData>
havoqgt::mpi::pr_visitor< Graph, PRData >::pr_visitor ( vertex_locator  _vertex,
double  _rank 
)
inline

Definition at line 113 of file page_rank.hpp.

114  : vertex(_vertex)
115  , rank(_rank) { }
vertex_locator vertex
Definition: page_rank.hpp:160
template<typename Graph, typename PRData>
havoqgt::mpi::pr_visitor< Graph, PRData >::pr_visitor ( vertex_locator  _vertex)
inline

Definition at line 117 of file page_rank.hpp.

118  : vertex(_vertex)
119  , rank(0) { }
vertex_locator vertex
Definition: page_rank.hpp:160

Member Function Documentation

template<typename Graph, typename PRData>
bool havoqgt::mpi::pr_visitor< Graph, PRData >::pre_visit ( ) const
inline

Definition at line 122 of file page_rank.hpp.

122  {
123  rank_data()[vertex] += rank;
124  return false;
125  }
vertex_locator vertex
Definition: page_rank.hpp:160
static PRData & rank_data(PRData *_data=NULL)
Definition: page_rank.hpp:153

Here is the call graph for this function:

template<typename Graph, typename PRData>
static PRData& havoqgt::mpi::pr_visitor< Graph, PRData >::rank_data ( PRData *  _data = NULL)
inlinestatic

Definition at line 153 of file page_rank.hpp.

153  {
154  static PRData* data;
155  if(_data) data = _data;
156  return *data;
157  }

Here is the caller graph for this function:

template<typename Graph, typename PRData>
template<typename VisitorQueueHandle >
bool havoqgt::mpi::pr_visitor< Graph, PRData >::visit ( Graph &  g,
VisitorQueueHandle  vis_queue 
) const
inline

Definition at line 128 of file page_rank.hpp.

128  {
129  double old_rank = 1;
130  uint64_t degree = g.degree(vertex);
131  double send_rank = 1;//old_rank / double(degree);
132 
133 
134  typedef typename Graph::edge_iterator eitr_type;
135  for(eitr_type eitr = g.edges_begin(vertex); eitr != g.edges_end(vertex); ++eitr) {
136  vertex_locator neighbor = eitr.target();
137  pr_visitor new_visitor( neighbor, send_rank);
138  vis_queue->queue_visitor(new_visitor);
139  }
140  return true;
141 
142  }
Graph::vertex_locator vertex_locator
Definition: page_rank.hpp:110
vertex_locator vertex
Definition: page_rank.hpp:160

Friends And Related Function Documentation

template<typename Graph, typename PRData>
bool operator< ( const pr_visitor< Graph, PRData > &  v1,
const pr_visitor< Graph, PRData > &  v2 
)
friend

Definition at line 149 of file page_rank.hpp.

149  {
150  return false;
151  }
template<typename Graph, typename PRData>
bool operator> ( const pr_visitor< Graph, PRData > &  v1,
const pr_visitor< Graph, PRData > &  v2 
)
friend

Definition at line 145 of file page_rank.hpp.

145  {
146  return false;
147  }

Member Data Documentation

template<typename Graph, typename PRData>
double havoqgt::mpi::pr_visitor< Graph, PRData >::rank

Definition at line 161 of file page_rank.hpp.

template<typename Graph, typename PRData>
vertex_locator havoqgt::mpi::pr_visitor< Graph, PRData >::vertex

Definition at line 160 of file page_rank.hpp.


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