gravatar
alpar (Alpar Juttner)
alpar@cs.elte.hu
Merge
2 4 0
merge default
2 files changed with 91 insertions and 107 deletions:
↑ Collapse diff ↑
Ignore white space 6 line context
... ...
@@ -6,2 +6,3 @@
6 6
  bfs_test
7
  circulation_test
7 8
  counter_test
... ...
@@ -12,2 +13,3 @@
12 13
  error_test
14
  graph_adaptor_test
13 15
  graph_copy_test
... ...
@@ -20,4 +22,6 @@
20 22
  max_matching_test
23
  path_test
24
  preflow_test
21 25
  random_test
22
  path_test
26
  suurballe_test
23 27
  time_measure_test
Show white space 6 line context
1 1
EXTRA_DIST += \
2
	test/CMakeLists.txt \
3
        test/min_cost_flow_test.lgf \
4
        test/preflow_graph.lgf
2
	test/CMakeLists.txt
5 3

	
... ...
@@ -22,10 +20,10 @@
22 20
	test/graph_utils_test \
21
	test/hao_orlin_test \
23 22
	test/heap_test \
24 23
	test/kruskal_test \
25
	test/hao_orlin_test \
26 24
        test/maps_test \
27 25
	test/max_matching_test \
28
        test/random_test \
29 26
        test/path_test \
30 27
        test/preflow_test \
28
        test/random_test \
31 29
        test/suurballe_test \
Ignore white space 6 line context
... ...
@@ -18,4 +18,3 @@
18 18

	
19
#include <fstream>
20
#include <string>
19
#include <iostream>
21 20

	
... ...
@@ -31,2 +30,38 @@
31 30

	
31
char test_lgf[] =
32
  "@nodes\n"
33
  "label\n"
34
  "0\n"
35
  "1\n"
36
  "2\n"
37
  "3\n"
38
  "4\n"
39
  "5\n"
40
  "6\n"
41
  "7\n"
42
  "8\n"
43
  "9\n"
44
  "@arcs\n"
45
  "    label capacity\n"
46
  "0 1 0     20\n"
47
  "0 2 1     0\n"
48
  "1 1 2     3\n"
49
  "1 2 3     8\n"
50
  "1 3 4     8\n"
51
  "2 5 5     5\n"
52
  "3 2 6     5\n"
53
  "3 5 7     5\n"
54
  "3 6 8     5\n"
55
  "4 3 9     3\n"
56
  "5 7 10    3\n"
57
  "5 6 11    10\n"
58
  "5 8 12    10\n"
59
  "6 8 13    8\n"
60
  "8 9 14    20\n"
61
  "8 1 15    5\n"
62
  "9 5 16    5\n"
63
  "@attributes\n"
64
  "source 1\n"
65
  "target 8\n";
66

	
32 67
void checkPreflowCompile()
... ...
@@ -125,12 +160,2 @@
125 160

	
126
  std::string f_name;
127
  if( getenv("srcdir") )
128
    f_name = std::string(getenv("srcdir"));
129
  else f_name = ".";
130
  f_name += "/test/preflow_graph.lgf";
131

	
132
  std::ifstream file(f_name.c_str());
133

	
134
  check(file, "Input file '" << f_name << "' not found.");
135

	
136 161
  Digraph g;
... ...
@@ -138,3 +163,4 @@
138 163
  CapMap cap(g);
139
  DigraphReader<Digraph>(g,file).
164
  std::istringstream input(test_lgf);
165
  DigraphReader<Digraph>(g,input).
140 166
    arcMap("capacity", cap).
Ignore white space 6 line context
... ...
@@ -19,3 +19,2 @@
19 19
#include <iostream>
20
#include <fstream>
21 20

	
... ...
@@ -30,2 +29,45 @@
30 29

	
30
char test_lgf[] =
31
  "@nodes\n"
32
  "label supply1 supply2 supply3\n"
33
  "1     0        20      27\n"
34
  "2     0       -4        0\n"
35
  "3     0        0        0\n"
36
  "4     0        0        0\n"
37
  "5     0        9        0\n"
38
  "6     0       -6        0\n"
39
  "7     0        0        0\n"
40
  "8     0        0        0\n"
41
  "9     0        3        0\n"
42
  "10    0       -2        0\n"
43
  "11    0        0        0\n"
44
  "12    0       -20     -27\n"
45
  "@arcs\n"
46
  "      cost capacity lower1 lower2\n"
47
  " 1  2  70  11       0      8\n"
48
  " 1  3 150   3       0      1\n"
49
  " 1  4  80  15       0      2\n"
50
  " 2  8  80  12       0      0\n"
51
  " 3  5 140   5       0      3\n"
52
  " 4  6  60  10       0      1\n"
53
  " 4  7  80   2       0      0\n"
54
  " 4  8 110   3       0      0\n"
55
  " 5  7  60  14       0      0\n"
56
  " 5 11 120  12       0      0\n"
57
  " 6  3   0   3       0      0\n"
58
  " 6  9 140   4       0      0\n"
59
  " 6 10  90   8       0      0\n"
60
  " 7  1  30   5       0      0\n"
61
  " 8 12  60  16       0      4\n"
62
  " 9 12  50   6       0      0\n"
63
  "10 12  70  13       0      5\n"
64
  "10  2 100   7       0      0\n"
65
  "10  7  60  10       0      0\n"
66
  "11 10  20  14       0      6\n"
67
  "12 11  30  10       0      0\n"
68
  "@attributes\n"
69
  "source  1\n"
70
  "target 12\n"
71
  "@end\n";
72

	
31 73
// Check the feasibility of the flow
... ...
@@ -98,10 +140,3 @@
98 140

	
99
  std::string fname;
100
  if(getenv("srcdir"))
101
    fname = std::string(getenv("srcdir"));
102
  else fname = ".";
103
  fname += "/test/min_cost_flow_test.lgf";
104

	
105
  std::ifstream input(fname.c_str());
106
  check(input, "Input file '" << fname << "' not found");
141
  std::istringstream input(test_lgf);
107 142
  DigraphReader<ListDigraph>(digraph, input).
... ...
@@ -111,3 +146,2 @@
111 146
    run();
112
  input.close();
113 147
  
Ignore white space 6 line context
1
@nodes
2
label	supply1	supply2	supply3
3
1	0	20	27	
4
2	0	-4	0		
5
3	0	0	0	
6
4	0	0	0	
7
5	0	9	0	
8
6	0	-6	0	
9
7	0	0	0	
10
8	0	0	0	
11
9	0	3	0	
12
10	0	-2	0	
13
11	0	0	0		
14
12	0	-20	-27	
15
               
16
@arcs
17
		cost	capacity	lower1	lower2
18
1	2	70	11		0	8
19
1	3	150	3		0	1
20
1	4	80	15		0	2
21
2	8	80	12		0	0
22
3	5	140	5		0	3
23
4	6	60	10		0	1
24
4	7	80	2		0	0
25
4	8	110	3		0	0
26
5	7	60	14		0	0
27
5	11	120	12		0	0
28
6	3	0	3		0	0
29
6	9	140	4		0	0
30
6	10	90	8		0	0
31
7	1	30	5		0	0
32
8	12	60	16		0	4
33
9	12	50	6		0	0
34
10	12	70	13		0	5
35
10	2	100	7		0	0
36
10	7	60	10		0	0
37
11	10	20	14		0	6
38
12	11	30	10		0	0
39

	
40
@attributes
41
source	1
42
target	12
43

	
44
@end
Ignore white space 6 line context
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
@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
source 1
34
target 8
0 comments (0 inline)