test/circulation_test.cc
changeset 783 ef88c0a30f85
parent 611 85cb3aa71cce
child 877 141f9c0db4a3
     1.1 --- a/test/circulation_test.cc	Mon Jan 12 23:11:39 2009 +0100
     1.2 +++ b/test/circulation_test.cc	Thu Nov 05 15:48:01 2009 +0100
     1.3 @@ -57,7 +57,7 @@
     1.4    typedef Digraph::Node Node;
     1.5    typedef Digraph::Arc Arc;
     1.6    typedef concepts::ReadMap<Arc,VType> CapMap;
     1.7 -  typedef concepts::ReadMap<Node,VType> DeltaMap;
     1.8 +  typedef concepts::ReadMap<Node,VType> SupplyMap;
     1.9    typedef concepts::ReadWriteMap<Arc,VType> FlowMap;
    1.10    typedef concepts::WriteMap<Node,bool> BarrierMap;
    1.11  
    1.12 @@ -68,30 +68,42 @@
    1.13    Node n;
    1.14    Arc a;
    1.15    CapMap lcap, ucap;
    1.16 -  DeltaMap delta;
    1.17 +  SupplyMap supply;
    1.18    FlowMap flow;
    1.19    BarrierMap bar;
    1.20 +  VType v;
    1.21 +  bool b;
    1.22  
    1.23 -  Circulation<Digraph, CapMap, CapMap, DeltaMap>
    1.24 -    ::SetFlowMap<FlowMap>
    1.25 -    ::SetElevator<Elev>
    1.26 -    ::SetStandardElevator<LinkedElev>
    1.27 -    ::Create circ_test(g,lcap,ucap,delta);
    1.28 -
    1.29 -  circ_test.lowerCapMap(lcap);
    1.30 -  circ_test.upperCapMap(ucap);
    1.31 -  circ_test.deltaMap(delta);
    1.32 -  flow = circ_test.flowMap();
    1.33 -  circ_test.flowMap(flow);
    1.34 +  typedef Circulation<Digraph, CapMap, CapMap, SupplyMap>
    1.35 +            ::SetFlowMap<FlowMap>
    1.36 +            ::SetElevator<Elev>
    1.37 +            ::SetStandardElevator<LinkedElev>
    1.38 +            ::Create CirculationType;
    1.39 +  CirculationType circ_test(g, lcap, ucap, supply);
    1.40 +  const CirculationType& const_circ_test = circ_test;
    1.41 +   
    1.42 +  circ_test
    1.43 +    .lowerMap(lcap)
    1.44 +    .upperMap(ucap)
    1.45 +    .supplyMap(supply)
    1.46 +    .flowMap(flow);
    1.47 +  
    1.48 +  const CirculationType::Elevator& elev = const_circ_test.elevator();
    1.49 +  circ_test.elevator(const_cast<CirculationType::Elevator&>(elev));
    1.50 +  CirculationType::Tolerance tol = const_circ_test.tolerance();
    1.51 +  circ_test.tolerance(tol);
    1.52  
    1.53    circ_test.init();
    1.54    circ_test.greedyInit();
    1.55    circ_test.start();
    1.56    circ_test.run();
    1.57  
    1.58 -  circ_test.barrier(n);
    1.59 -  circ_test.barrierMap(bar);
    1.60 -  circ_test.flow(a);
    1.61 +  v = const_circ_test.flow(a);
    1.62 +  const FlowMap& fm = const_circ_test.flowMap();
    1.63 +  b = const_circ_test.barrier(n);
    1.64 +  const_circ_test.barrierMap(bar);
    1.65 +  
    1.66 +  ignore_unused_variable_warning(fm);
    1.67  }
    1.68  
    1.69  template <class G, class LM, class UM, class DM>