31 #ifndef __FASTJET_MINHEAP__HH__
32 #define __FASTJET_MINHEAP__HH__
38 #include "fastjet/internal/base.hh"
40 FASTJET_BEGIN_NAMESPACE
53 MinHeap (
const std::vector<double> & values,
unsigned int max_size) :
54 _heap(max_size) {initialise(values);}
58 MinHeap (
unsigned int max_size) : _heap(max_size) {}
61 MinHeap (
const std::vector<double> & values) :
62 _heap(values.size()) {initialise(values);}
66 void initialise(
const std::vector<double> & values);
69 inline unsigned int minloc()
const {
70 return (_heap[0].minloc) - &(_heap[0]);}
73 inline double minval()
const {
return _heap[0].minloc->value;}
75 inline double operator[](
int i)
const {
return _heap[i].value;}
79 void remove(
unsigned int loc) {
80 update(loc,std::numeric_limits<double>::max());};
83 void update(
unsigned int,
double);
92 std::vector<ValueLoc> _heap;
101 #endif // __FASTJET_MINHEAP__HH__