Changeset 2547:f393a8162688 in lemon-0.x for lemon/bucket_heap.h
- Timestamp:
- 12/27/07 14:40:16 (16 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3424
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/bucket_heap.h
r2391 r2547 50 50 51 51 public: 52 /// \e 52 53 typedef typename _ItemIntMap::Key Item; 54 /// \e 53 55 typedef int Prio; 56 /// \e 54 57 typedef std::pair<Item, Prio> Pair; 58 /// \e 55 59 typedef _ItemIntMap ItemIntMap; 56 60 … … 63 67 /// The ItemIntMap \e should be initialized in such way that it maps 64 68 /// PRE_HEAP (-1) to any element to be put in the heap... 65 enum state_enum{69 enum State { 66 70 IN_HEAP = 0, 67 71 PRE_HEAP = -1, … … 279 283 /// get back to the heap again. 280 284 /// \param i The item. 281 state_enumstate(const Item &i) const {285 State state(const Item &i) const { 282 286 int idx = index[i]; 283 287 if (idx >= 0) idx = 0; 284 return state_enum(idx);288 return State(idx); 285 289 } 286 290 … … 292 296 /// \param i The item. 293 297 /// \param st The state. It should not be \c IN_HEAP. 294 void state(const Item& i, state_enumst) {298 void state(const Item& i, State st) { 295 299 switch (st) { 296 300 case POST_HEAP: … … 335 339 typedef _ItemIntMap ItemIntMap; 336 340 337 enum state_enum{341 enum State { 338 342 IN_HEAP = 0, 339 343 PRE_HEAP = -1, … … 473 477 } 474 478 475 state_enumstate(const Item &i) const {479 State state(const Item &i) const { 476 480 int idx = index[i]; 477 481 if (idx >= 0) idx = 0; 478 return state_enum(idx);479 } 480 481 void state(const Item& i, state_enumst) {482 return State(idx); 483 } 484 485 void state(const Item& i, State st) { 482 486 switch (st) { 483 487 case POST_HEAP: … … 547 551 /// The ItemIntMap \e should be initialized in such way that it maps 548 552 /// PRE_HEAP (-1) to any element to be put in the heap... 549 enum state_enum{553 enum State { 550 554 IN_HEAP = 0, 551 555 PRE_HEAP = -1, … … 684 688 /// get back to the heap again. 685 689 /// \param i The item. 686 state_enumstate(const Item &i) const {690 State state(const Item &i) const { 687 691 int idx = index[i]; 688 692 if (idx >= 0) idx = 0; 689 return state_enum(idx);693 return State(idx); 690 694 } 691 695 … … 717 721 typedef _ItemIntMap ItemIntMap; 718 722 719 enum state_enum{723 enum State { 720 724 IN_HEAP = 0, 721 725 PRE_HEAP = -1, … … 799 803 } 800 804 801 state_enumstate(const Item &i) const {805 State state(const Item &i) const { 802 806 int idx = index[i]; 803 807 if (idx >= 0) idx = 0; 804 return state_enum(idx);808 return State(idx); 805 809 } 806 810
Note: See TracChangeset
for help on using the changeset viewer.