mirror of https://github.com/CGAL/cgal
Use interval arithmetic where needed
This commit is contained in:
parent
35af188a03
commit
415645e8eb
|
|
@ -21,7 +21,7 @@ int main()
|
||||||
const std::filesystem::path data{"./data_2d"};
|
const std::filesystem::path data{"./data_2d"};
|
||||||
std::vector<std::string> filenames;
|
std::vector<std::string> filenames;
|
||||||
for (auto const& dir_entry : std::filesystem::directory_iterator{data}) {
|
for (auto const& dir_entry : std::filesystem::directory_iterator{data}) {
|
||||||
filenames.push_back(dir_entry.path());
|
filenames.push_back(dir_entry.path().string());
|
||||||
}
|
}
|
||||||
std::sort(filenames.begin(), filenames.end());
|
std::sort(filenames.begin(), filenames.end());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,8 @@ private:
|
||||||
for (size_t i = 0; i < 2*dim; ++i, ++pb, ++qb) {
|
for (size_t i = 0; i < 2*dim; ++i, ++pb, ++qb) {
|
||||||
// AF: certainly
|
// AF: certainly
|
||||||
// AN: yes, here we need certainly!
|
// AN: yes, here we need certainly!
|
||||||
if (CGAL::abs(*pb - *qb) > distance) {
|
CGAL::Interval_nt<true> ip = to_interval(*pb), iq = to_interval(*qb);
|
||||||
|
if (certainly(CGAL::abs(ip - iq) > distance)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -154,10 +155,9 @@ private:
|
||||||
{
|
{
|
||||||
typename Point_d::Cartesian_const_iterator_d pb = p.cartesian_begin();
|
typename Point_d::Cartesian_const_iterator_d pb = p.cartesian_begin();
|
||||||
for (int d = 0; d < D::value; ++d, ++pb) {
|
for (int d = 0; d < D::value; ++d, ++pb) {
|
||||||
if (rect.min_coord(d) > *pb + distance &&
|
CGAL::Interval_nt<true> irmin = to_interval(rect.min_coord(d)), ip = to_interval(*pb), irmax = to_interval(rect.max_coord(d));
|
||||||
rect.max_coord(d) + distance < *pb) {
|
if (certainly( irmin> ip + distance &&
|
||||||
// AF: certainly
|
irmax + distance < ip)){
|
||||||
// AN: yes, here is really certainly!
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue