From a4a1e51e02b02e989077248f5fd5f36ed4e8935a Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 15 Jun 2023 17:25:16 +0200 Subject: [PATCH] implementation permutations... and tests fail! --- .../test_segment_simplex_traverser_3.cpp | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/Triangulation_3/test/Triangulation_3/test_segment_simplex_traverser_3.cpp b/Triangulation_3/test/Triangulation_3/test_segment_simplex_traverser_3.cpp index 899bbfc742c..6940b5b5ff1 100644 --- a/Triangulation_3/test/Triangulation_3/test_segment_simplex_traverser_3.cpp +++ b/Triangulation_3/test/Triangulation_3/test_segment_simplex_traverser_3.cpp @@ -255,13 +255,11 @@ bool test_vfefv(bool with_bbox = false) return ok; } -bool test_a_simple_tetrahedron() { - std::cerr << "## test_a_simple_tetrahedron()\n"; +bool test_a_simple_tetrahedron(const std::vector& points) { + DT dt2; - dt2.insert({0, 0, 0}); - dt2.insert({1, 0, 0}); - dt2.insert({0, 1, 0}); - dt2.insert({0, 0, 1}); + for(const auto& p: points) dt2.insert(p); + bool ok = true; auto test = [&](Point_3 a, Point_3 b, std::string expected_result) { // This test function calls `do_test` with four configurations: @@ -404,6 +402,27 @@ bool test_a_simple_tetrahedron() { return ok; } +bool test_a_simple_tetrahedron() { + bool ok = true; + std::cerr << "## test_a_simple_tetrahedron()\n"; + + std::vector points = { + {0., 0., 0.}, + {1., 0., 0.}, + {0., 1., 0.}, + {0., 0., 1.}, + }; + std::sort(points.begin(), points.end()); + do { + std::cerr << "### new permutation of the four points\n"; + for(const auto& p: points) std::cout << " " << p << '\n'; + std::cerr << '\n'; + ok = test_a_simple_tetrahedron(points) && ok; + } + while (std::next_permutation(points.begin(), points.end())); + return ok; +} + bool test(const DT& dt, const std::pair& query, const std::array& expected_result);