LLVM  8.0.1
Public Member Functions | List of all members
llvm::PriorityQueue< T, Sequence, Compare > Class Template Reference

PriorityQueue - This class behaves like std::priority_queue and provides a few additional convenience functions. More...

#include "llvm/ADT/PriorityQueue.h"

Inheritance diagram for llvm::PriorityQueue< T, Sequence, Compare >:
Inheritance graph
[legend]
Collaboration diagram for llvm::PriorityQueue< T, Sequence, Compare >:
Collaboration graph
[legend]

Public Member Functions

 PriorityQueue (const Compare &compare=Compare(), const Sequence &sequence=Sequence())
 
template<class Iterator >
 PriorityQueue (Iterator begin, Iterator end, const Compare &compare=Compare(), const Sequence &sequence=Sequence())
 
void erase_one (const T &t)
 erase_one - Erase one element from the queue, regardless of its position. More...
 
void reheapify ()
 reheapify - If an element in the queue has changed in a way that affects its standing in the comparison function, the queue's internal state becomes invalid. More...
 
void clear ()
 clear - Erase all elements from the queue. More...
 

Detailed Description

template<class T, class Sequence = std::vector<T>, class Compare = std::less<typename Sequence::value_type>>
class llvm::PriorityQueue< T, Sequence, Compare >

PriorityQueue - This class behaves like std::priority_queue and provides a few additional convenience functions.

Definition at line 28 of file PriorityQueue.h.

Constructor & Destructor Documentation

◆ PriorityQueue() [1/2]

template<class T, class Sequence = std::vector<T>, class Compare = std::less<typename Sequence::value_type>>
llvm::PriorityQueue< T, Sequence, Compare >::PriorityQueue ( const Compare &  compare = Compare(),
const Sequence &  sequence = Sequence() 
)
inlineexplicit

Definition at line 30 of file PriorityQueue.h.

◆ PriorityQueue() [2/2]

template<class T, class Sequence = std::vector<T>, class Compare = std::less<typename Sequence::value_type>>
template<class Iterator >
llvm::PriorityQueue< T, Sequence, Compare >::PriorityQueue ( Iterator  begin,
Iterator  end,
const Compare &  compare = Compare(),
const Sequence &  sequence = Sequence() 
)
inline

Definition at line 36 of file PriorityQueue.h.

Member Function Documentation

◆ clear()

template<class T, class Sequence = std::vector<T>, class Compare = std::less<typename Sequence::value_type>>
void llvm::PriorityQueue< T, Sequence, Compare >::clear ( )
inline

clear - Erase all elements from the queue.

Definition at line 76 of file PriorityQueue.h.

Referenced by createILPMinScheduler().

◆ erase_one()

template<class T, class Sequence = std::vector<T>, class Compare = std::less<typename Sequence::value_type>>
void llvm::PriorityQueue< T, Sequence, Compare >::erase_one ( const T t)
inline

erase_one - Erase one element from the queue, regardless of its position.

This operation performs a linear search to find an element equal to t, but then uses all logarithmic-time algorithms to do the erase operation.

Definition at line 47 of file PriorityQueue.h.

References llvm::find().

◆ reheapify()

template<class T, class Sequence = std::vector<T>, class Compare = std::less<typename Sequence::value_type>>
void llvm::PriorityQueue< T, Sequence, Compare >::reheapify ( )
inline

reheapify - If an element in the queue has changed in a way that affects its standing in the comparison function, the queue's internal state becomes invalid.

Calling reheapify() resets the queue's state, making it valid again. This operation has time complexity proportional to the number of elements in the queue, so don't plan to use it a lot.

Definition at line 70 of file PriorityQueue.h.


The documentation for this class was generated from the following file: