test/preflow_test.cc
changeset 591 f63e87b9748e
parent 440 88ed40ad0d4f
child 739 30d5f950aa5f
     1.1 --- a/test/preflow_test.cc	Sat Apr 18 21:54:30 2009 +0200
     1.2 +++ b/test/preflow_test.cc	Tue Apr 21 10:34:49 2009 +0100
     1.3 @@ -84,18 +84,22 @@
     1.4    CapMap cap;
     1.5    FlowMap flow;
     1.6    CutMap cut;
     1.7 +  VType v;
     1.8 +  bool b;
     1.9  
    1.10 -  Preflow<Digraph, CapMap>
    1.11 -    ::SetFlowMap<FlowMap>
    1.12 -    ::SetElevator<Elev>
    1.13 -    ::SetStandardElevator<LinkedElev>
    1.14 -    ::Create preflow_test(g,cap,n,n);
    1.15 +  typedef Preflow<Digraph, CapMap>
    1.16 +            ::SetFlowMap<FlowMap>
    1.17 +            ::SetElevator<Elev>
    1.18 +            ::SetStandardElevator<LinkedElev>
    1.19 +            ::Create PreflowType;
    1.20 +  PreflowType preflow_test(g, cap, n, n);
    1.21 +  const PreflowType& const_preflow_test = preflow_test;
    1.22  
    1.23 -  preflow_test.capacityMap(cap);
    1.24 -  flow = preflow_test.flowMap();
    1.25 -  preflow_test.flowMap(flow);
    1.26 -  preflow_test.source(n);
    1.27 -  preflow_test.target(n);
    1.28 +  preflow_test
    1.29 +    .capacityMap(cap)
    1.30 +    .flowMap(flow)
    1.31 +    .source(n)
    1.32 +    .target(n);
    1.33  
    1.34    preflow_test.init();
    1.35    preflow_test.init(cap);
    1.36 @@ -104,11 +108,13 @@
    1.37    preflow_test.run();
    1.38    preflow_test.runMinCut();
    1.39  
    1.40 -  preflow_test.flowValue();
    1.41 -  preflow_test.minCut(n);
    1.42 -  preflow_test.minCutMap(cut);
    1.43 -  preflow_test.flow(e);
    1.44 -
    1.45 +  v = const_preflow_test.flowValue();
    1.46 +  v = const_preflow_test.flow(e);
    1.47 +  const FlowMap& fm = const_preflow_test.flowMap();
    1.48 +  b = const_preflow_test.minCut(n);
    1.49 +  const_preflow_test.minCutMap(cut);
    1.50 +  
    1.51 +  ignore_unused_variable_warning(fm);
    1.52  }
    1.53  
    1.54  int cutValue (const SmartDigraph& g,