Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Min_circle problem

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Min_circle problem


Chronological Thread 
  • From: Bernd Gaertner <>
  • To:
  • Subject: Re: [cgal-discuss] Min_circle problem
  • Date: Fri, 12 Sep 2008 11:04:19 +0200

Dear Atul,

> Its my mistake.
> I realized that I had some repeated points in my point set and I was
> expecting CGAL to take care of that. Now, I am checking my point set
> for all the points to be unique before applying Min_circle and
> it works.

You have all the right to expect that CGAL takes care of this, since we explicitly write in the manual: "The underlying algorithm can cope with all kinds of input, e.g. P may be empty or points may occur more than once."

I still think that the algorithm can cope with all kinds of input, given that *an exact kernel* is used. As already pointed out by Michael, this is not the case in your application (see the typedefs that I quote below from your code). The type NT and the exact kernel K are not used for Min_circle_2. You instantiate the class Min_circle_2 with Min_circle_2_traits_2<Rep>, where Rep is CGAL::Cartesian<double>. This is not an exact kernel, and the corresponding FAQ item on the cgal page (http://www.cgal.org/FAQ.html#inexact_NT) explains the possible consequences.

You certainly improve your chances of correct runs by removing duplicate points yourself, but please note that under CGAL::Cartesian<double>, there is *no guarantee*. You may still run into similar problems, for example if points are very close together.

Best,
Bernd.

------------------------------------------------------------------
typedef CGAL::Cartesian<double> Rep;
typedef CGAL::Point_2<Rep> Point;

typedef CGAL::Polygon_2<Rep> Polygon ;
typedef CGAL::Gmpz NT;
typedef CGAL::Homogeneous<NT> K;
typedef CGAL::Min_circle_2_traits_2<Rep> Traits;
typedef CGAL::Min_circle_2<Traits> Min_circle;



Archive powered by MHonArc 2.6.16.

Top of Page