test/preflow_test.cc
changeset 783 ef88c0a30f85
parent 585 65fbcf2f978a
child 877 141f9c0db4a3
     1.1 --- a/test/preflow_test.cc	Mon Jan 12 23:11:39 2009 +0100
     1.2 +++ b/test/preflow_test.cc	Thu Nov 05 15:48:01 2009 +0100
     1.3 @@ -84,18 +84,27 @@
     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 +  const PreflowType::Elevator& elev = const_preflow_test.elevator();
    1.24 +  preflow_test.elevator(const_cast<PreflowType::Elevator&>(elev));
    1.25 +  PreflowType::Tolerance tol = const_preflow_test.tolerance();
    1.26 +  preflow_test.tolerance(tol);
    1.27  
    1.28 -  preflow_test.capacityMap(cap);
    1.29 -  flow = preflow_test.flowMap();
    1.30 -  preflow_test.flowMap(flow);
    1.31 -  preflow_test.source(n);
    1.32 -  preflow_test.target(n);
    1.33 +  preflow_test
    1.34 +    .capacityMap(cap)
    1.35 +    .flowMap(flow)
    1.36 +    .source(n)
    1.37 +    .target(n);
    1.38  
    1.39    preflow_test.init();
    1.40    preflow_test.init(cap);
    1.41 @@ -104,11 +113,13 @@
    1.42    preflow_test.run();
    1.43    preflow_test.runMinCut();
    1.44  
    1.45 -  preflow_test.flowValue();
    1.46 -  preflow_test.minCut(n);
    1.47 -  preflow_test.minCutMap(cut);
    1.48 -  preflow_test.flow(e);
    1.49 -
    1.50 +  v = const_preflow_test.flowValue();
    1.51 +  v = const_preflow_test.flow(e);
    1.52 +  const FlowMap& fm = const_preflow_test.flowMap();
    1.53 +  b = const_preflow_test.minCut(n);
    1.54 +  const_preflow_test.minCutMap(cut);
    1.55 +  
    1.56 +  ignore_unused_variable_warning(fm);
    1.57  }
    1.58  
    1.59  int cutValue (const SmartDigraph& g,