HavoqGT
havoqgt::mpi::bfs_queue< Visitor > Class Template Reference

#include <breadth_first_search.hpp>

Public Types

typedef uint32_t level_number_type
 
typedef boost::container::deque< Visitor >::size_type size_type
 

Public Member Functions

 bfs_queue ()
 
bool push (Visitor const &task)
 
void pop ()
 
Visitor const & top ()
 
size_type size () const
 
bool empty () const
 
void clear ()
 

Protected Attributes

std::vector< boost::container::deque< Visitor > > m_vec_bfs_level_stack
 
level_number_type m_cur_min_level
 
size_type m_size
 

Detailed Description

template<typename Visitor>
class havoqgt::mpi::bfs_queue< Visitor >

Definition at line 105 of file breadth_first_search.hpp.

Member Typedef Documentation

template<typename Visitor >
typedef uint32_t havoqgt::mpi::bfs_queue< Visitor >::level_number_type

Definition at line 108 of file breadth_first_search.hpp.

template<typename Visitor >
typedef boost::container::deque<Visitor>::size_type havoqgt::mpi::bfs_queue< Visitor >::size_type

Definition at line 109 of file breadth_first_search.hpp.

Constructor & Destructor Documentation

template<typename Visitor >
havoqgt::mpi::bfs_queue< Visitor >::bfs_queue ( )
inline

Definition at line 116 of file breadth_first_search.hpp.

116 : m_vec_bfs_level_stack(20), m_cur_min_level(std::numeric_limits<level_number_type>::max()), m_size(0) { }
std::vector< boost::container::deque< Visitor > > m_vec_bfs_level_stack

Member Function Documentation

template<typename Visitor >
void havoqgt::mpi::bfs_queue< Visitor >::clear ( )
inline

Definition at line 156 of file breadth_first_search.hpp.

157  {
158  for(typename std::vector<boost::container::deque<Visitor> >::iterator itr = m_vec_bfs_level_stack.begin();
159  itr != m_vec_bfs_level_stack.end(); ++itr) {
160  itr->clear();
161  }
162  m_size = 0;
163  m_cur_min_level = std::numeric_limits<level_number_type>::max();
164  }
std::vector< boost::container::deque< Visitor > > m_vec_bfs_level_stack
template<typename Visitor >
bool havoqgt::mpi::bfs_queue< Visitor >::empty ( ) const
inline

Definition at line 151 of file breadth_first_search.hpp.

152  {
153  return (m_size == 0);
154  }

Here is the caller graph for this function:

template<typename Visitor >
void havoqgt::mpi::bfs_queue< Visitor >::pop ( )
inline

Definition at line 129 of file breadth_first_search.hpp.

130  {
132  --m_size;
134  //if now empty, find next level;
137  }
138  }
139  }
std::vector< boost::container::deque< Visitor > > m_vec_bfs_level_stack

Here is the call graph for this function:

template<typename Visitor >
bool havoqgt::mpi::bfs_queue< Visitor >::push ( Visitor const &  task)
inline

Definition at line 118 of file breadth_first_search.hpp.

119  {
120  while(task.level() >= m_vec_bfs_level_stack.size()) {
121  m_vec_bfs_level_stack.push_back(boost::container::deque<Visitor>());
122  }
123  m_vec_bfs_level_stack[task.level()].push_back(task);
124  ++m_size;
125  m_cur_min_level = std::min(m_cur_min_level, (uint32_t)task.level());
126  return true;
127  }
std::vector< boost::container::deque< Visitor > > m_vec_bfs_level_stack
template<typename Visitor >
size_type havoqgt::mpi::bfs_queue< Visitor >::size ( ) const
inline

Definition at line 146 of file breadth_first_search.hpp.

147  {
148  return m_size;
149  }
template<typename Visitor >
Visitor const& havoqgt::mpi::bfs_queue< Visitor >::top ( )
inline

Definition at line 141 of file breadth_first_search.hpp.

142  {
143  return m_vec_bfs_level_stack[m_cur_min_level].back();
144  }
std::vector< boost::container::deque< Visitor > > m_vec_bfs_level_stack

Member Data Documentation

template<typename Visitor >
level_number_type havoqgt::mpi::bfs_queue< Visitor >::m_cur_min_level
protected

Definition at line 113 of file breadth_first_search.hpp.

template<typename Visitor >
size_type havoqgt::mpi::bfs_queue< Visitor >::m_size
protected

Definition at line 114 of file breadth_first_search.hpp.

template<typename Visitor >
std::vector<boost::container::deque<Visitor> > havoqgt::mpi::bfs_queue< Visitor >::m_vec_bfs_level_stack
protected

Definition at line 112 of file breadth_first_search.hpp.


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