Don't test on two files but on random points again

This commit is contained in:
Andreas Fabri 2019-02-08 16:39:42 +01:00
parent 88add6bc7b
commit ce5472de15
1 changed files with 12 additions and 13 deletions

View File

@ -47,20 +47,20 @@ public:
static void test_insert_rnd_then_remove_all (unsigned pt_count, static void test_insert_rnd_then_remove_all (unsigned pt_count,
unsigned seed, unsigned seed,
const std::string& path) const std::string& /* path */)
{ {
std::cout << "--- test_insert_rnd (" << pt_count << ", " << seed << ')' << std::endl; std::cout << "--- test_insert_rnd (" << pt_count << ", " << seed << ')' << std::endl;
CGAL::Random random(seed); CGAL::Random random(seed);
// typedef CGAL::Creator_uniform_3<double, Point_3> Creator; typedef CGAL::Creator_uniform_3<double, Point_3> Creator;
// CGAL::Random_points_in_cube_3<Point_3, Creator> in_cube(0.5, random); CGAL::Random_points_in_cube_3<Point_3, Creator> in_cube(0.5, random);
Iso_cuboid iso_cuboid(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5); Iso_cuboid iso_cuboid(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
P3RT3 p3rt3(iso_cuboid); P3RT3 p3rt3(iso_cuboid);
std::ofstream stream("p3rt3_ir_point_set"); //std::ofstream stream("p3rt3_ir_point_set");
assert(stream); //assert(stream);
std::ifstream input_stream(path.c_str()); //std::ifstream input_stream(path.c_str());
std::vector<Weighted_point_3> insert_set; std::vector<Weighted_point_3> insert_set;
insert_set.reserve(pt_count); insert_set.reserve(pt_count);
@ -70,12 +70,12 @@ public:
std::cout << "-- insert" << std::endl; std::cout << "-- insert" << std::endl;
for (unsigned cnt = 1; cnt <= pt_count; ++cnt) for (unsigned cnt = 1; cnt <= pt_count; ++cnt)
{ {
// Weighted_point_3 p(*in_cube++, random.get_double(0., 0.015625)); Weighted_point_3 p(*in_cube++, random.get_double(0., 0.015625));
// std::cout << cnt << " : " << p << std::endl; // std::cout << cnt << " : " << p << std::endl;
Weighted_point_3 p; // Weighted_point_3 p;
input_stream >> p; // input_stream >> p;
assert(p.weight() < 0.015625); // assert(p.weight() < 0.015625);
stream << p << std::endl; // stream << p << std::endl;
std::size_t hidden_point_count = 0; std::size_t hidden_point_count = 0;
for (Cell_iterator iter = p3rt3.cells_begin(), end_iter = p3rt3.cells_end(); iter != end_iter; ++iter) for (Cell_iterator iter = p3rt3.cells_begin(), end_iter = p3rt3.cells_end(); iter != end_iter; ++iter)
@ -100,7 +100,7 @@ public:
insert_set.push_back(p); insert_set.push_back(p);
} }
stream.close(); //stream.close();
assert(p3rt3.is_valid()); assert(p3rt3.is_valid());
@ -138,7 +138,6 @@ public:
{ {
////// Iso_cuboid unitaire -> 0 <= weight < 0.015625 ////// Iso_cuboid unitaire -> 0 <= weight < 0.015625
test_insert_rnd_then_remove_all(800, 7, "data/p3rt3_point_set__s7_n800"); test_insert_rnd_then_remove_all(800, 7, "data/p3rt3_point_set__s7_n800");
test_insert_rnd_then_remove_all(800, 12, "data/p3rt3_point_set__s12_n800");
} }
}; };