Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <adjustable_priority_queue.h>
Public Member Functions | |
AdjustablePriorityQueue ()=default | |
AdjustablePriorityQueue (const Comp &c) | |
AdjustablePriorityQueue (const AdjustablePriorityQueue &)=delete | |
AdjustablePriorityQueue & | operator= (const AdjustablePriorityQueue &)=delete |
AdjustablePriorityQueue (AdjustablePriorityQueue &&)=default | |
AdjustablePriorityQueue & | operator= (AdjustablePriorityQueue &&)=default |
void | Add (T *val) |
void | Remove (T *val) |
bool | Contains (const T *val) const |
void | NoteChangedPriority (T *val) |
T * | Top () |
const T * | Top () const |
void | AllTop (std::vector< T * > *topvec) |
void | Pop () |
If there are ties for the top, this returns all of them. | |
int | Size () const |
int | Capacity () const |
Returns the number of elements for which storage has been allocated. | |
void | SetCapacity (size_t c) |
Allocates storage for a given number of elements. | |
bool | IsEmpty () const |
void | Clear () |
void | CheckValid () |
const std::vector< T * > * | Raw () const |
Definition at line 36 of file adjustable_priority_queue.h.
|
default |
The objects references 'c' and 'm' are not required to be alive for the lifetime of this object.
|
inlineexplicit |
Definition at line 41 of file adjustable_priority_queue.h.
|
delete |
|
default |
|
inline |
Extend the size of the vector by one. We could just use vector<T>::resize(), but maybe T is not default-constructible.
Definition at line 47 of file adjustable_priority_queue.h.
|
inline |
Implements breadth-first search down tree, stopping whenever there's an element < top
Definition at line 89 of file adjustable_priority_queue.h.
|
inline |
Returns the number of elements for which storage has been allocated.
Definition at line 120 of file adjustable_priority_queue.h.
|
inline |
CHECKs that the heap is actually a heap (each "parent" of >= priority than its child).
Definition at line 131 of file adjustable_priority_queue.h.
|
inline |
Definition at line 127 of file adjustable_priority_queue.h.
|
inline |
Definition at line 67 of file adjustable_priority_queue.h.
|
inline |
Definition at line 125 of file adjustable_priority_queue.h.
|
inline |
Definition at line 72 of file adjustable_priority_queue.h.
|
default |
|
delete |
|
inline |
If there are ties for the top, this returns all of them.
Definition at line 115 of file adjustable_priority_queue.h.
|
inline |
This is for debugging, e.g. the caller can use it to examine the heap for rationality w.r.t. other parts of the program.
Definition at line 149 of file adjustable_priority_queue.h.
|
inline |
Definition at line 54 of file adjustable_priority_queue.h.
|
inline |
Allocates storage for a given number of elements.
Definition at line 123 of file adjustable_priority_queue.h.
|
inline |
Definition at line 117 of file adjustable_priority_queue.h.
|
inline |
If val ever changes its priority, you need to call this function to notify the pq so it can move it in the heap accordingly.
Definition at line 85 of file adjustable_priority_queue.h.
|
inline |
Definition at line 87 of file adjustable_priority_queue.h.