|
| | BBQueue (Selection s=Selection::best_first) |
| | constructor, taking the selection the keys are made by
|
| void | push (Node &&n, V bound, unsigned depth, V key) |
| | adds a node with its bound, its depth and its key
|
| const Item & | top (void) const |
| | the next node, which stays in the queue (there must be one)
|
| Item | pop (void) |
| | removes and returns the next node
|
| V | best_bound (void) const |
| | the least bound of the open nodes ( \( +\infty \) if there is none)
|
| std::size_t | clear (void) |
| | removes all the nodes, returning how many there were
|
| template<class F> |
| std::size_t | drain (F &&f) |
| | removes all the nodes, giving each to f( item ), and returns how many there were
|
| bool | empty (void) const noexcept |
| | true if there is no open node
|
| std::size_t | size (void) const noexcept |
| | the number of open nodes
|
template<class
Node, class V = double>
class PBeFS_di_unipi_it::BBQueue< Node, V >
the open nodes of a B&B, ordered by a key
The nodes are kept in slots with a free list, since a node is destroyed when it is branched, and the indexed heap pair of ADS on the slots gives the next one, the least key first and, among equal keys, the last pushed (the first pushed with Selection::breadth_first), and the least bound of the open nodes, which the termination test needs when the key of the selection is not the bound. The heaps grow by doubling with the slots.