1

For the performance concerns I am using exact predicates inexact constructions to compute and compare my distance-based operations. However, if the result causes inaccuracy, I want to repeat the same operations by using exact predicates exact constructions. How can I understand there occurred an inaccurate operation? Does CGAL::Precondition_exception work? For instance I plan to the followings in a try block:

  • Compute the point-plane distance by using CGAL::squared_distance() method with inexact constructions
  • Compare the resulting CGAL::Lazy_exact_nt<boost::multiprecision::mpq_rational> values Then if there is thrown a CGAL::Precondition_exception exception, I want to repeat the same steps with exact constructions.

Is this a healthy/robust approach?

user16217248
  • 3,119
  • 19
  • 19
  • 37
Merve A
  • 31
  • 4
  • Precondition_exception has nothing to do with what you are asking. If you compute with inexact construction, you get double, not Lazy_exact_nt. The exact construction kernel already has a lazy approach where it computes approximately and only recomputes exactly if needed. – Marc Glisse Mar 26 '23 at 07:37
  • Then, is there a way to understand whether the result of an operation is unambiguous? Indeed I want to follow the approach given in "Indirect Predicates for Geometric Constructions" paper. It starts with filtered evaluation in floating point, if the result is ambiguous, it repeats operations by applying filtered evaluation using intervals. If the ambiguity is not resolved, it applies exact arithmetic. How can I understand the ambiguity? – Merve A Mar 26 '23 at 09:00
  • That is explained in the paper, you'll have to read it more carefully. You can also have a look at the corresponding code in https://github.com/MarcoAttene/Indirect_Predicates . IIRC he did his benchmarks on windows, which (again IIRC) is particularly slow for Epeck, compared for instance to linux, in which case I wouldn't expect gains as high as he showed. – Marc Glisse Mar 26 '23 at 10:27
  • I have already read the full paper two times. Unfortunately, I could not understand it exactly. It writes the formulas, says no division, check for the numerator and denominator signs. But I still do not understand how the sign is understood exactly when a summation operation is done in the numerator for instance. It gives the code for Delaunay triangles if I am not wrong. Every operation is unique and I need the things that are special to my job. To sum up, if only there was a method for it in CGAL and I could use it quickly in the limited time. – Merve A Mar 26 '23 at 11:11

0 Answers0