test/preflow_test.cc
changeset 423 e22fc10ab6f1
parent 407 db3251947eba
child 442 ff48c2738fb2
equal deleted inserted replaced
2:dded5bd714da 3:7a46df18f40e
    23 #include <lemon/smart_graph.h>
    23 #include <lemon/smart_graph.h>
    24 #include <lemon/preflow.h>
    24 #include <lemon/preflow.h>
    25 #include <lemon/concepts/digraph.h>
    25 #include <lemon/concepts/digraph.h>
    26 #include <lemon/concepts/maps.h>
    26 #include <lemon/concepts/maps.h>
    27 #include <lemon/lgf_reader.h>
    27 #include <lemon/lgf_reader.h>
       
    28 #include <lemon/elevator.h>
    28 
    29 
    29 using namespace lemon;
    30 using namespace lemon;
    30 
    31 
    31 void checkPreflow()
    32 void checkPreflowCompile()
    32 {
    33 {
    33   typedef int VType;
    34   typedef int VType;
    34   typedef concepts::Digraph Digraph;
    35   typedef concepts::Digraph Digraph;
    35 
    36 
    36   typedef Digraph::Node Node;
    37   typedef Digraph::Node Node;
    37   typedef Digraph::Arc Arc;
    38   typedef Digraph::Arc Arc;
    38   typedef concepts::ReadMap<Arc,VType> CapMap;
    39   typedef concepts::ReadMap<Arc,VType> CapMap;
    39   typedef concepts::ReadWriteMap<Arc,VType> FlowMap;
    40   typedef concepts::ReadWriteMap<Arc,VType> FlowMap;
    40   typedef concepts::WriteMap<Node,bool> CutMap;
    41   typedef concepts::WriteMap<Node,bool> CutMap;
       
    42 
       
    43   typedef Elevator<Digraph, Digraph::Node> Elev;
       
    44   typedef LinkedElevator<Digraph, Digraph::Node> LinkedElev;
    41 
    45 
    42   Digraph g;
    46   Digraph g;
    43   Node n;
    47   Node n;
    44   Arc e;
    48   Arc e;
    45   CapMap cap;
    49   CapMap cap;
    46   FlowMap flow;
    50   FlowMap flow;
    47   CutMap cut;
    51   CutMap cut;
    48 
    52 
    49   Preflow<Digraph, CapMap>::SetFlowMap<FlowMap>::Create preflow_test(g,cap,n,n);
    53   Preflow<Digraph, CapMap>
       
    54     ::SetFlowMap<FlowMap>
       
    55     ::SetElevator<Elev>
       
    56     ::SetStandardElevator<LinkedElev>
       
    57     ::Create preflow_test(g,cap,n,n);
    50 
    58 
    51   preflow_test.capacityMap(cap);
    59   preflow_test.capacityMap(cap);
    52   flow = preflow_test.flowMap();
    60   flow = preflow_test.flowMap();
    53   preflow_test.flowMap(flow);
    61   preflow_test.flowMap(flow);
    54   preflow_test.source(n);
    62   preflow_test.source(n);