gravatar
deba@inf.elte.hu
deba@inf.elte.hu
Fix multiple execution bug in weighted matchings (#356) This chgset also redoes the fix of [28c7ad6f8d91] and its backpont to 1.1, [268a052c3043].
0 2 0
default
2 files changed with 71 insertions and 2 deletions:
↑ Collapse diff ↑
Ignore white space 6 line context
... ...
@@ -807,2 +807,3 @@
807 807
      }
808

	
808 809
      if (!_node_potential) {
... ...
@@ -810,2 +811,3 @@
810 811
      }
812

	
811 813
      if (!_blossom_set) {
... ...
@@ -814,2 +816,5 @@
814 816
        _blossom_data = new RangeMap<BlossomData>(_blossom_num);
817
      } else if (_blossom_data->size() != _blossom_num) {
818
        delete _blossom_data;
819
        _blossom_data = new RangeMap<BlossomData>(_blossom_num);
815 820
      }
... ...
@@ -820,3 +825,7 @@
820 825
        _node_data = new RangeMap<NodeData>(_node_num,
821
                                              NodeData(*_node_heap_index));
826
                                            NodeData(*_node_heap_index));
827
      } else {
828
        delete _node_data;
829
        _node_data = new RangeMap<NodeData>(_node_num,
830
                                            NodeData(*_node_heap_index));
822 831
      }
... ...
@@ -826,3 +835,6 @@
826 835
        _tree_set = new TreeSet(*_tree_set_index);
836
      } else {
837
        _tree_set_index->resize(_blossom_num);
827 838
      }
839

	
828 840
      if (!_delta1) {
... ...
@@ -831,2 +843,3 @@
831 843
      }
844

	
832 845
      if (!_delta2) {
... ...
@@ -834,3 +847,6 @@
834 847
        _delta2 = new BinHeap<Value, IntIntMap>(*_delta2_index);
848
      } else {
849
        _delta2_index->resize(_blossom_num);
835 850
      }
851

	
836 852
      if (!_delta3) {
... ...
@@ -839,2 +855,3 @@
839 855
      }
856

	
840 857
      if (!_delta4) {
... ...
@@ -842,2 +859,4 @@
842 859
        _delta4 = new BinHeap<Value, IntIntMap>(*_delta4_index);
860
      } else {
861
        _delta4_index->resize(_blossom_num);
843 862
      }
... ...
@@ -1687,2 +1706,5 @@
1687 1706

	
1707
      _blossom_node_list.clear();
1708
      _blossom_potential.clear();
1709

	
1688 1710
      for (ArcIt e(_graph); e != INVALID; ++e) {
... ...
@@ -1700,2 +1722,9 @@
1700 1722
      }
1723
      
1724
      _delta1->clear();
1725
      _delta2->clear();
1726
      _delta3->clear();
1727
      _delta4->clear();
1728
      _blossom_set->clear();
1729
      _tree_set->clear();
1701 1730

	
... ...
@@ -1711,2 +1740,4 @@
1711 1740
        (*_node_index)[n] = index;
1741
        (*_node_data)[index].heap_index.clear();
1742
        (*_node_data)[index].heap.clear();
1712 1743
        (*_node_data)[index].pot = max;
... ...
@@ -2200,2 +2231,3 @@
2200 2231
      }
2232

	
2201 2233
      if (!_node_potential) {
... ...
@@ -2203,2 +2235,3 @@
2203 2235
      }
2236

	
2204 2237
      if (!_blossom_set) {
... ...
@@ -2207,2 +2240,5 @@
2207 2240
        _blossom_data = new RangeMap<BlossomData>(_blossom_num);
2241
      } else if (_blossom_data->size() != _blossom_num) {
2242
        delete _blossom_data;
2243
        _blossom_data = new RangeMap<BlossomData>(_blossom_num);
2208 2244
      }
... ...
@@ -2214,2 +2250,6 @@
2214 2250
                                            NodeData(*_node_heap_index));
2251
      } else if (_node_data->size() != _node_num) {
2252
        delete _node_data;
2253
        _node_data = new RangeMap<NodeData>(_node_num,
2254
                                            NodeData(*_node_heap_index));
2215 2255
      }
... ...
@@ -2219,3 +2259,6 @@
2219 2259
        _tree_set = new TreeSet(*_tree_set_index);
2260
      } else {
2261
        _tree_set_index->resize(_blossom_num);
2220 2262
      }
2263

	
2221 2264
      if (!_delta2) {
... ...
@@ -2223,3 +2266,6 @@
2223 2266
        _delta2 = new BinHeap<Value, IntIntMap>(*_delta2_index);
2267
      } else {
2268
        _delta2_index->resize(_blossom_num);
2224 2269
      }
2270

	
2225 2271
      if (!_delta3) {
... ...
@@ -2228,2 +2274,3 @@
2228 2274
      }
2275

	
2229 2276
      if (!_delta4) {
... ...
@@ -2231,2 +2278,4 @@
2231 2278
        _delta4 = new BinHeap<Value, IntIntMap>(*_delta4_index);
2279
      } else {
2280
        _delta4_index->resize(_blossom_num);
2232 2281
      }
... ...
@@ -2928,2 +2977,5 @@
2928 2977

	
2978
      _blossom_node_list.clear();
2979
      _blossom_potential.clear();
2980

	
2929 2981
      for (ArcIt e(_graph); e != INVALID; ++e) {
... ...
@@ -2939,2 +2991,8 @@
2939 2991

	
2992
      _delta2->clear();
2993
      _delta3->clear();
2994
      _delta4->clear();
2995
      _blossom_set->clear();
2996
      _tree_set->clear();
2997

	
2940 2998
      int index = 0;
... ...
@@ -2949,2 +3007,4 @@
2949 3007
        (*_node_index)[n] = index;
3008
        (*_node_data)[index].heap_index.clear();
3009
        (*_node_data)[index].heap.clear();
2950 3010
        (*_node_data)[index].pot = max;
Show white space 6 line context
... ...
@@ -741,3 +741,3 @@
741 741
      items.clear();
742
      classes.clear;
742
      classes.clear();
743 743
      firstClass = firstFreeClass = firstFreeItem = -1;
... ...
@@ -1290,2 +1290,11 @@
1290 1290

	
1291
    /// \brief Clears the union-find data structure
1292
    ///
1293
    /// Erase each item from the data structure.
1294
    void clear() {
1295
      nodes.clear();
1296
      classes.clear();
1297
      first_free_node = first_free_class = first_class = -1;
1298
    }
1299

	
1291 1300
    /// \brief Insert a new node into a new component.
0 comments (0 inline)