COIN-OR::LEMON - Graph Library

Changeset 217:fc549fac0dd0 in lemon-0.x for src/work/jacint/bin_heap.hh


Ignore:
Timestamp:
03/20/04 17:13:19 (20 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@312
Message:

Several bugfixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/jacint/bin_heap.hh

    r170 r217  
    154154
    155155    void erase(const Key &k) {
    156       rmidx(kim.get(k));
    157     }
    158 
    159     const Val get(const Key &k) const {
    160       int idx = kim.get(k);
     156      rmidx(kim[k]);
     157    }
     158
     159    Val operator[](const Key &k) const {
     160      int idx = kim[k];
    161161      return data[idx].second;
    162162    }
     163   
    163164    void put(const Key &k, const Val &v) {
    164       int idx = kim.get(k);
     165      int idx = kim[k];
    165166      if( idx < 0 ) {
    166167        push(k,v);
     
    175176
    176177    void decrease(const Key &k, const Val &v) {
    177       int idx = kim.get(k);
     178      int idx = kim[k];
    178179      bubble_up(idx, PairType(k,v));
    179180    }
    180181    void increase(const Key &k, const Val &v) {
    181       int idx = kim.get(k);
     182      int idx = kim[k];
    182183      bubble_down(idx, PairType(k,v), data.size());
    183184    }
    184185
    185186    state_enum state(const Key &k) const {
    186       int s = kim.get(k);
     187      int s = kim[k];
    187188      if( s>=0 )
    188189        s=0;
Note: See TracChangeset for help on using the changeset viewer.