...
首页> 外文期刊>Scientific programming >Formula Translation in Blitz++, NumPy and Modern Fortran: A Case Study of the Language Choice Tradeoffs
【24h】

Formula Translation in Blitz++, NumPy and Modern Fortran: A Case Study of the Language Choice Tradeoffs

机译:Blitz ++,NumPy和现代Fortran中的公式翻译:以语言选择权衡为例

获取原文

摘要

Three object-oriented implementations of a prototype solver of the advection equation are introduced. The presented programs are based on Blitz++ (C++), NumPy (Python) and Fortran's built-in array containers. The solvers constitute implementations of the Multidimensional Positive-Definite Advective Transport Algorithm (MPDATA). The introduced codes serve as examples for how the application of object-oriented programming (OOP) techniques and new language constructs from C++11 and Fortran 2008 allow to reproduce the mathematical notation used in the literature within the program code. A discussion on the tradeoffs of the programming language choice is presented. The main angles of comparison are code brevity and syntax clarity (and hence maintainability and auditability) as well as performance. All performance tests are carried out using free and open-source compilers. In the case of Python, a significant performance gain is observed when switching from the standard interpreter (CPython) to the PyPy implementation of Python. Entire source code of all three implementations is embedded in the text and is licensed under the terms of the GNU GPL license.
机译:介绍了平流方程原型求解器的三种面向对象的实现。所展示的程序基于Blitz ++(C ++),NumPy(Python)和Fortran的内置数组容器。求解器构成多维正定意见传输算法(MPDATA)的实现。引入的代码用作示例,说明如何使用面向对象编程(OOP)技术和C ++ 11和Fortran 2008中的新语言构造来在程序代码内重现文献中使用的数学符号。讨论了编程语言选择的权衡问题。比较的主要角度是代码简洁性和语法清晰性(以及因此的可维护性和可审计性)以及性能。所有性能测试都是使用免费的开源编译器进行的。对于Python,从标准解释器(CPython)切换到Python的PyPy实现时,可以观察到显着的性能提升。这三种实现的全部源代码都嵌入在文本中,并根据GNU GPL许可的条款获得许可。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号