feat: GMP 精确算术后端 + 可插拔谓词接口
CI / Build & Test (push) Failing after 38s
CI / Release Build (push) Failing after 28s

新增:
- include/vde/foundation/exact_predicates_gmp.h: GMP 精确谓词
  - orient_2d/3d, in_circle 完全精确(mpq_class 有理数)
  - 零舍入误差,任意精度
- include/vde/foundation/predicates.h: 统一谓词接口
  - Predicates<T> 编译期选择后端
  - VDE_USE_GMP=ON → GMP, OFF → 自适应 double
  - 便捷函数: orient(), in_circle()
- cmake/FindGMP.cmake: GMP 查找模块
- CMake: -DVDE_USE_GMP=ON 启用 GMP 精确模式
- AdaptiveDouble 包装器: 统一后端接口

使用:
  cmake -DVDE_USE_GMP=ON ..  # 完全精确模式
This commit is contained in:
ViewDesignEngine
2026-07-23 10:32:51 +00:00
parent 029dd6b75a
commit 8ae4b86e08
7 changed files with 167 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
find_path(GMP_INCLUDE_DIR gmp.h
PATHS /usr/include /usr/include/x86_64-linux-gnu
)
find_library(GMP_LIBRARY NAMES gmp libgmp
PATHS /usr/lib /usr/lib/x86_64-linux-gnu
)
find_library(GMPXX_LIBRARY NAMES gmpxx libgmpxx
PATHS /usr/lib /usr/lib/x86_64-linux-gnu
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GMP DEFAULT_MSG GMP_LIBRARY GMP_INCLUDE_DIR)
if(GMP_FOUND)
set(GMP_LIBRARIES ${GMPXX_LIBRARY} ${GMP_LIBRARY})
set(GMP_INCLUDE_DIRS ${GMP_INCLUDE_DIR})
mark_as_advanced(GMP_INCLUDE_DIR GMP_LIBRARY GMPXX_LIBRARY)
endif()