diff --git a/.gitattributes b/.gitattributes index be75ef04459..2b20a5dd257 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1231,7 +1231,6 @@ Packages/Mesh_2/bench/data/square.poly -text Packages/Mesh_2/demo/Mesh_2/contraints.xpm -text Packages/Mesh_2/demo/Mesh_2/marked.xpm -text Packages/Mesh_2/demo/Mesh_2/seeds.xpm -text -Packages/Min_sphere_of_spheres_d/test/Min_sphere_of_spheres_d/lp-alg-exact svneol=native#unset Packages/Min_sphere_of_spheres_d/test_extensive/stability/maple/balls-on-boundary-2.mws -text Packages/Min_sphere_of_spheres_d/test_extensive/stability/maple/balls-on-boundary-3.mws -text Packages/Min_sphere_of_spheres_d/web/figs/heuristic/excess.eps -text diff --git a/Packages/Min_sphere_of_spheres_d/include/CGAL/Min_sphere_of_spheres_d.h b/Packages/Min_sphere_of_spheres_d/include/CGAL/Min_sphere_of_spheres_d.h index da79c377062..3e5aac7dd03 100644 --- a/Packages/Min_sphere_of_spheres_d/include/CGAL/Min_sphere_of_spheres_d.h +++ b/Packages/Min_sphere_of_spheres_d/include/CGAL/Min_sphere_of_spheres_d.h @@ -108,10 +108,9 @@ namespace CGAL_MINIBALL_NAMESPACE { private: // for internal consisteny checks: #ifdef CGAL_MINIBALL_DEBUG - // The following variable is true if and only if no ball has been - // insert()'ed so far, or update() has been called. (This variable - // is used in is_valid() to make sure that the user has actually - // called update()...) + // The following variable is true if and only if the miniball + // has been computed of all inserted balls, i.e. iff no ball has been + // insert()'ed so far, or update() or set() has been called. bool is_up_to_date; #endif @@ -144,7 +143,7 @@ namespace CGAL_MINIBALL_NAMESPACE { inline Min_sphere_of_spheres_d(InputIterator begin,InputIterator end, const Traits& traits = Traits()) : t(traits), e(0), ss(t) { - CGAL_MINIBALL_DO_DEBUG(is_up_to_date = true); + CGAL_MINIBALL_DO_DEBUG(is_up_to_date = false); CGAL_MINIBALL_ASSERT(is_neg(ss.radius(),ss.disc())); insert(begin,end); // todo. better way? } @@ -186,6 +185,10 @@ namespace CGAL_MINIBALL_NAMESPACE { inline Support_iterator support_end() const; + inline const Traits& traits() const { + return t; + } + public: // validity check: bool is_valid() const; bool is_valid(const Tag_true is_exact) const; @@ -233,64 +236,68 @@ namespace CGAL_MINIBALL_NAMESPACE { template void Min_sphere_of_spheres_d::insert(const Sphere& b) { CGAL_MINIBALL_ASSERT(t.radius(b) >= FT(0)); - CGAL_MINIBALL_DO_DEBUG(is_up_to_date = false); l.push_back(&b); + CGAL_MINIBALL_DO_DEBUG(is_up_to_date = false); } template void Min_sphere_of_spheres_d::clear() { - CGAL_MINIBALL_DO_DEBUG(is_up_to_date = true); l.clear(); ss.reset(); e = 0; + CGAL_MINIBALL_DO_DEBUG(is_up_to_date = true); } template bool Min_sphere_of_spheres_d::is_empty() const { + CGAL_MINIBALL_ASSERT(is_up_to_date); return is_neg(ss.radius(),ss.disc()); } template const typename Min_sphere_of_spheres_d::Result& Min_sphere_of_spheres_d::radius() const { - CGAL_MINIBALL_ASSERT(!is_empty()); + CGAL_MINIBALL_ASSERT(is_up_to_date && !is_empty()); return ss.radius(); } template typename Min_sphere_of_spheres_d::Coordinate_iterator Min_sphere_of_spheres_d::center_begin() const { + CGAL_MINIBALL_ASSERT(is_up_to_date && !is_empty()); return ss.begin(); } template const typename Min_sphere_of_spheres_d::FT& Min_sphere_of_spheres_d::discriminant() const { + CGAL_MINIBALL_ASSERT(is_up_to_date && !is_empty()); return ss.disc(); } template inline void Min_sphere_of_spheres_d::update() { update(Algorithm()); + CGAL_MINIBALL_DO_DEBUG(is_up_to_date = true); } template inline bool Min_sphere_of_spheres_d::is_valid() const { - #ifdef CGAL_MINIBALL_DEBUG - CGAL_MINIBALL_ASSERT(!is_up_to_date); - #endif + CGAL_MINIBALL_ASSERT(is_up_to_date); return is_valid(Is_exact()); } template inline typename Min_sphere_of_spheres_d::Support_iterator Min_sphere_of_spheres_d::support_begin() const { + CGAL_MINIBALL_ASSERT(is_up_to_date); return Support_iterator(l.begin()); } template inline typename Min_sphere_of_spheres_d::Support_iterator Min_sphere_of_spheres_d::support_end() const { + CGAL_MINIBALL_ASSERT(is_up_to_date); return Support_iterator(l.begin()+e); } diff --git a/Packages/Min_sphere_of_spheres_d/test/Min_sphere_of_spheres_d/lp-alg-exact b/Packages/Min_sphere_of_spheres_d/test/Min_sphere_of_spheres_d/lp-alg-exact deleted file mode 100755 index 1d91e84e728..00000000000 Binary files a/Packages/Min_sphere_of_spheres_d/test/Min_sphere_of_spheres_d/lp-alg-exact and /dev/null differ diff --git a/Packages/Min_sphere_of_spheres_d/web/Min_sphere_of_spheres_d.fw b/Packages/Min_sphere_of_spheres_d/web/Min_sphere_of_spheres_d.fw index 0e74adf5019..9aac59c180d 100644 --- a/Packages/Min_sphere_of_spheres_d/web/Min_sphere_of_spheres_d.fw +++ b/Packages/Min_sphere_of_spheres_d/web/Min_sphere_of_spheres_d.fw @@ -2953,10 +2953,9 @@ private: // traits class: private: // for internal consisteny checks: #ifdef CGAL_MINIBALL_DEBUG - // The following variable is true if and only if no ball has been - // insert()'ed so far, or update() has been called. (This variable - // is used in is_valid() to make sure that the user has actually - // called update()...) + // The following variable is true if and only if the miniball + // has been computed of all inserted balls, i.e. iff no ball has been + // insert()'ed so far, or update() or set() has been called. bool is_up_to_date; #endif @@ -2989,7 +2988,7 @@ public: // construction and destruction: inline Min_sphere_of_spheres_d(InputIterator begin,InputIterator end, const Traits& traits = Traits()) : t(traits), e(0), ss(t) { - CGAL_MINIBALL_DO_DEBUG(is_up_to_date = true); + CGAL_MINIBALL_DO_DEBUG(is_up_to_date = false); CGAL_MINIBALL_ASSERT(is_neg(ss.radius(),ss.disc())); insert(begin,end); // todo. better way? } @@ -3031,6 +3030,10 @@ public: // predicates and accessors: inline Support_iterator support_end() const; + inline const Traits& traits() const { + return t; + } + public: // validity check: bool is_valid() const; bool is_valid(const Tag_true is_exact) const; @@ -3709,65 +3712,69 @@ namespace CGAL_MINIBALL_NAMESPACE { template void Min_sphere_of_spheres_d::insert(const Sphere& b) { CGAL_MINIBALL_ASSERT(t.radius(b) >= FT(0)); - CGAL_MINIBALL_DO_DEBUG(is_up_to_date = false); l.push_back(&b); + CGAL_MINIBALL_DO_DEBUG(is_up_to_date = false); } template void Min_sphere_of_spheres_d::clear() { - CGAL_MINIBALL_DO_DEBUG(is_up_to_date = true); l.clear(); ss.reset(); e = 0; + CGAL_MINIBALL_DO_DEBUG(is_up_to_date = true); } template bool Min_sphere_of_spheres_d::is_empty() const { + CGAL_MINIBALL_ASSERT(is_up_to_date); return is_neg(ss.radius(),ss.disc()); } template const typename Min_sphere_of_spheres_d::Result& Min_sphere_of_spheres_d::radius() const { - CGAL_MINIBALL_ASSERT(!is_empty()); + CGAL_MINIBALL_ASSERT(is_up_to_date && !is_empty()); return ss.radius(); } template typename Min_sphere_of_spheres_d::Coordinate_iterator Min_sphere_of_spheres_d::center_begin() const { + CGAL_MINIBALL_ASSERT(is_up_to_date && !is_empty()); return ss.begin(); } template const typename Min_sphere_of_spheres_d::FT& Min_sphere_of_spheres_d::discriminant() const { + CGAL_MINIBALL_ASSERT(is_up_to_date && !is_empty()); return ss.disc(); } template inline void Min_sphere_of_spheres_d::update() { update(Algorithm()); + CGAL_MINIBALL_DO_DEBUG(is_up_to_date = true); @!## CGAL_MINIBALL_ASSERT(is_valid(Is_exact())); } template inline bool Min_sphere_of_spheres_d::is_valid() const { - #ifdef CGAL_MINIBALL_DEBUG - CGAL_MINIBALL_ASSERT(!is_up_to_date); - #endif + CGAL_MINIBALL_ASSERT(is_up_to_date); return is_valid(Is_exact()); } template inline typename Min_sphere_of_spheres_d::Support_iterator Min_sphere_of_spheres_d::support_begin() const { + CGAL_MINIBALL_ASSERT(is_up_to_date); return Support_iterator(l.begin()); } template inline typename Min_sphere_of_spheres_d::Support_iterator Min_sphere_of_spheres_d::support_end() const { + CGAL_MINIBALL_ASSERT(is_up_to_date); return Support_iterator(l.begin()+e); }