Lines Matching refs:g
43 const Graph& g, PositionMap position, const Topology& topology) in print_graph_layout() argument
47 Point min_point = position[*vertices(g).first], max_point = min_point; in print_graph_layout()
48 BGL_FORALL_VERTICES_T(v, g, Graph) in print_graph_layout()
61 for (boost::tie(vi, vi_end) = vertices(g); vi != vi_end; in print_graph_layout()
78 void dump_graph_layout(std::string name, const Graph& g, PositionMap position) in dump_graph_layout() argument
84 for (boost::tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi) in dump_graph_layout()
86 out << " n" << get(vertex_index, g, *vi) << "[ pos=\"" in dump_graph_layout()
92 for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) in dump_graph_layout()
94 out << " n" << get(vertex_index, g, source(*ei, g)) << " -- n" in dump_graph_layout()
95 << get(vertex_index, g, target(*ei, g)) << ";\n"; in dump_graph_layout()
108 Graph g(n); in test_circle_layout() local
111 vertex_iterator vi = vertices(g).first; in test_circle_layout()
113 put(vertex_index, g, *vi, i); in test_circle_layout()
115 circle_graph_layout(g, get(vertex_position, g), 10.0); in test_circle_layout()
119 print_graph_layout(g, get(vertex_position, g), topology); in test_circle_layout()
158 Graph g; in test_triangle() local
160 vertex_descriptor u = add_vertex(g); in test_triangle()
161 put(vertex_index, g, u, 0); in test_triangle()
162 vertex_descriptor v = add_vertex(g); in test_triangle()
163 put(vertex_index, g, v, 1); in test_triangle()
164 vertex_descriptor w = add_vertex(g); in test_triangle()
165 put(vertex_index, g, w, 2); in test_triangle()
167 edge_descriptor e1 = add_edge(u, v, g).first; in test_triangle()
168 put(edge_weight, g, e1, 1.0); in test_triangle()
169 edge_descriptor e2 = add_edge(v, w, g).first; in test_triangle()
170 put(edge_weight, g, e2, 1.0); in test_triangle()
171 edge_descriptor e3 = add_edge(w, u, g).first; in test_triangle()
172 put(edge_weight, g, e3, 1.0); in test_triangle()
174 circle_graph_layout(g, get(vertex_position, g), 25.0); in test_triangle()
176 bool ok = kamada_kawai_spring_layout(g, get(vertex_position, g), in test_triangle()
177 get(edge_weight, g), square_topology<>(50.0), side_length(50.0)); in test_triangle()
181 print_graph_layout(g, get(vertex_position, g)); in test_triangle()
201 Graph g(&cube_edges[0], &cube_edges[12], 8); in test_cube() local
208 for (boost::tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi) in test_cube()
209 put(vertex_index, g, *vi, i++); in test_cube()
212 for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) in test_cube()
214 put(edge_weight, g, *ei, 1.0); in test_cube()
215 std::cerr << "(" << (char)(get(vertex_index, g, source(*ei, g)) + 'A') in test_cube()
216 << ", " << (char)(get(vertex_index, g, target(*ei, g)) + 'A') in test_cube()
221 circle_graph_layout(g, get(vertex_position, g), 25.0); in test_cube()
223 bool ok = kamada_kawai_spring_layout(g, get(vertex_position, g), in test_cube()
224 get(edge_weight, g), square_topology<>(50.0), side_length(50.0), in test_cube()
229 print_graph_layout(g, get(vertex_position, g), square_topology<>(50.)); in test_cube()
231 dump_graph_layout("cube", g, get(vertex_position, g)); in test_cube()
237 num_vertices(g)); in test_cube()
239 random_graph_layout(g, get(vertex_position, g), rect_top); in test_cube()
241 fruchterman_reingold_force_directed_layout(g, get(vertex_position, g), in test_cube()
245 make_iterator_property_map(displacements.begin(), get(vertex_index, g), in test_cube()
249 print_graph_layout(g, get(vertex_position, g), square_topology<>(50.)); in test_cube()
251 dump_graph_layout("cube-fr", g, get(vertex_position, g)); in test_cube()
273 Graph g(&triangular_edges[0], &triangular_edges[18], 10); in test_triangular() local
280 for (boost::tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi) in test_triangular()
281 put(vertex_index, g, *vi, i++); in test_triangular()
284 for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) in test_triangular()
286 put(edge_weight, g, *ei, 1.0); in test_triangular()
287 std::cerr << "(" << (char)(get(vertex_index, g, source(*ei, g)) + 'A') in test_triangular()
288 << ", " << (char)(get(vertex_index, g, target(*ei, g)) + 'A') in test_triangular()
301 circle_graph_layout(g, get(vertex_position, g), 25.0); in test_triangular()
303 bool ok = kamada_kawai_spring_layout(g, get(vertex_position, g), in test_triangular()
304 get(edge_weight, g), topology, side_length(50.0), kamada_kawai_done()); in test_triangular()
308 print_graph_layout(g, get(vertex_position, g), square_topology<>(50.)); in test_triangular()
310 dump_graph_layout("triangular-kk", g, get(vertex_position, g)); in test_triangular()
313 random_graph_layout(g, get(vertex_position, g), rect_top); in test_triangular()
315 dump_graph_layout("random", g, get(vertex_position, g)); in test_triangular()
318 num_vertices(g)); in test_triangular()
319 fruchterman_reingold_force_directed_layout(g, get(vertex_position, g), in test_triangular()
325 print_graph_layout(g, get(vertex_position, g), square_topology<>(50.)); in test_triangular()
327 dump_graph_layout("triangular-fr", g, get(vertex_position, g)); in test_triangular()
347 Graph g(&triangular_edges[0], &triangular_edges[13], 8); in test_disconnected() local
354 for (boost::tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi) in test_disconnected()
355 put(vertex_index, g, *vi, i++); in test_disconnected()
358 for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) in test_disconnected()
360 put(edge_weight, g, *ei, 1.0); in test_disconnected()
361 std::cerr << "(" << (char)(get(vertex_index, g, source(*ei, g)) + 'A') in test_disconnected()
362 << ", " << (char)(get(vertex_index, g, target(*ei, g)) + 'A') in test_disconnected()
367 circle_graph_layout(g, get(vertex_position, g), 25.0); in test_disconnected()
369 bool ok = kamada_kawai_spring_layout(g, get(vertex_position, g), in test_disconnected()
370 get(edge_weight, g), square_topology<>(50.0), side_length(50.0), in test_disconnected()
376 random_graph_layout(g, get(vertex_position, g), rect_top); in test_disconnected()
381 num_vertices(g)); in test_disconnected()
382 fruchterman_reingold_force_directed_layout(g, get(vertex_position, g), in test_disconnected()
388 print_graph_layout(g, get(vertex_position, g), square_topology<>(50.)); in test_disconnected()
390 dump_graph_layout("disconnected-fr", g, get(vertex_position, g)); in test_disconnected()