Changeset 1902:e9af75c90c28 in lemon-0.x for lemon/linear_heap.h
- Timestamp:
- 01/25/06 13:10:18 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2477
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/linear_heap.h
r1875 r1902 284 284 } 285 285 286 /// \brief Sets the state of the \c item in the heap. 287 /// 288 /// Sets the state of the \c item in the heap. It can be used to 289 /// manually clear the heap when it is important to achive the 290 /// better time complexity. 291 /// \param i The item. 292 /// \param st The state. It should not be \c IN_HEAP. 293 void state(const Item& i, state_enum st) { 294 switch (st) { 295 case POST_HEAP: 296 case PRE_HEAP: 297 if (state(i) == IN_HEAP) { 298 erase(i); 299 } 300 index[i] = st; 301 break; 302 } 303 } 304 286 305 private: 287 306 … … 460 479 } 461 480 481 void state(const Item& i, state_enum st) { 482 switch (st) { 483 case POST_HEAP: 484 case PRE_HEAP: 485 if (state(i) == IN_HEAP) { 486 erase(i); 487 } 488 index[i] = st; 489 break; 490 } 491 } 492 462 493 private: 463 494
Note: See TracChangeset
for help on using the changeset viewer.