Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Reinserting spheres in Min_sphere_of_spheres_d

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Reinserting spheres in Min_sphere_of_spheres_d


Chronological Thread 
  • From: Bernd Gaertner <>
  • To: <>
  • Subject: Re: [cgal-discuss] Reinserting spheres in Min_sphere_of_spheres_d
  • Date: Fri, 10 Sep 2010 11:03:11 +0200

Samuel Hornus wrote:
To speed-up the computation, I would like to reuse the
(already computed) Min_sphere from the left child of a node as a
starting point in which to include the points of the right child,
so as to obtain the bounding sphere of the node more quickly than from
scratch.

However, I get assertion failure in Min_sphere_of_spheres_d.h, line 253
(trunk), because vector 'l' is already non empty.

template<class Traits>
inline void Min_sphere_of_spheres_d<Traits>::update() {
// set up the vector l containing pointers to the balls in S:
HERE --> CGAL_MINIBALL_ASSERT(l.size() == 0);
for (typename std::vector<Sphere>::const_iterator it = S.begin();
it != S.end(); ++it)
l.push_back(&(*it));
// compute the miniball:
update(Algorithm());
is_up_to_date = true;
}

Is it truly intentional in the sense that the computation is not
restartable ? Or is it a over-zealous assertion ?

It is true that l needs to be empty; a restart does make use of the current optimal ball, but then goes through *all* inserted balls again for the update (this may be a waste in the first round of such an update, but it is unavoidable later). I think the fix is to insert the statement "l.clear();" right before the assertion. If you are successful with this, I will thoroughly test and submit a corresponding bug fix.

Best,
Bernd.



Archive powered by MHonArc 2.6.16.

Top of Page