1 /* -*- mode: C++; indent-tabs-mode: nil; -*- |
1 /* -*- mode: C++; indent-tabs-mode: nil; -*- |
2 * |
2 * |
3 * This file is a part of LEMON, a generic C++ optimization library. |
3 * This file is a part of LEMON, a generic C++ optimization library. |
4 * |
4 * |
5 * Copyright (C) 2003-2009 |
5 * Copyright (C) 2003-2010 |
6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
7 * (Egervary Research Group on Combinatorial Optimization, EGRES). |
7 * (Egervary Research Group on Combinatorial Optimization, EGRES). |
8 * |
8 * |
9 * Permission to use, modify and distribute this software is granted |
9 * Permission to use, modify and distribute this software is granted |
10 * provided that this copyright notice appears in all copies. For |
10 * provided that this copyright notice appears in all copies. For |
81 n = bfs_test.processNextNode(t, b); |
81 n = bfs_test.processNextNode(t, b); |
82 n = bfs_test.processNextNode(nm, n); |
82 n = bfs_test.processNextNode(nm, n); |
83 n = const_bfs_test.nextNode(); |
83 n = const_bfs_test.nextNode(); |
84 b = const_bfs_test.emptyQueue(); |
84 b = const_bfs_test.emptyQueue(); |
85 i = const_bfs_test.queueSize(); |
85 i = const_bfs_test.queueSize(); |
86 |
86 |
87 bfs_test.start(); |
87 bfs_test.start(); |
88 bfs_test.start(t); |
88 bfs_test.start(t); |
89 bfs_test.start(nm); |
89 bfs_test.start(nm); |
90 |
90 |
91 l = const_bfs_test.dist(t); |
91 l = const_bfs_test.dist(t); |
102 ::SetDistMap<concepts::ReadWriteMap<Node,int> > |
102 ::SetDistMap<concepts::ReadWriteMap<Node,int> > |
103 ::SetReachedMap<concepts::ReadWriteMap<Node,bool> > |
103 ::SetReachedMap<concepts::ReadWriteMap<Node,bool> > |
104 ::SetStandardProcessedMap |
104 ::SetStandardProcessedMap |
105 ::SetProcessedMap<concepts::WriteMap<Node,bool> > |
105 ::SetProcessedMap<concepts::WriteMap<Node,bool> > |
106 ::Create bfs_test(G); |
106 ::Create bfs_test(G); |
107 |
107 |
108 concepts::ReadWriteMap<Node,Arc> pred_map; |
108 concepts::ReadWriteMap<Node,Arc> pred_map; |
109 concepts::ReadWriteMap<Node,int> dist_map; |
109 concepts::ReadWriteMap<Node,int> dist_map; |
110 concepts::ReadWriteMap<Node,bool> reached_map; |
110 concepts::ReadWriteMap<Node,bool> reached_map; |
111 concepts::WriteMap<Node,bool> processed_map; |
111 concepts::WriteMap<Node,bool> processed_map; |
112 |
112 |
113 bfs_test |
113 bfs_test |
114 .predMap(pred_map) |
114 .predMap(pred_map) |
115 .distMap(dist_map) |
115 .distMap(dist_map) |
116 .reachedMap(reached_map) |
116 .reachedMap(reached_map) |
117 .processedMap(processed_map); |
117 .processedMap(processed_map); |
118 |
118 |
119 bfs_test.run(s); |
119 bfs_test.run(s); |
120 bfs_test.run(s,t); |
120 bfs_test.run(s,t); |
121 bfs_test.run(); |
121 bfs_test.run(); |
122 |
122 |
123 bfs_test.init(); |
123 bfs_test.init(); |
124 bfs_test.addSource(s); |
124 bfs_test.addSource(s); |
125 n = bfs_test.processNextNode(); |
125 n = bfs_test.processNextNode(); |
126 n = bfs_test.processNextNode(t, b); |
126 n = bfs_test.processNextNode(t, b); |
127 n = bfs_test.processNextNode(nm, n); |
127 n = bfs_test.processNextNode(nm, n); |
128 n = bfs_test.nextNode(); |
128 n = bfs_test.nextNode(); |
129 b = bfs_test.emptyQueue(); |
129 b = bfs_test.emptyQueue(); |
130 i = bfs_test.queueSize(); |
130 i = bfs_test.queueSize(); |
131 |
131 |
132 bfs_test.start(); |
132 bfs_test.start(); |
133 bfs_test.start(t); |
133 bfs_test.start(t); |
134 bfs_test.start(nm); |
134 bfs_test.start(nm); |
135 |
135 |
136 l = bfs_test.dist(t); |
136 l = bfs_test.dist(t); |