src/work/jacint/bin_heap.hh
changeset 217 fc549fac0dd0
parent 170 9091b1ebca27
     1.1 --- a/src/work/jacint/bin_heap.hh	Sat Mar 20 16:10:26 2004 +0000
     1.2 +++ b/src/work/jacint/bin_heap.hh	Sat Mar 20 16:13:19 2004 +0000
     1.3 @@ -153,15 +153,16 @@
     1.4      }
     1.5  
     1.6      void erase(const Key &k) {
     1.7 -      rmidx(kim.get(k));
     1.8 +      rmidx(kim[k]);
     1.9      }
    1.10  
    1.11 -    const Val get(const Key &k) const {
    1.12 -      int idx = kim.get(k);
    1.13 +    Val operator[](const Key &k) const {
    1.14 +      int idx = kim[k];
    1.15        return data[idx].second;
    1.16      }
    1.17 +    
    1.18      void put(const Key &k, const Val &v) {
    1.19 -      int idx = kim.get(k);
    1.20 +      int idx = kim[k];
    1.21        if( idx < 0 ) {
    1.22  	push(k,v);
    1.23        }
    1.24 @@ -174,16 +175,16 @@
    1.25      }
    1.26  
    1.27      void decrease(const Key &k, const Val &v) {
    1.28 -      int idx = kim.get(k);
    1.29 +      int idx = kim[k];
    1.30        bubble_up(idx, PairType(k,v));
    1.31      }
    1.32      void increase(const Key &k, const Val &v) {
    1.33 -      int idx = kim.get(k);
    1.34 +      int idx = kim[k];
    1.35        bubble_down(idx, PairType(k,v), data.size());
    1.36      }
    1.37  
    1.38      state_enum state(const Key &k) const {
    1.39 -      int s = kim.get(k);
    1.40 +      int s = kim[k];
    1.41        if( s>=0 )
    1.42  	s=0;
    1.43        return state_enum(s);