Merge pull request #4484 from mglisse/Triangulation-test_Epeck_d-glisse

Also test Triangulation with Epeck_d
This commit is contained in:
Laurent Rineau 2020-02-14 14:46:38 +01:00
commit c4daad19a7
3 changed files with 37 additions and 13 deletions

View File

@ -109,6 +109,12 @@ template<typename AT, typename ET, typename AC, typename EC, typename E2A, typen
class Lazy_rep_XXX : class Lazy_rep_XXX :
public Lazy_rep< AT, ET, E2A >, private EC public Lazy_rep< AT, ET, E2A >, private EC
{ {
// `default_construct<T>()` is the same as `T{}`. But, this is a
// workaround to a MSVC-2015 bug (fixed in MSVC-2017): its parser
// seemed confused by `T{}` somewhere below.
template <typename T>
static T default_construct() { return T(); }
// Lazy_rep_0 does not inherit from EC or take a parameter AC. It has different constructors. // Lazy_rep_0 does not inherit from EC or take a parameter AC. It has different constructors.
static_assert(sizeof...(L)>0, "Use Lazy_rep_0 instead"); static_assert(sizeof...(L)>0, "Use Lazy_rep_0 instead");
template <class Ei, class Ai, class E2Ai, class Ki> friend class Lazy_kernel_base; template <class Ei, class Ai, class E2Ai, class Ki> friend class Lazy_kernel_base;
@ -138,7 +144,7 @@ class Lazy_rep_XXX :
// Currently we construct the vectors, then move them into the tuple. It would be nicer to construct them in their final destination, because eventually we will also have arrays instead of vectors. // Currently we construct the vectors, then move them into the tuple. It would be nicer to construct them in their final destination, because eventually we will also have arrays instead of vectors.
template<class...T,class LLL,class...LL> template<class...T,class LLL,class...LL>
Lazy_rep_XXX(Lazy_internal::typelist<T...>, const AC& ac, const EC& ec, LLL const&lll, LL const&...ll) : Lazy_rep_XXX(Lazy_internal::typelist<T...>, const AC& ac, const EC& ec, LLL const&lll, LL const&...ll) :
Lazy_rep<AT, ET, E2A>(ac(CGAL::approx(ll)...)), EC(ec), l(Lazy_internal::do_extract(T{},lll)...) Lazy_rep<AT, ET, E2A>(ac(CGAL::approx(ll)...)), EC(ec), l(Lazy_internal::do_extract(default_construct<T>(),lll)...)
{ {
//this->set_depth(std::max({ -1, (int)CGAL::depth(ll)...}) + 1); //this->set_depth(std::max({ -1, (int)CGAL::depth(ll)...}) + 1);
this->set_depth(1); // FIXME: now that we have ranges, we could actually compute the depth if we cared... this->set_depth(1); // FIXME: now that we have ranges, we could actually compute the depth if we cared...

View File

@ -10,6 +10,7 @@ int main()
#else #else
#include <CGAL/Epick_d.h> #include <CGAL/Epick_d.h>
#include <CGAL/Epeck_d.h>
#include <CGAL/point_generators_d.h> #include <CGAL/point_generators_d.h>
#include <CGAL/Delaunay_triangulation.h> #include <CGAL/Delaunay_triangulation.h>
#include <CGAL/algorithm.h> #include <CGAL/algorithm.h>
@ -112,13 +113,21 @@ void test(const int d, const string & type, const int N)
template< int D > template< int D >
void go(const int N) void go(const int N)
{ {
typedef CGAL::Epick_d<CGAL::Dimension_tag<D> > FK; typedef CGAL::Epick_d<CGAL::Dimension_tag<D> > KI;
typedef CGAL::Delaunay_triangulation<FK> Triangulation; typedef CGAL::Delaunay_triangulation<KI> Triangulation;
test<Triangulation>(D, "static", N); test<Triangulation>(D, "inexact static", N);
typedef CGAL::Epick_d<CGAL::Dynamic_dimension_tag> FK_dyn; typedef CGAL::Epick_d<CGAL::Dynamic_dimension_tag> KI_dyn;
typedef CGAL::Delaunay_triangulation<FK_dyn> Triangulation_dyn; typedef CGAL::Delaunay_triangulation<KI_dyn> Triangulation_dyn;
test<Triangulation_dyn>(D, "dynamic", N); test<Triangulation_dyn>(D, "inexact dynamic", N);
typedef CGAL::Epeck_d<CGAL::Dimension_tag<D> > KE;
typedef CGAL::Delaunay_triangulation<KE> TriangulationE;
test<TriangulationE>(D, "exact static", N);
typedef CGAL::Epeck_d<CGAL::Dynamic_dimension_tag> KE_dyn;
typedef CGAL::Delaunay_triangulation<KE_dyn> TriangulationE_dyn;
test<TriangulationE_dyn>(D, "exact dynamic", N);
} }
int main(int argc, char **argv) int main(int argc, char **argv)

View File

@ -1,4 +1,5 @@
#include <CGAL/Epick_d.h> #include <CGAL/Epick_d.h>
#include <CGAL/Epeck_d.h>
#include <CGAL/point_generators_d.h> #include <CGAL/point_generators_d.h>
#include <CGAL/Regular_triangulation.h> #include <CGAL/Regular_triangulation.h>
#include <CGAL/algorithm.h> #include <CGAL/algorithm.h>
@ -93,13 +94,21 @@ void test(const int d, const string & type, const int N)
template< int D > template< int D >
void go(const int N) void go(const int N)
{ {
typedef CGAL::Epick_d<CGAL::Dimension_tag<D> > FK; typedef CGAL::Epick_d<CGAL::Dimension_tag<D> > KI;
typedef CGAL::Regular_triangulation<FK> Triangulation; typedef CGAL::Regular_triangulation<KI> Triangulation;
test<FK, Triangulation>(D, "static", N); test<KI, Triangulation>(D, "inexact static", N);
typedef CGAL::Epick_d<CGAL::Dynamic_dimension_tag> FK_dyn; typedef CGAL::Epick_d<CGAL::Dynamic_dimension_tag> KI_dyn;
typedef CGAL::Regular_triangulation<FK_dyn> Triangulation_dyn; typedef CGAL::Regular_triangulation<KI_dyn> Triangulation_dyn;
test<FK_dyn, Triangulation_dyn>(D, "dynamic", N); test<KI_dyn, Triangulation_dyn>(D, "inexact dynamic", N);
typedef CGAL::Epeck_d<CGAL::Dimension_tag<D> > KE;
typedef CGAL::Regular_triangulation<KE> TriangulationE;
test<KE, TriangulationE>(D, "exact static", N);
typedef CGAL::Epeck_d<CGAL::Dynamic_dimension_tag> KE_dyn;
typedef CGAL::Regular_triangulation<KE_dyn> TriangulationE_dyn;
test<KE_dyn, TriangulationE_dyn>(D, "exact dynamic", N);
} }
void test_inserting_points_at_the_same_position() void test_inserting_points_at_the_same_position()