论文标题
CGAL使更容易访问
CGAL Made More Accessible
论文作者
论文摘要
我们介绍了绑定,从而使CGAL的软件模块(计算几何算法库)的方便,高效且可靠地使用,这些模块是用C ++编写的,它是从Python编写的代码中编写的。有不同的工具可以促进这种绑定的创建。我们提出了一项简短的研究,该研究比较了三个主要工具,从而导致了选择的工具。计算几何形状中算法和数据结构的实现带来了巨大的困难,例如尽管使用(不确定的)浮点算术,在标准硬件中发现了(不确定的)浮点算术,以及对所有退化案例的细致处理,通常是丰富的。 CGAL的代码广泛使用功能和类模板来处理这些困难,这意味着程序员必须做出许多在编译时间(C ++模块)中解决的选择。虽然绑定在运行时间(Python代码的)生效,但在生成绑定时,即汇总时,必须知道绑定的C ++对象的类型。界对象的类型是C ++功能和类模板的实例(实例化类型)。在实施通用计算几何算法中,可能被绑定的对象类型的数量是巨大的;因此,实际上是不可能的所有这些类型的绑定的生成。通常可以做出几种选择,从而产生大量的组合。我们提出了一个系统,该系统会根据用户处方快速生成所需对象类型的绑定,该系统可以同时同时使用任何子集的任何子集。正如我们在本文中报道的那样,绑定的引入使它们在非计算领域的新移民和从业者中很容易访问。
We introduce bindings that enable the convenient, efficient, and reliable use of software modules of CGAL (Computational Geometry Algorithm Library), which are written in C++, from within code written in Python. There are different tools that facilitate the creation of such bindings. We present a short study that compares three main tools, which leads to the tool of choice. The implementation of algorithms and data structures in computational geometry presents tremendous difficulties, such as obtaining robust software despite the use of (inexact) floating point arithmetic, found in standard hardware, and meticulous handling of all degenerate cases, which typically are in abundance. The code of CGAL extensively uses function and class templates in order to handle these difficulties, which implies that the programmer has to make many choices that are resolved during compile time (of the C++ modules). While bindings take effect at run time (of the Python code), the type of the C++ objects that are bound must be known when the bindings are generated, that is, when they are compiled. The types of the bound objects are instances (instantiated types) of C++ function and class templates. The number of object types that can potentially be bound, in implementation of generic computational-geometry algorithms, is enormous; thus, the generation of the bindings for all these types in advance is practically impossible. Often there are several choices to make, resulting in a prohibitively large number of combinations. We present a system that rapidly generates bindings for desired object types according to user prescriptions, which enables the convenient use of any subset of bound object types concurrently. The introduction of the bindings made them easily accessible to newcomers and practitioners in non-computing fields, as we report in the paper.