test/preflow_test.cc
changeset 612 0c8e5c688440
parent 440 88ed40ad0d4f
child 689 86c49553fea5
child 923 30d5f950aa5f
equal deleted inserted replaced
5:98da3217391b 6:7a1a916d12b2
    82   Node n;
    82   Node n;
    83   Arc e;
    83   Arc e;
    84   CapMap cap;
    84   CapMap cap;
    85   FlowMap flow;
    85   FlowMap flow;
    86   CutMap cut;
    86   CutMap cut;
    87 
    87   VType v;
    88   Preflow<Digraph, CapMap>
    88   bool b;
    89     ::SetFlowMap<FlowMap>
    89 
    90     ::SetElevator<Elev>
    90   typedef Preflow<Digraph, CapMap>
    91     ::SetStandardElevator<LinkedElev>
    91             ::SetFlowMap<FlowMap>
    92     ::Create preflow_test(g,cap,n,n);
    92             ::SetElevator<Elev>
    93 
    93             ::SetStandardElevator<LinkedElev>
    94   preflow_test.capacityMap(cap);
    94             ::Create PreflowType;
    95   flow = preflow_test.flowMap();
    95   PreflowType preflow_test(g, cap, n, n);
    96   preflow_test.flowMap(flow);
    96   const PreflowType& const_preflow_test = preflow_test;
    97   preflow_test.source(n);
    97 
    98   preflow_test.target(n);
    98   preflow_test
       
    99     .capacityMap(cap)
       
   100     .flowMap(flow)
       
   101     .source(n)
       
   102     .target(n);
    99 
   103 
   100   preflow_test.init();
   104   preflow_test.init();
   101   preflow_test.init(cap);
   105   preflow_test.init(cap);
   102   preflow_test.startFirstPhase();
   106   preflow_test.startFirstPhase();
   103   preflow_test.startSecondPhase();
   107   preflow_test.startSecondPhase();
   104   preflow_test.run();
   108   preflow_test.run();
   105   preflow_test.runMinCut();
   109   preflow_test.runMinCut();
   106 
   110 
   107   preflow_test.flowValue();
   111   v = const_preflow_test.flowValue();
   108   preflow_test.minCut(n);
   112   v = const_preflow_test.flow(e);
   109   preflow_test.minCutMap(cut);
   113   const FlowMap& fm = const_preflow_test.flowMap();
   110   preflow_test.flow(e);
   114   b = const_preflow_test.minCut(n);
   111 
   115   const_preflow_test.minCutMap(cut);
       
   116   
       
   117   ignore_unused_variable_warning(fm);
   112 }
   118 }
   113 
   119 
   114 int cutValue (const SmartDigraph& g,
   120 int cutValue (const SmartDigraph& g,
   115               const SmartDigraph::NodeMap<bool>& cut,
   121               const SmartDigraph::NodeMap<bool>& cut,
   116               const SmartDigraph::ArcMap<int>& cap) {
   122               const SmartDigraph::ArcMap<int>& cap) {