mirror of https://github.com/CGAL/cgal
using epsilon tolerance for Simple_cartesian<double> instead of exact comparison
This commit is contained in:
parent
cd3d7528ec
commit
9611c8f3c0
|
|
@ -71,21 +71,21 @@ void run()
|
||||||
typename K_search::iterator it = oins.begin();
|
typename K_search::iterator it = oins.begin();
|
||||||
typename K_search::Point_with_transformed_distance pd = *it;
|
typename K_search::Point_with_transformed_distance pd = *it;
|
||||||
points2.push_back(get_point(pd.first));
|
points2.push_back(get_point(pd.first));
|
||||||
if(CGAL::squared_distance(query,get_point(pd.first)) != pd.second){
|
if(abs(CGAL::squared_distance(query, get_point(pd.first)) - pd.second) >= 0.000000001){
|
||||||
std::cout << "different distances: " << CGAL::squared_distance(query,get_point(pd.first)) << " != " << pd.second << std::endl;
|
std::cout << "different distances: " << CGAL::squared_distance(query,get_point(pd.first)) << " != " << pd.second << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(CGAL_IA_FORCE_TO_DOUBLE(CGAL::squared_distance(query,get_point(pd.first))) == pd.second);
|
assert(abs(CGAL::squared_distance(query, get_point(pd.first)) - pd.second) < 0.000000001);
|
||||||
it++;
|
it++;
|
||||||
for(; it != oins.end();it++){
|
for(; it != oins.end();it++){
|
||||||
typename K_search::Point_with_transformed_distance qd = *it;
|
typename K_search::Point_with_transformed_distance qd = *it;
|
||||||
assert(pd.second <= qd.second);
|
assert(pd.second <= qd.second);
|
||||||
pd = qd;
|
pd = qd;
|
||||||
points2.push_back(get_point(pd.first));
|
points2.push_back(get_point(pd.first));
|
||||||
if(CGAL_IA_FORCE_TO_DOUBLE(CGAL::squared_distance(query,get_point(pd.first))) != pd.second){
|
if(abs(CGAL::squared_distance(query, get_point(pd.first)) - pd.second) >= 0.000000001){
|
||||||
std::cout << "different distances: " << CGAL::squared_distance(query,get_point(pd.first)) << " != " << pd.second << std::endl;
|
std::cout << "different distances: " << CGAL::squared_distance(query,get_point(pd.first)) << " != " << pd.second << std::endl;
|
||||||
}
|
}
|
||||||
assert(CGAL_IA_FORCE_TO_DOUBLE(CGAL::squared_distance(query,get_point(pd.first))) == pd.second);
|
assert(abs(CGAL::squared_distance(query, get_point(pd.first)) - pd.second) < 0.000000001);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -176,6 +176,7 @@ bool search(bool nearest)
|
||||||
|
|
||||||
int
|
int
|
||||||
main() {
|
main() {
|
||||||
|
std::cout << std::setprecision(17);
|
||||||
bool OK=true;
|
bool OK=true;
|
||||||
std::cout << "Testing Incremental_neighbor_search\n";
|
std::cout << "Testing Incremental_neighbor_search\n";
|
||||||
run<Incremental_neighbor_search>();
|
run<Incremental_neighbor_search>();
|
||||||
|
|
|
||||||
|
|
@ -60,20 +60,23 @@ struct Splitter_test {
|
||||||
typename Orthogonal_incremental_neighbor_search::iterator it = oins.begin();
|
typename Orthogonal_incremental_neighbor_search::iterator it = oins.begin();
|
||||||
Point_with_transformed_distance pd = *it;
|
Point_with_transformed_distance pd = *it;
|
||||||
points2.push_back(get_point(pd.first));
|
points2.push_back(get_point(pd.first));
|
||||||
if(CGAL::squared_distance(query,get_point(pd.first)) != pd.second){
|
|
||||||
|
std::cout << std::setprecision(17);
|
||||||
|
|
||||||
|
if(abs(CGAL::squared_distance(query, get_point(pd.first)) - pd.second) >= 0.000000001){
|
||||||
std::cout << CGAL::squared_distance(query,get_point(pd.first)) << " != " << pd.second << std::endl;
|
std::cout << CGAL::squared_distance(query,get_point(pd.first)) << " != " << pd.second << std::endl;
|
||||||
}
|
}
|
||||||
assert(CGAL_IA_FORCE_TO_DOUBLE(CGAL::squared_distance(query,get_point(pd.first))) == pd.second);
|
assert(abs(CGAL::squared_distance(query,get_point(pd.first)) - pd.second) < 0.000000001);
|
||||||
it++;
|
it++;
|
||||||
for(; it != oins.end();it++){
|
for(; it != oins.end();it++){
|
||||||
Point_with_transformed_distance qd = *it;
|
Point_with_transformed_distance qd = *it;
|
||||||
assert(pd.second <= qd.second);
|
assert(pd.second <= qd.second);
|
||||||
pd = qd;
|
pd = qd;
|
||||||
points2.push_back(get_point(pd.first));
|
points2.push_back(get_point(pd.first));
|
||||||
if(CGAL_IA_FORCE_TO_DOUBLE(CGAL::squared_distance(query,get_point(pd.first))) != pd.second){
|
if(abs(CGAL::squared_distance(query, get_point(pd.first)) - pd.second) >= 0.000000001){
|
||||||
std::cout << CGAL::squared_distance(query,get_point(pd.first)) << " != " << pd.second << std::endl;
|
std::cout << CGAL::squared_distance(query,get_point(pd.first)) << " != " << pd.second << std::endl;
|
||||||
}
|
}
|
||||||
assert(CGAL_IA_FORCE_TO_DOUBLE(CGAL::squared_distance(query,get_point(pd.first))) == pd.second);
|
assert(abs(CGAL::squared_distance(query, get_point(pd.first)) - pd.second) < 0.000000001);
|
||||||
}
|
}
|
||||||
std::sort(points.begin(),points.end());
|
std::sort(points.begin(),points.end());
|
||||||
std::sort(points2.begin(),points2.end());
|
std::sort(points2.begin(),points2.end());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue