Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Apollonius Graph -- Segmentation fault

Subject: CGAL users discussion list

List archive

[cgal-discuss] Apollonius Graph -- Segmentation fault


Chronological Thread 
  • From: Stefan Salewski <>
  • To:
  • Subject: [cgal-discuss] Apollonius Graph -- Segmentation fault
  • Date: Thu, 10 Oct 2013 20:46:36 +0200

For my initial tests I got the convex hull as expected, so I started
writing the bindings for Ruby language.

But some more testing shows that I seem to miss something:
The test program below gives me a Segmentation fault message,
the problem seems to be the site with large weight 5.
Is this intended behaviour -- what Do I miss?
My real data may contain only a few circles, maybe with one big one,
which may partly or fully cover all the other.

The code is based on the hull.cpp example

#include <iostream>
#include <CGAL/MP_Float.h>
typedef CGAL::MP_Float NT;
#include <CGAL/Simple_cartesian.h>
typedef CGAL::Simple_cartesian<NT> Kernel;
#include <CGAL/Apollonius_graph_2.h>
#include <CGAL/Apollonius_graph_traits_2.h>
typedef CGAL::Apollonius_graph_traits_2<Kernel> Traits;
typedef CGAL::Apollonius_graph_2<Traits> Apollonius_graph;
#include <CGAL/Apollonius_site_2.h>
typedef Apollonius_graph::Vertex_handle VH;
typedef Apollonius_graph::Site_2 Site;
typedef Site::Point_2 Point;

int main()
{
Apollonius_graph ag;

// first test
//ag.insert(Site(Point(0, 1), 1)); // hull is these two points as
expected!
//ag.insert(Site(Point(1, 0), 1));

// second test
//ag.insert(Site(Point(0, 0), 2.2));
//ag.insert(Site(Point(1.6, 1.6), 3)); // hull includes this point twice
//ag.insert(Site(Point(3.0001, 3), 2));

ag.insert(Site(Point(0, 0), 2.2));
ag.insert(Site(Point(1.6, 1.6), 5)); // Segmentation fault
ag.insert(Site(Point(3.0001, 3), 2));

Apollonius_graph::Vertex_circulator Cvert =
ag.incident_vertices(ag.infinite_vertex());
Apollonius_graph::Vertex_circulator Cvert0 = Cvert;
do{
++Cvert;
std::cout << Cvert->site() << std::endl;
}while(Cvert0!=Cvert);
return 0;
}




Archive powered by MHonArc 2.6.18.

Top of Page