Changeset 217:fc549fac0dd0 in lemon-0.x for src/work/jacint/bin_heap.hh
- Timestamp:
- 03/20/04 17:13:19 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@312
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/jacint/bin_heap.hh
r170 r217 154 154 155 155 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]; 161 161 return data[idx].second; 162 162 } 163 163 164 void put(const Key &k, const Val &v) { 164 int idx = kim .get(k);165 int idx = kim[k]; 165 166 if( idx < 0 ) { 166 167 push(k,v); … … 175 176 176 177 void decrease(const Key &k, const Val &v) { 177 int idx = kim .get(k);178 int idx = kim[k]; 178 179 bubble_up(idx, PairType(k,v)); 179 180 } 180 181 void increase(const Key &k, const Val &v) { 181 int idx = kim .get(k);182 int idx = kim[k]; 182 183 bubble_down(idx, PairType(k,v), data.size()); 183 184 } 184 185 185 186 state_enum state(const Key &k) const { 186 int s = kim .get(k);187 int s = kim[k]; 187 188 if( s>=0 ) 188 189 s=0;
Note: See TracChangeset
for help on using the changeset viewer.