CGAL中Fixed_precision_nt数值类型去向及移除原因问询
Hey there! Let me break down what happened to Fixed_precision_nt in CGAL for you.
Fixed_precision_nt Type? It was officially removed in CGAL 5.0
Yep, this numeric type got axed starting with CGAL 5.0. The core reason behind this removal was that it had overlapping functionality with other more robust, better-maintained types in the library, and it was becoming a maintenance burden for the CGAL team.Why it was cut
Fixed_precision_ntwas built for fixed-precision arithmetic, but over time, other types in CGAL became more popular and reliable for similar use cases. Think along the lines ofExact_predicates_inexact_constructions_kernel(which usesdoublefor fast, approximate geometric builds) andCGAL::Lazy_exact_nt(which balances speed and exactness smartly). The team decided to streamline the library by removing redundant or less-adopted components, andFixed_precision_ntlanded in that group.Go-to alternatives to use instead
Depending on your specific needs, here are the replacements you should consider:- For fast, approximate computations (the most common scenario where strict exactness isn't mandatory), use
doubledirectly or kernels that rely on it, likeExact_predicates_inexact_constructions_kernel. - If you need a mix of speed and exactness,
CGAL::Lazy_exact_ntis perfect—it holds off on exact calculations until absolutely necessary, keeping operations snappy for most tasks. - For strict, 100% exact arithmetic, opt for types like
CGAL::MP_Floator rational arithmetic setups (e.g.,CGAL::Quotient<CGAL::MP_Float>).
- For fast, approximate computations (the most common scenario where strict exactness isn't mandatory), use
Is it still hiding somewhere?
Nope, it's gone for good from official CGAL releases after 5.0. If you're working with an older version (pre-5.0), you'll still find it, but upgrading your CGAL version means you'll need to refactor your code to use one of the alternatives above.
内容的提问来源于stack exchange,提问作者Jesse Pepper

