MCPcopy Create free account
hub / github.com/Shannon-Data/ShannonBase / reverse_heapify

Method reverse_heapify

include/priority_queue.h:163–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161 void heapify(size_type i) { heapify(i, m_container.size()); }
162
163 void reverse_heapify(size_type i) {
164 assert(i < size());
165 while (i > 0 && !Base::operator()(m_container[i], m_container[parent(i)])) {
166 size_t parent_idx = parent(i);
167 std::swap(m_container[parent_idx], m_container[i]);
168 m_marker(parent_idx, &m_container[parent_idx]);
169 m_marker(i, &m_container[i]);
170 i = parent(i);
171 }
172 }
173
174 // Sets the value of element i, and rebuilds the priority queue.
175 void decrease_key(size_type i, value_type const &x) {

Callers

nothing calls this directly

Calls 4

assertClass · 0.85
swapFunction · 0.70
sizeClass · 0.50
operator()Function · 0.50

Tested by

no test coverage detected