Better test files for Preflow (#176)
authorPeter Kovacs <kpeter@inf.elte.hu>
Sun, 30 Nov 2008 00:51:20 +0100
changeset 394e7707b3069f1
parent 393 37054b67d807
child 395 0c5dd7ceda03
Better test files for Preflow (#176)

- Slightly improve preflow_test.cc.
- Change preflow_test.lgf to meet the new LGF format
and remove trailing tabs.
test/preflow_graph.lgf
test/preflow_test.cc
     1.1 --- a/test/preflow_graph.lgf	Sun Nov 30 00:50:31 2008 +0100
     1.2 +++ b/test/preflow_graph.lgf	Sun Nov 30 00:51:20 2008 +0100
     1.3 @@ -1,35 +1,34 @@
     1.4  @nodes
     1.5 -label	
     1.6 -0	
     1.7 -1	
     1.8 -2	
     1.9 -3	
    1.10 -4	
    1.11 -5	
    1.12 -6	
    1.13 -7	
    1.14 -8	
    1.15 -9	
    1.16 -@edges
    1.17 -		label	capacity	
    1.18 -0	1	0	20	
    1.19 -0	2	1	0	
    1.20 -1	1	2	3	
    1.21 -1	2	3	8	
    1.22 -1	3	4	8	
    1.23 -2	5	5	5	
    1.24 -3	2	6	5	
    1.25 -3	5	7	5	
    1.26 -3	6	8	5	
    1.27 -4	3	9	3	
    1.28 -5	7	10	3	
    1.29 -5	6	11	10	
    1.30 -5	8	12	10	
    1.31 -6	8	13	8	
    1.32 -8	9	14	20	
    1.33 -8	1	15	5	
    1.34 -9	5	16	5	
    1.35 -@attributes 
    1.36 +label
    1.37 +0
    1.38 +1
    1.39 +2
    1.40 +3
    1.41 +4
    1.42 +5
    1.43 +6
    1.44 +7
    1.45 +8
    1.46 +9
    1.47 +@arcs
    1.48 +		label	capacity
    1.49 +0	1	0	20
    1.50 +0	2	1	0
    1.51 +1	1	2	3
    1.52 +1	2	3	8
    1.53 +1	3	4	8
    1.54 +2	5	5	5
    1.55 +3	2	6	5
    1.56 +3	5	7	5
    1.57 +3	6	8	5
    1.58 +4	3	9	3
    1.59 +5	7	10	3
    1.60 +5	6	11	10
    1.61 +5	8	12	10
    1.62 +6	8	13	8
    1.63 +8	9	14	20
    1.64 +8	1	15	5
    1.65 +9	5	16	5
    1.66 +@attributes
    1.67  source 1
    1.68  target 8
    1.69 -@end
     2.1 --- a/test/preflow_test.cc	Sun Nov 30 00:50:31 2008 +0100
     2.2 +++ b/test/preflow_test.cc	Sun Nov 30 00:51:20 2008 +0100
     2.3 @@ -25,10 +25,11 @@
     2.4  #include <lemon/concepts/digraph.h>
     2.5  #include <lemon/concepts/maps.h>
     2.6  #include <lemon/lgf_reader.h>
     2.7 +#include <lemon/elevator.h>
     2.8  
     2.9  using namespace lemon;
    2.10  
    2.11 -void checkPreflow()
    2.12 +void checkPreflowCompile()
    2.13  {
    2.14    typedef int VType;
    2.15    typedef concepts::Digraph Digraph;
    2.16 @@ -39,6 +40,9 @@
    2.17    typedef concepts::ReadWriteMap<Arc,VType> FlowMap;
    2.18    typedef concepts::WriteMap<Node,bool> CutMap;
    2.19  
    2.20 +  typedef Elevator<Digraph, Digraph::Node> Elev;
    2.21 +  typedef LinkedElevator<Digraph, Digraph::Node> LinkedElev;
    2.22 +
    2.23    Digraph g;
    2.24    Node n;
    2.25    Arc e;
    2.26 @@ -46,7 +50,11 @@
    2.27    FlowMap flow;
    2.28    CutMap cut;
    2.29  
    2.30 -  Preflow<Digraph, CapMap>::SetFlowMap<FlowMap>::Create preflow_test(g,cap,n,n);
    2.31 +  Preflow<Digraph, CapMap>
    2.32 +    ::SetFlowMap<FlowMap>
    2.33 +    ::SetElevator<Elev>
    2.34 +    ::SetStandardElevator<LinkedElev>
    2.35 +    ::Create preflow_test(g,cap,n,n);
    2.36  
    2.37    preflow_test.capacityMap(cap);
    2.38    flow = preflow_test.flowMap();