![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
Definition at line 34 of file adjustable_priority_queue.h.
#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 |
|
default |
The objects references 'c' and 'm' are not required to be alive for the lifetime of this object.
|
inlineexplicit |
Definition at line 39 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 45 of file adjustable_priority_queue.h.
|
inline |
Implements breadth-first search down tree, stopping whenever there's an element < top
Definition at line 87 of file adjustable_priority_queue.h.
|
inline |
Returns the number of elements for which storage has been allocated.
Definition at line 118 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 129 of file adjustable_priority_queue.h.
|
inline |
Definition at line 125 of file adjustable_priority_queue.h.
|
inline |
Definition at line 65 of file adjustable_priority_queue.h.
|
inline |
Definition at line 123 of file adjustable_priority_queue.h.
|
inline |
Definition at line 70 of file adjustable_priority_queue.h.
|
default |
|
delete |
|
inline |
If there are ties for the top, this returns all of them.
Definition at line 113 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 147 of file adjustable_priority_queue.h.
|
inline |
Definition at line 52 of file adjustable_priority_queue.h.
|
inline |
Allocates storage for a given number of elements.
Definition at line 121 of file adjustable_priority_queue.h.
|
inline |
Definition at line 115 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 83 of file adjustable_priority_queue.h.
|
inline |
Definition at line 85 of file adjustable_priority_queue.h.