| ... | ... |
@@ -48,25 +48,25 @@ |
| 48 | 48 |
///\param Item Type of the items the data is assigned to (Graph::Node, |
| 49 | 49 |
///Graph::Edge, Graph::UEdge) |
| 50 | 50 |
template<class Graph, class Item> |
| 51 | 51 |
class Elevator |
| 52 | 52 |
{
|
| 53 | 53 |
public: |
| 54 | 54 |
|
| 55 | 55 |
typedef Item Key; |
| 56 | 56 |
typedef int Value; |
| 57 | 57 |
|
| 58 | 58 |
private: |
| 59 | 59 |
|
| 60 |
typedef |
|
| 60 |
typedef Item *Vit; |
|
| 61 | 61 |
typedef typename ItemSetTraits<Graph,Item>::template Map<Vit>::Type VitMap; |
| 62 | 62 |
typedef typename ItemSetTraits<Graph,Item>::template Map<int>::Type IntMap; |
| 63 | 63 |
|
| 64 | 64 |
const Graph &_g; |
| 65 | 65 |
int _max_level; |
| 66 | 66 |
int _item_num; |
| 67 | 67 |
VitMap _where; |
| 68 | 68 |
IntMap _level; |
| 69 | 69 |
std::vector<Item> _items; |
| 70 | 70 |
std::vector<Vit> _first; |
| 71 | 71 |
std::vector<Vit> _last_active; |
| 72 | 72 |
|
| ... | ... |
@@ -424,28 +424,28 @@ |
| 424 | 424 |
///Then the |
| 425 | 425 |
///items should be listed levels by levels statring with the lowest one |
| 426 | 426 |
///(with level 0). This is done by using \c initAddItem() |
| 427 | 427 |
///and \c initNewLevel(). Finally \c initFinish() must be called. |
| 428 | 428 |
///The items not listed will be put on the highest level. |
| 429 | 429 |
///@{
|
| 430 | 430 |
|
| 431 | 431 |
///Start the initialization process. |
| 432 | 432 |
|
| 433 | 433 |
void initStart() |
| 434 | 434 |
{
|
| 435 | 435 |
_init_lev=0; |
| 436 |
_init_num=_items.begin(); |
|
| 437 |
_first[0]=_items.begin(); |
|
| 438 |
_last_active[0]=_items.begin()-1; |
|
| 439 |
Vit n=_items.begin(); |
|
| 436 |
_init_num=&_items[0]; |
|
| 437 |
_first[0]=&_items[0]; |
|
| 438 |
_last_active[0]=&_items[0]-1; |
|
| 439 |
Vit n=&_items[0]; |
|
| 440 | 440 |
for(typename ItemSetTraits<Graph,Item>::ItemIt i(_g);i!=INVALID;++i) |
| 441 | 441 |
{
|
| 442 | 442 |
*n=i; |
| 443 | 443 |
_where[i]=n; |
| 444 | 444 |
_level[i]=_max_level; |
| 445 | 445 |
++n; |
| 446 | 446 |
} |
| 447 | 447 |
} |
| 448 | 448 |
|
| 449 | 449 |
///Add an item to the current level. |
| 450 | 450 |
|
| 451 | 451 |
void initAddItem(Item i) |
| ... | ... |
@@ -466,26 +466,26 @@ |
| 466 | 466 |
_last_active[_init_lev]=_init_num-1; |
| 467 | 467 |
} |
| 468 | 468 |
|
| 469 | 469 |
///Finalize the initialization process. |
| 470 | 470 |
|
| 471 | 471 |
void initFinish() |
| 472 | 472 |
{
|
| 473 | 473 |
for(_init_lev++;_init_lev<=_max_level;_init_lev++) |
| 474 | 474 |
{
|
| 475 | 475 |
_first[_init_lev]=_init_num; |
| 476 | 476 |
_last_active[_init_lev]=_init_num-1; |
| 477 | 477 |
} |
| 478 |
_first[_max_level+1]=_items.begin()+_item_num; |
|
| 479 |
_last_active[_max_level+1]=_items.begin()+_item_num-1; |
|
| 478 |
_first[_max_level+1]=&_items[0]+_item_num; |
|
| 479 |
_last_active[_max_level+1]=&_items[0]+_item_num-1; |
|
| 480 | 480 |
_highest_active = -1; |
| 481 | 481 |
} |
| 482 | 482 |
|
| 483 | 483 |
///@} |
| 484 | 484 |
|
| 485 | 485 |
}; |
| 486 | 486 |
|
| 487 | 487 |
///Class for handling "labels" in push-relabel type algorithms. |
| 488 | 488 |
|
| 489 | 489 |
///A class for handling "labels" in push-relabel type algorithms. |
| 490 | 490 |
/// |
| 491 | 491 |
///\ingroup auxdat |
0 comments (0 inline)