30 #include <mln/fun/i2v/array.hh>
31 #include <mln/core/image/image2d.hh>
32 #include <mln/core/alias/point2d.hh>
33 #include <mln/debug/println.hh>
34 #include <mln/util/graph.hh>
35 #include <mln/core/site_set/p_vertices.hh>
36 #include <mln/core/site_set/p_vertices_psite.hh>
37 #include <mln/debug/draw_graph.hh>
38 #include <mln/data/compare.hh>
42 typedef std::vector< mln::point2d > points_type;
44 typedef std::vector< std::pair<int,int> > edges_type;
50 void do_test(points_type& points,
const edges_type& edges,
59 for (edges_type::const_iterator i = edges.begin(); i != edges.end(); ++i)
60 g.add_edge(i->first, i->second);
71 mln_assertion(ima == ref);
97 edges.push_back(std::make_pair(0, 1));
99 do_test(points, edges, 3, 3, ref);
119 points.push_back(
point2d(0,0));
120 points.push_back(
point2d(2,2));
121 points.push_back(
point2d(0,4));
122 points.push_back(
point2d(4,3));
123 points.push_back(
point2d(4,4));
127 edges.push_back(std::make_pair(0, 1));
128 edges.push_back(std::make_pair(1, 2));
129 edges.push_back(std::make_pair(1, 3));
130 edges.push_back(std::make_pair(3, 4));
131 edges.push_back(std::make_pair(4, 2));
133 do_test(points, edges, 5, 5, ref);