Changeset 221:d8a67c5b26d1 in lemon-0.x for src
- Timestamp:
- 03/20/04 21:08:24 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@317
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/include/bin_heap.hh
r214 r221 154 154 155 155 void erase(const Item &i) { 156 rmidx(iim .get(i));156 rmidx(iim[i]); 157 157 } 158 158 159 159 Prio get(const Item &i) const { 160 int idx = iim .get(i);160 int idx = iim[i]; 161 161 return data[idx].second; 162 162 } … … 165 165 } 166 166 void set(const Item &i, const Prio &p) { 167 int idx = iim .get(i);167 int idx = iim[i]; 168 168 if( idx < 0 ) { 169 169 push(i,p); … … 178 178 179 179 void decrease(const Item &i, const Prio &p) { 180 int idx = iim .get(i);180 int idx = iim[i]; 181 181 bubble_up(idx, PairType(i,p)); 182 182 } 183 183 void increase(const Item &i, const Prio &p) { 184 int idx = iim .get(i);184 int idx = iim[i]; 185 185 bubble_down(idx, PairType(i,p), data.size()); 186 186 } 187 187 188 188 state_enum state(const Item &i) const { 189 int s = iim .get(i);189 int s = iim[i]; 190 190 if( s>=0 ) 191 191 s=0;
Note: See TracChangeset
for help on using the changeset viewer.