# HG changeset patch
# User Peter Kovacs <kpeter@inf.elte.hu>
# Date 1227863932 -3600
# Node ID 65649fefece879a6cf9baa612988468fdcc6795e
# Parent 9b8778f1d9922a15dcf159d34c815df3c83d0a82
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.
diff --git a/test/preflow_graph.lgf b/test/preflow_graph.lgf
a
|
b
|
|
1 | 1 | @nodes |
2 | | label |
3 | | 0 |
4 | | 1 |
5 | | 2 |
6 | | 3 |
7 | | 4 |
8 | | 5 |
9 | | 6 |
10 | | 7 |
11 | | 8 |
12 | | 9 |
13 | | @edges |
14 | | label capacity |
15 | | 0 1 0 20 |
16 | | 0 2 1 0 |
17 | | 1 1 2 3 |
18 | | 1 2 3 8 |
19 | | 1 3 4 8 |
20 | | 2 5 5 5 |
21 | | 3 2 6 5 |
22 | | 3 5 7 5 |
23 | | 3 6 8 5 |
24 | | 4 3 9 3 |
25 | | 5 7 10 3 |
26 | | 5 6 11 10 |
27 | | 5 8 12 10 |
28 | | 6 8 13 8 |
29 | | 8 9 14 20 |
30 | | 8 1 15 5 |
31 | | 9 5 16 5 |
32 | | @attributes |
| 2 | label |
| 3 | 0 |
| 4 | 1 |
| 5 | 2 |
| 6 | 3 |
| 7 | 4 |
| 8 | 5 |
| 9 | 6 |
| 10 | 7 |
| 11 | 8 |
| 12 | 9 |
| 13 | @arcs |
| 14 | label capacity |
| 15 | 0 1 0 20 |
| 16 | 0 2 1 0 |
| 17 | 1 1 2 3 |
| 18 | 1 2 3 8 |
| 19 | 1 3 4 8 |
| 20 | 2 5 5 5 |
| 21 | 3 2 6 5 |
| 22 | 3 5 7 5 |
| 23 | 3 6 8 5 |
| 24 | 4 3 9 3 |
| 25 | 5 7 10 3 |
| 26 | 5 6 11 10 |
| 27 | 5 8 12 10 |
| 28 | 6 8 13 8 |
| 29 | 8 9 14 20 |
| 30 | 8 1 15 5 |
| 31 | 9 5 16 5 |
| 32 | @attributes |
33 | 33 | source 1 |
34 | 34 | target 8 |
35 | | @end |
diff --git a/test/preflow_test.cc b/test/preflow_test.cc
a
|
b
|
|
25 | 25 | #include <lemon/concepts/digraph.h> |
26 | 26 | #include <lemon/concepts/maps.h> |
27 | 27 | #include <lemon/lgf_reader.h> |
| 28 | #include <lemon/elevator.h> |
28 | 29 | |
29 | 30 | using namespace lemon; |
30 | 31 | |
31 | | void checkPreflow() |
| 32 | void checkPreflowCompile() |
32 | 33 | { |
33 | 34 | typedef int VType; |
34 | 35 | typedef concepts::Digraph Digraph; |
… |
… |
|
39 | 40 | typedef concepts::ReadWriteMap<Arc,VType> FlowMap; |
40 | 41 | typedef concepts::WriteMap<Node,bool> CutMap; |
41 | 42 | |
| 43 | typedef Elevator<Digraph, Digraph::Node> Elev; |
| 44 | typedef LinkedElevator<Digraph, Digraph::Node> LinkedElev; |
| 45 | |
42 | 46 | Digraph g; |
43 | 47 | Node n; |
44 | 48 | Arc e; |
… |
… |
|
46 | 50 | FlowMap flow; |
47 | 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 | 59 | preflow_test.capacityMap(cap); |
52 | 60 | flow = preflow_test.flowMap(); |