10 #ifndef TRI_STRIPPER_HEADER_GUARD_HEAP_ARRAY_H 11 #define TRI_STRIPPER_HEADER_GUARD_HEAP_ARRAY_H 27 template <
class T,
class CmpT = std::less<T> >
44 bool valid(
size_t i)
const;
48 const T &
top()
const;
49 const T &
peek(
size_t i)
const;
53 size_t push(
const T & Elem);
57 void update(
size_t i,
const T & Elem);
78 void Swap(
size_t a,
size_t b);
95 template <
class T,
class CmpT>
104 template <
class T,
class CmpT>
111 template <
class T,
class CmpT>
118 template <
class T,
class CmpT>
126 template <
class T,
class CmpT>
133 template <
class T,
class CmpT>
138 return m_Heap.front().m_Elem;
142 template <
class T,
class CmpT>
151 template <
class T,
class CmpT>
158 template <
class T,
class CmpT>
172 template <
class T,
class CmpT>
181 template <
class T,
class CmpT>
186 const size_t Id =
size();
195 template <
class T,
class CmpT>
210 template <
class T,
class CmpT>
219 template <
class T,
class CmpT>
226 template <
class T,
class CmpT>
235 template <
class T,
class CmpT>
247 template <
class T,
class CmpT>
250 assert(i <
m_Heap.size());
255 for (j = i; (j > 0) && (
Less(
m_Heap[(j - 1) / 2],
m_Heap[j])); j = ((j - 1) / 2))
256 Swap(j, (j - 1) / 2);
259 for (i = j; (j = 2 * i + 1) <
size(); i = j) {
271 template <
class T,
class CmpT>
281 template <
class T,
class CmpT>
297 #endif // TRI_STRIPPER_HEADER_GUARD_HEAP_ARRAY_H
void reserve(size_t Size)
void update(size_t i, const T &Elem)
GLboolean GLboolean GLboolean GLboolean a
size_t push(const T &Elem)
heap_array & operator=(const heap_array &)
GLboolean GLboolean GLboolean b
const T & peek(size_t i) const
bool valid(size_t i) const
bool Less(const linker &a, const linker &b) const
linker(const T &Elem, size_t i)
size_t position(size_t i) const
std::vector< linker > linked_heap
void Swap(size_t a, size_t b)
bool removed(size_t i) const
std::vector< size_t > finder
const T & operator[](size_t i) const