remove useless abs

This commit is contained in:
Sébastien Loriot 2024-11-07 13:34:51 +01:00
parent 0ed0c3afcc
commit 2756e9bb31
2 changed files with 7 additions and 7 deletions

View File

@ -105,11 +105,11 @@ bool Filter<K>::isFree(Point const& fixed, Curve const& var_curve, PointID start
{
auto mid = (start + end + 1) / 2;
auto max = (CGAL::max)(var_curve.curve_length(start + 1, mid),
var_curve.curve_length(mid, end));
var_curve.curve_length(mid, end));
if (certainly(distance > max)){
auto mid_dist = Curve::distance(fixed, var_curve[mid]);
if(certainly(mid_dist <= CGAL::abs(distance - max))) { // Uncertain (A) // TODO: can we remove abs?
if(certainly(mid_dist <= distance - max)) { // Uncertain (A)
return true;
}
}

View File

@ -387,7 +387,7 @@ inline bool FrechetLight<C>::updateQSimpleInterval(QSimpleInterval& qsimple,
// heuristic tests avoiding sqrts
if (certainly(distance > maxdist)){
auto comp_dist1 = CGAL::abs(distance - maxdist); // TODO remove abs?
auto comp_dist1 = distance - maxdist;
if (certainly(mid_dist <= comp_dist1)) { // Uncertain (A)
qsimple.setFreeInterval(min, max); // full
qsimple.validate();
@ -395,7 +395,7 @@ inline bool FrechetLight<C>::updateQSimpleInterval(QSimpleInterval& qsimple,
return true;
}
}
auto comp_dist2 = CGAL::abs(distance + maxdist); // TODO remove abs?
auto comp_dist2 = distance + maxdist;
if (certainly(mid_dist > comp_dist2)) { // Uncertain (A)
qsimple.setFreeInterval(max, min); // empty
qsimple.validate();
@ -471,13 +471,13 @@ inline void FrechetLight<C>::continueQSimpleSearch(QSimpleInterval& qsimple,
auto mid_dist = Curve::distance(fixed_point, curve[mid]);
if (current_free && certainly(distance > maxdist) && // Uncertain (A)
certainly(mid_dist <= CGAL::abs(distance - maxdist))) { // TODO remove abs?
certainly(mid_dist <= distance - maxdist)) {
cur += stepsize;
stepsize *= 2;
continue;
}
if (!current_free && certainly(mid_dist > CGAL::abs(distance + maxdist))) { // Uncertain (A) // TODO remove abs?
if (!current_free && certainly(mid_dist > distance + maxdist)) { // Uncertain (A)
cur += stepsize;
stepsize *= 2;
@ -1082,7 +1082,7 @@ CPoint<C> FrechetLight<C>::getLastReachablePoint(Curve const& curve1, PointID i,
auto mid_dist = Curve::distance(point, curve2[mid]);
if(certainly(distance > maxdist) && (certainly(mid_dist <= CGAL::abs(distance - maxdist)))) { // Uncertain (A) // TODO remove abs?
if(certainly(distance > maxdist) && (certainly(mid_dist <= distance - maxdist))) { // Uncertain (A)
cur += stepsize;
stepsize *= 2;
}