mirror of https://github.com/CGAL/cgal
Solve bug on mac
This commit is contained in:
parent
74d19c4778
commit
22d372b297
|
|
@ -55,7 +55,6 @@ struct Test
|
||||||
public:
|
public:
|
||||||
Test() : nb_closed_pairs(0){ }
|
Test() : nb_closed_pairs(0){ }
|
||||||
|
|
||||||
template<bool optimized_version>
|
|
||||||
void close_triangles(std::vector<P> &points, std::vector<boost::container::small_vector<std::size_t, 3> >& triangles, FT d2){
|
void close_triangles(std::vector<P> &points, std::vector<boost::container::small_vector<std::size_t, 3> >& triangles, FT d2){
|
||||||
std::vector< CBox > boxes;
|
std::vector< CBox > boxes;
|
||||||
auto extend_bbox3=[&](const Iterator it, FT& d2){
|
auto extend_bbox3=[&](const Iterator it, FT& d2){
|
||||||
|
|
@ -75,14 +74,9 @@ public:
|
||||||
if(v.size()!=0) //they have common vertices
|
if(v.size()!=0) //they have common vertices
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool comp;
|
|
||||||
T tr1(points[a[0]], points[a[1]], points[a[2]]);
|
T tr1(points[a[0]], points[a[1]], points[a[2]]);
|
||||||
T tr2(points[b[0]], points[b[1]], points[b[2]]);
|
T tr2(points[b[0]], points[b[1]], points[b[2]]);
|
||||||
if constexpr(optimized_version)
|
bool comp = K().compare_squared_distance_3_object()(tr1, tr2, d2)!=CGAL::LARGER;
|
||||||
comp = K().compare_squared_distance_3_object()(tr1, tr2, d2)!=CGAL::LARGER;
|
|
||||||
else
|
|
||||||
comp = Old_compare_squared_distance_3<K>()(tr1, tr2, d2)!=CGAL::LARGER;
|
|
||||||
|
|
||||||
if(comp)
|
if(comp)
|
||||||
{
|
{
|
||||||
nb_closed_pairs++;
|
nb_closed_pairs++;
|
||||||
|
|
@ -108,15 +102,9 @@ public:
|
||||||
}
|
}
|
||||||
CGAL::Real_timer t;
|
CGAL::Real_timer t;
|
||||||
t.start();
|
t.start();
|
||||||
close_triangles<true>(input_points, input_triangles, d2);
|
close_triangles(input_points, input_triangles, d2);
|
||||||
t.stop();
|
t.stop();
|
||||||
std::cout << "New version: #points = " << input_points.size() << " and #triangles = " << input_triangles.size() << " has " << nb_closed_pairs << " pairs at squared distance " << d2 << " in " << t.time() << " sec." << std::endl;
|
std::cout << "#points = " << input_points.size() << " and #triangles = " << input_triangles.size() << " has " << nb_closed_pairs << " pairs at squared distance " << d2 << " in " << t.time() << " sec." << std::endl;
|
||||||
nb_closed_pairs=0;
|
|
||||||
t.reset();
|
|
||||||
t.start();
|
|
||||||
close_triangles<false>(input_points, input_triangles, d2);
|
|
||||||
t.stop();
|
|
||||||
std::cout << "Old version: #points = " << input_points.size() << " and #triangles = " << input_triangles.size() << " has " << nb_closed_pairs << " pairs at squared distance " << d2 << " in " << t.time() << " sec." << std::endl;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -254,9 +254,9 @@ private:
|
||||||
{
|
{
|
||||||
std::cout << "Point - Tetrahedron\n";
|
std::cout << "Point - Tetrahedron\n";
|
||||||
//Degenerate Tetrahedron
|
//Degenerate Tetrahedron
|
||||||
check_compare_squared_distance (p(1, 1, 1), Tet(p(0, 0, 0), p( 3, 0, 0), p( 0, 3, 0), p( 3, 3, 0)), 1);
|
check_compare_squared_distance (p(2, 2, 2), Tet(p(0, 0, 0), p( 6, 0, 0), p( 0, 6, 0), p( 6, 6, 0)), 4);
|
||||||
check_compare_squared_distance (p(1.5, 1.5, 0), Tet(p(0, 0, 0), p( 3, 0, 0), p( 0, 3, 0), p( 3, 3, 0)), 0);
|
check_compare_squared_distance (p(3, 3, 0), Tet(p(0, 0, 0), p( 6, 0, 0), p( 0, 6, 0), p( 6, 6, 0)), 0);
|
||||||
check_compare_squared_distance (p(4, 4, 0), Tet(p(0, 0, 0), p( 3, 0, 0), p( 0, 3, 0), p( 3, 3, 0)), 2);
|
check_compare_squared_distance (p(8, 8, 0), Tet(p(0, 0, 0), p( 6, 0, 0), p( 0, 6, 0), p( 6, 6, 0)), 8);
|
||||||
|
|
||||||
//Inside Tetrahedron
|
//Inside Tetrahedron
|
||||||
check_compare_squared_distance (p(1, 1, 1), Tet(p(0, 0, 0), p( 3, 0, 0), p( 0, 3, 0), p( 0, 0, 3)), 0);
|
check_compare_squared_distance (p(1, 1, 1), Tet(p(0, 0, 0), p( 3, 0, 0), p( 0, 3, 0), p( 0, 0, 3)), 0);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue