47 #ifndef REHASHED_HEAP_HPP 48 #define REHASHED_HEAP_HPP 68 template <
class _Type>
69 struct rehashed_heap :
public std::priority_queue<vertex, std::vector<vertex>, priority_compare_functor<_Type>>
89 std::vector<vertex>::const_iterator
begin()
91 return rehashed_heap::c.begin();
93 std::vector<vertex>::const_iterator
end()
95 return rehashed_heap::c.end();
102 template <
class _Type>
113 typename std::vector<rehashed_heap<_Type>>::iterator
118 typename std::vector<rehashed_heap<_Type>>::iterator res;
119 typename tree_rehashed_heap::const_iterator it_end = this->
end();
120 for(
typename tree_rehashed_heap::iterator it = this->
begin(); it != it_end; ++it)
122 typename std::vector<rehashed_heap<_Type>>::const_iterator vit_end = it->second.end();
124 bool cv_not_in_bl = curren_black_list.find(it->first) == curren_black_list.end();
127 if(!vit->empty() && (cv_not_in_bl || curren_black_list.find(it->first)->second.find(i) ==
128 curren_black_list.find(it->first)->second.end()))
134 controlling_vertex = it->first;
137 else if(priority_functor(vit->top()) > priority_functor(res->top()))
140 controlling_vertex = it->first;
154 typename tree_rehashed_heap::iterator it_end = this->
end();
155 for(
typename tree_rehashed_heap::iterator it = this->
begin(); it != it_end; ++it)
157 typename std::vector<rehashed_heap<_Type>>::iterator vit_end = it->second.end();
rehashed_heap(const priority_compare_functor< _Type > &_comp)
Constructor.
Base class used to define the priority associated with each vertex of a list base scheduling problem...
Class specification of the graph structures.
Definition of hash function for EdgeDescriptor.
void rehash()
Rehash the heap associated with the priority queue.
redefinition of map to manage ordered/unordered structures
std::vector< vertex >::const_iterator end()
This package is used to drive the list based algorithm with different type of priority schemes...
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMap
Class used to represent a tree of priority queues.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
Class used to represent a priority queue of vertex with rehash.
Functor used to compare two vertices with respect to a priority object.
Template definition of refcount.
void rehash()
Rehash all the heaps in the map.
std::vector< rehashed_heap< _Type > >::iterator top(const CustomUnorderedMap< vertex, CustomOrderedSet< unsigned int >> ¤_black_list, const priority_data< _Type > &priority_functor, vertex &controlling_vertex, unsigned int &b_tag, bool &found)
Return the vertex with the highest priority.
std::vector< vertex >::const_iterator begin()