HavoqGT
havoqgt::mpi::triangle_count_visitor< Graph > Class Template Reference

#include <triangle_count.hpp>

Public Types

typedef triangle_count_visitor< Graph > my_type
 
typedef Graph::vertex_locator vertex_locator
 
typedef Graph::template vertex_data< uint64_t, std::allocator< uint64_t > > vdtd_type
 

Public Member Functions

 triangle_count_visitor ()
 
 triangle_count_visitor (vertex_locator v)
 
 triangle_count_visitor (vertex_locator v, vertex_locator f, uint32_t deg)
 
 triangle_count_visitor (vertex_locator v, vertex_locator f, vertex_locator s, uint32_t deg)
 
bool pre_visit () const
 
template<typename VisitorQueueHandle >
bool visit (Graph &g, VisitorQueueHandle vis_queue) const
 
int get_state () const
 

Static Public Member Functions

static void set_tc_data (vdtd_type *_data)
 
static vdtd_type *& tc_data ()
 

Public Attributes

vertex_locator vertex
 
vertex_locator first
 
vertex_locator second
 
uint32_t last_degree
 

Static Public Attributes

static Graph * m_ptr_graph
 

Friends

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

Detailed Description

template<typename Graph>
class havoqgt::mpi::triangle_count_visitor< Graph >

Definition at line 106 of file triangle_count.hpp.

Member Typedef Documentation

template<typename Graph >
typedef triangle_count_visitor<Graph> havoqgt::mpi::triangle_count_visitor< Graph >::my_type

Definition at line 108 of file triangle_count.hpp.

template<typename Graph >
typedef Graph::template vertex_data<uint64_t, std::allocator<uint64_t> > havoqgt::mpi::triangle_count_visitor< Graph >::vdtd_type

Definition at line 182 of file triangle_count.hpp.

template<typename Graph >
typedef Graph::vertex_locator havoqgt::mpi::triangle_count_visitor< Graph >::vertex_locator

Definition at line 109 of file triangle_count.hpp.

Constructor & Destructor Documentation

template<typename Graph >
havoqgt::mpi::triangle_count_visitor< Graph >::triangle_count_visitor ( )
inline

Definition at line 111 of file triangle_count.hpp.

template<typename Graph >
havoqgt::mpi::triangle_count_visitor< Graph >::triangle_count_visitor ( vertex_locator  v)
inline

Definition at line 117 of file triangle_count.hpp.

template<typename Graph >
havoqgt::mpi::triangle_count_visitor< Graph >::triangle_count_visitor ( vertex_locator  v,
vertex_locator  f,
uint32_t  deg 
)
inline

Definition at line 123 of file triangle_count.hpp.

template<typename Graph >
havoqgt::mpi::triangle_count_visitor< Graph >::triangle_count_visitor ( vertex_locator  v,
vertex_locator  f,
vertex_locator  s,
uint32_t  deg 
)
inline

Member Function Documentation

template<typename Graph >
int havoqgt::mpi::triangle_count_visitor< Graph >::get_state ( ) const
inline

Definition at line 172 of file triangle_count.hpp.

172  {
173  if(!first.is_valid()) {
174  return 0;
175  }
176  if(!second.is_valid()) {
177  return 1;
178  }
179  return 2;
180  }
template<typename Graph >
bool havoqgt::mpi::triangle_count_visitor< Graph >::pre_visit ( ) const
inline

Definition at line 131 of file triangle_count.hpp.

131  {
132  //return true;//(second == std::numeric_limits<vertex_descriptor_type>::max());
133  uint32_t my_degree = m_ptr_graph->degree(vertex);
134  if( last_degree < my_degree ) {
135  return true;
136  } else if( last_degree > my_degree) {
137  return false;
138  }
139  return first < vertex;
140  }
template<typename Graph >
static void havoqgt::mpi::triangle_count_visitor< Graph >::set_tc_data ( vdtd_type _data)
inlinestatic

Definition at line 184 of file triangle_count.hpp.

184 { tc_data() = _data; }

Here is the call graph for this function:

template<typename Graph >
static vdtd_type*& havoqgt::mpi::triangle_count_visitor< Graph >::tc_data ( )
inlinestatic

Definition at line 186 of file triangle_count.hpp.

186  {
187  static vdtd_type* data;
188  return data;
189  }
Graph::template vertex_data< uint64_t, std::allocator< uint64_t > > vdtd_type

Here is the caller graph for this function:

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

Definition at line 143 of file triangle_count.hpp.

143  {
144 
145  if(!first.is_valid()) {
146  typedef typename Graph::edge_iterator eitr_type;
147  for(eitr_type eitr = g.edges_begin(vertex); eitr != g.edges_end(vertex); ++eitr) {
148  vertex_locator neighbor = eitr.target();
149  my_type new_visitor( neighbor, vertex, g.degree(vertex) );
150  vis_queue->queue_visitor(new_visitor);
151  }
152  } else if(!second.is_valid()) {
153  typedef typename Graph::edge_iterator eitr_type;
154  for(eitr_type eitr = g.edges_begin(vertex); eitr != g.edges_end(vertex); ++eitr) {
155  vertex_locator neighbor = eitr.target();
156  my_type new_visitor( neighbor, vertex, first, g.degree(vertex) );
157  vis_queue->queue_visitor(new_visitor);
158  }
159  } else {
160  //Make a binary search here!
161  typedef typename Graph::edge_iterator eitr_type;
162  for(eitr_type eitr = g.edges_begin(vertex); eitr != g.edges_end(vertex); ++eitr) {
163  vertex_locator neighbor = eitr.target();
164  if(neighbor == second) {
165  (*tc_data())[vertex] = (*tc_data())[vertex] + 1;
166  }
167  }
168  }
169  return true;
170  }
triangle_count_visitor< Graph > my_type

Here is the call graph for this function:

Friends And Related Function Documentation

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

Definition at line 195 of file triangle_count.hpp.

195  {
196  return v1.get_state() > v2.get_state();
197  }
template<typename Graph >
bool operator> ( const triangle_count_visitor< Graph > &  v1,
const triangle_count_visitor< Graph > &  v2 
)
friend

Definition at line 191 of file triangle_count.hpp.

191  {
192  return v1.get_state() < v2.get_state();
193  }

Member Data Documentation

template<typename Graph >
vertex_locator havoqgt::mpi::triangle_count_visitor< Graph >::first

Definition at line 199 of file triangle_count.hpp.

template<typename Graph >
uint32_t havoqgt::mpi::triangle_count_visitor< Graph >::last_degree

Definition at line 200 of file triangle_count.hpp.

template<typename Graph >
Graph * havoqgt::mpi::triangle_count_visitor< Graph >::m_ptr_graph
static

Definition at line 201 of file triangle_count.hpp.

template<typename Graph >
vertex_locator havoqgt::mpi::triangle_count_visitor< Graph >::second

Definition at line 199 of file triangle_count.hpp.

template<typename Graph >
vertex_locator havoqgt::mpi::triangle_count_visitor< Graph >::vertex

Definition at line 199 of file triangle_count.hpp.


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