File pairing_queue.hpp

namespace find_embedding
class max_heap_tag
#include <pairing_queue.hpp>
class min_heap_tag
#include <pairing_queue.hpp>
template<typename N>
class pairing_node : public N
#include <pairing_queue.hpp>

Public Functions

inline pairing_node()
template<class ...Args>
inline pairing_node(Args... args)
inline pairing_node<N> *merge_roots(pairing_node<N> *other)

the basic operation of the pairing queue &#8212; put this and other into heap-order

template<class ...Args>
inline void refresh(Args... args)
inline pairing_node<N> *next_root()
inline pairing_node<N> *merge_pairs()

Private Functions

inline pairing_node<N> *merge_roots_unsafe(pairing_node<N> *other)

the basic operation of the pairing queue &#8212; put this and other into heap-order

inline pairing_node<N> *merge_roots_unchecked(pairing_node *other)

merge_roots, assuming other is not null and that val < other->val.

may invalidate the internal data structure (see source for details)

Private Members

pairing_node *next
pairing_node *desc
template<typename N>
class pairing_queue
#include <pairing_queue.hpp>

Public Functions

inline pairing_queue(int n)
inline pairing_queue(pairing_queue &&other)
inline ~pairing_queue()
inline void reset()
inline bool empty()
template<class ...Args>
inline void emplace(Args... args)
inline N top()
inline void pop()

Private Members

int count
int size
pairing_node<N> *root
pairing_node<N> *mem
template<typename P, typename heap_tag = min_heap_tag>
class priority_node
#include <pairing_queue.hpp>

Public Functions

inline priority_node()
inline priority_node(int n, int r, P d)
inline bool operator<(const priority_node<P, heap_tag> &b) const

Public Members

int node
int dirt
P dist