29 #include <mln/core/image/image2d.hh>
30 #include <mln/core/alias/point2d.hh>
31 #include <mln/debug/println.hh>
32 #include <mln/util/graph.hh>
33 #include <mln/core/site_set/p_vertices.hh>
34 #include <mln/core/site_set/p_vertices_psite.hh>
35 #include <mln/debug/draw_graph.hh>
36 #include <mln/data/compare.hh>
40 typedef std::vector< mln::point2d > points_type;
42 typedef std::vector< std::pair<int,int> > edges_type;
48 void do_test(points_type& points,
const edges_type& edges,
57 for (edges_type::const_iterator i = edges.begin(); i != edges.end(); ++i)
58 g.add_edge(i->first, i->second);
61 typedef fun::i2v::array<mln::point2d> F;
69 mln_assertion(ima == ref);
95 edges.push_back(std::make_pair(0, 1));
97 do_test(points, edges, 3, 3, ref);
117 points.push_back(
point2d(0,0));
118 points.push_back(
point2d(2,2));
119 points.push_back(
point2d(0,4));
120 points.push_back(
point2d(4,3));
121 points.push_back(
point2d(4,4));
125 edges.push_back(std::make_pair(0, 1));
126 edges.push_back(std::make_pair(1, 2));
127 edges.push_back(std::make_pair(1, 3));
128 edges.push_back(std::make_pair(3, 4));
129 edges.push_back(std::make_pair(4, 2));
131 do_test(points, edges, 5, 5, ref);