Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

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


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

On Thu, 2013-10-10 at 20:46 +0200, Stefan Salewski wrote:
> But some more testing shows that I seem to miss something:
> The test program below gives me a Segmentation fault message,

May the problem be simple that the output loop fails when we have only
one visible site?

I tried to fix it this way:

Apollonius_graph::Vertex_circulator Cvert =
ag.incident_vertices(ag.infinite_vertex());
Apollonius_graph::Vertex_circulator Cvert0 = Cvert;
int num_sites = ag.number_of_visible_sites();
if (num_sites == 0);
else if (num_sites == 1)
std::cout << ag.finite_vertex()->site() << std::endl;
else
{
do{
++Cvert;
std::cout << Cvert->site() << std::endl;
}while(Cvert0!=Cvert);
}

Is there a more elegant solution to catch (num_sites == 1)?
(I have no experience with this Vertex_circulator, so I took the code
from the hull.cpp demo file and missed the exception for only one site.)






Archive powered by MHonArc 2.6.18.

Top of Page