4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
16 Stupid Prioq. Should use Lists and STL.
17 Smallest is put at the front.
19 Actually, this sux. Should use a template struct PQuee_ent<V,I>
22 template<class V, class I>
26 Array<I> indices_arr_;
30 assert(value_arr_.size() == indices_arr_.size());
33 void enter(V v, I idx) {
35 for (; j < value_arr_.size(); j++)
36 if (indices_arr_[j] > idx)
42 int size() { return value_arr_.size(); }
43 V front_val() { return value_arr_[0]; }
44 I front_idx() { return indices_arr_[0]; }
53 return value_arr_.size();
57 void insert(int j, V v, I idx)
59 value_arr_.insert(v, j);
60 indices_arr_.insert(idx, j);
66 V retval = front_val();