From dae71df61b7e8dbdc36d0bfdbd2f7ab061e19085 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 23 Sep 2010 14:10:14 +0000 Subject: [PATCH] Code simplification --- .../include/CGAL/Min_sphere_of_spheres_d.h | 34 ++++--------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/Min_sphere_of_spheres_d/include/CGAL/Min_sphere_of_spheres_d.h b/Min_sphere_of_spheres_d/include/CGAL/Min_sphere_of_spheres_d.h index 6326584c714..d975a1f62e6 100644 --- a/Min_sphere_of_spheres_d/include/CGAL/Min_sphere_of_spheres_d.h +++ b/Min_sphere_of_spheres_d/include/CGAL/Min_sphere_of_spheres_d.h @@ -99,33 +99,19 @@ namespace CGAL_MINIBALL_NAMESPACE { insert(begin,end); // todo. better way? } - inline void prepare(std::size_t size); - - template - void prepare(InputIterator begin,InputIterator end) { - prepare(begin,end, - typename std::iterator_traits::iterator_category()); - } - - - template - void prepare(InputIterator begin,InputIterator end, Category) { - } - - template - void prepare(InputIterator begin,InputIterator end, std::random_access_iterator_tag) { - prepare(S.size()+(end-begin)); - } inline void insert(const Sphere& b); template inline void insert(InputIterator begin,InputIterator end) { - prepare(begin,end); - while (begin != end) { - insert(*begin); - ++begin; + std::size_t s = S.size(); + S.insert(S.end(), begin, end); + is_up_to_date = false; +#ifdef CGAL_MINIBALL_DEBUG + for(std::size_t i = 0; i < S.size(); i++){ + CGAL_MINIBALL_ASSERT(t.radius(S[i]) >= FT(0)); } +#endif } inline void clear(); @@ -197,12 +183,6 @@ namespace CGAL_MINIBALL_NAMESPACE { // that initially no ball is enclosed (cf. contains()). } - template - void Min_sphere_of_spheres_d::prepare(std::size_t size) { - S.reserve(size); - // (The vector l will be reserve()'d in update().) - } - template void Min_sphere_of_spheres_d::insert(const Sphere& b) { CGAL_MINIBALL_ASSERT(t.radius(b) >= FT(0));