gravatar
kpeter (Peter Kovacs)
kpeter@inf.elte.hu
Rename flowInit() to init() in Preflow (#176)
0 2 0
default
2 files changed with 3 insertions and 3 deletions:
↑ Collapse diff ↑
Ignore white space 24 line context
... ...
@@ -436,25 +436,25 @@
436 436
      }
437 437
    }
438 438

	
439 439
    /// \brief Initializes the internal data structures.
440 440
    ///
441 441
    /// Initializes the internal data structures and sets the initial
442 442
    /// flow to the given \c flowMap. The \c flowMap should contain a
443 443
    /// flow or at least a preflow, ie. in each node excluding the
444 444
    /// target the incoming flow should greater or equal to the
445 445
    /// outgoing flow.
446 446
    /// \return %False when the given \c flowMap is not a preflow.
447 447
    template <typename FlowMap>
448
    bool flowInit(const FlowMap& flowMap) {
448
    bool init(const FlowMap& flowMap) {
449 449
      createStructures();
450 450

	
451 451
      for (ArcIt e(_graph); e != INVALID; ++e) {
452 452
        _flow->set(e, flowMap[e]);
453 453
      }
454 454

	
455 455
      for (NodeIt n(_graph); n != INVALID; ++n) {
456 456
        Value excess = 0;
457 457
        for (InArcIt e(_graph, n); e != INVALID; ++e) {
458 458
          excess += (*_flow)[e];
459 459
        }
460 460
        for (OutArcIt e(_graph, n); e != INVALID; ++e) {
Ignore white space 6 line context
... ...
@@ -46,25 +46,25 @@
46 46
  FlowMap flow;
47 47
  CutMap cut;
48 48

	
49 49
  Preflow<Digraph, CapMap>::SetFlowMap<FlowMap>::Create preflow_test(g,cap,n,n);
50 50

	
51 51
  preflow_test.capacityMap(cap);
52 52
  flow = preflow_test.flowMap();
53 53
  preflow_test.flowMap(flow);
54 54
  preflow_test.source(n);
55 55
  preflow_test.target(n);
56 56

	
57 57
  preflow_test.init();
58
  preflow_test.flowInit(cap);
58
  preflow_test.init(cap);
59 59
  preflow_test.startFirstPhase();
60 60
  preflow_test.startSecondPhase();
61 61
  preflow_test.run();
62 62
  preflow_test.runMinCut();
63 63

	
64 64
  preflow_test.flowValue();
65 65
  preflow_test.minCut(n);
66 66
  preflow_test.minCutMap(cut);
67 67
  preflow_test.flow(e);
68 68

	
69 69
}
70 70

	
... ...
@@ -144,25 +144,25 @@
144 144
  preflow_test.minCutMap(min_cut);
145 145
  int min_cut_value=cutValue(g,min_cut,cap);
146 146

	
147 147
  check(preflow_test.flowValue() == min_cut_value,
148 148
        "The max flow value is not equal to the three min cut values.");
149 149

	
150 150
  FlowMap flow(g);
151 151
  for(ArcIt e(g); e!=INVALID; ++e) flow[e] = preflow_test.flowMap()[e];
152 152

	
153 153
  int flow_value=preflow_test.flowValue();
154 154

	
155 155
  for(ArcIt e(g); e!=INVALID; ++e) cap[e]=2*cap[e];
156
  preflow_test.flowInit(flow);
156
  preflow_test.init(flow);
157 157
  preflow_test.startFirstPhase();
158 158

	
159 159
  CutMap min_cut1(g);
160 160
  preflow_test.minCutMap(min_cut1);
161 161
  min_cut_value=cutValue(g,min_cut1,cap);
162 162

	
163 163
  check(preflow_test.flowValue() == min_cut_value &&
164 164
        min_cut_value == 2*flow_value,
165 165
        "The max flow value or the min cut value is wrong.");
166 166

	
167 167
  preflow_test.startSecondPhase();
168 168

	
0 comments (0 inline)