COIN-OR::LEMON - Graph Library

Changes between Initial Version and Version 1 of Ticket #622, comment 3


Ignore:
Timestamp:
05/16/19 10:24:42 (3 months ago)
Author:
Alpar Juttner
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #622, comment 3

    initial v1  
    33Syntactically, you could indeed replace `std::vector<Item> _items` with `Item _item` plus every instance of `_items[0]` with `_item`, and it would compile beautifully. But would crash immediately when trying to use it. Because the ''whole'' vector is indeed in heavy use through pointers.
    44
    5 In fact, it is a fundamental part of the data structure. It contains ''all'' items ordered by their levels and by there activeness. I.e. it stars with the active items on level 0, then the inactive ones on level 0, then the active ones on level 1, then the inactive ones on level 1 etc.
    6 The vectors `_first` and `_last_active` indicates the borders of these intervals on each level. In addition, the map `_where` gives a cross reference to the elements. The values of these vectors are ''pointers'' (`Item *`), and the elements of `_items` are accessed and manipulated through them.
     5In fact, it is a fundamental part of the data structure. It contains ''all'' items ordered by their levels and by their activeness. I.e. it starts with the active items on level 0, then come the inactive ones on level 0, then the active ones on level 1, then the inactive ones on level 1 etc.
     6The vectors `_first` and `_last_active` indicate the borders of these intervals on each level. In addition, the map `_where` gives a cross reference to the elements. The values of these vectors are ''pointers'' (`Item *`), and the elements of `_items` are accessed and manipulated through them.
    77
    88Right at the beginning, `initStart()` puts ''all'' items into `_item`. Later on, its values are manipulated with the functions `copy()` and `swap()`.