Most numerical solvers and libraries nowadays are implemented to use mathematical models created with language-specific built-in data types (e.g. real in Fortran or double in C) and their respective elementary algebra implementations. However, the built-in elementary algebra typically has limited functionality and often restricts the flexibility of mathematical models and the analysis types that can be applied to those models. To overcome this limitation, a number of domain-specific languages such as gPROMS or Modelica with more feature-rich built-in data types have been proposed. In this paper, we argue that if numerical libraries and solvers are designed to use abstract elementary algebra rather than the language-specific built-in algebra, modern mainstream languages can be as effective as any domain-specific language. We illustrate our ideas using the example of sparse Jacobian matrix computation. We implement an automatic differentiation method that takes advantage of sparse system structures and is straightforward to parallelize in a distributed memory setting. Furthermore, we show that the computational cost scales linearly with the size of the system.
翻译:目前,大多数数字求解器和图书馆都应用了以特定语言内置数据类型(例如,佛特兰的真数或C的双数)和各自初级代数执行方式创建的数学模型。然而,内置基本代数通常功能有限,常常限制数学模型的灵活性和可适用于这些模型的分析类型。为了克服这一限制,已经提议了一些特定领域的语言,如具有更多特性丰富的内置数据类型的GPROMS或模型。在本文中,我们争辩说,如果数字图书馆和求解器设计使用抽象的初代数,而不是语言内置代数,现代主流语言可以与任何特定领域的语言一样有效。我们用稀疏的雅各布矩阵计算模型的例子来说明我们的想法。我们采用了一种自动区分方法,利用稀少的系统结构,在分布式记忆设置中比较简单。此外,我们显示计算成本的线性尺度与系统大小是线性的。