[1]毕苏萍,周振红,赫晓慧..Fortran90借用C++函数模板[J].郑州大学学报(工学版),2013,34(02):64-66.[doi:10.3969/ j. issn. 1671 -6833.2013.00.017]
BI Su-ping,ZHOU Zhen-hong,HE Xiao-hui.Fortran 90 Using Function Templates from C ++[J].Journal of Zhengzhou University (Engineering Science),2013,34(02):64-66.[doi:10.3969/ j. issn. 1671 -6833.2013.00.017]
点击复制
Fortran90借用C++函数模板()
《郑州大学学报(工学版)》[ISSN:1671-6833/CN:41-1339/T]
- 卷:
-
34
- 期数:
-
2013年02期
- 页码:
-
64-66
- 栏目:
-
- 出版日期:
-
2013-03-28
文章信息/Info
- Title:
-
Fortran 90 Using Function Templates from C ++
- 作者:
-
毕苏萍; 周振红; 赫晓慧.
-
郑州大学土木工程学院,河南郑州,450001, 郑州大学水利与环境学院,河南郑州,450001
- Author(s):
-
BI Su-ping1; ZHOU Zhen-hong2; HE Xiao-hui2
-
1. School of Civil Engineering ,Zhengzhou University , Zhengzhou 450001 , China; 2.School of Water Conservancy and Environ-ment,Zhengzhou University ,Zhengzhou 450001 ,China
-
- 关键词:
-
科学与计算工程; 泛型编程; 函数模板; 泛型接口块; 混合编译
- Keywords:
-
scientific and engineering computing; generic programming; function template ; generic interfaceblock ; mixed compiling
- 分类号:
-
TP311
- DOI:
-
10.3969/ j. issn. 1671 -6833.2013.00.017
- 文献标志码:
-
A
- 摘要:
-
函数模板作为一种泛型编程方法,对科学与工程计算具有重要现实意义.首先,探讨了C++函数模板的实现机制,揭示了函数模板与重载函数间的关系;运用Fortran 90泛型接口块结合外部例程,对C++重载函数进行了模拟;然后,在C++环境中添加包装子以实例化函数模板,并将函数模板实例转化成接口一致的“重载”例程,进而在Fortran 90环境中使用C++函数模板.辅以示例程序,对相关的处理方法给予详细说明,也为其它语言借用C++函数模板提供了借鉴.
- Abstract:
-
The function template is a kind of generic programming,which possesses important practical signifi-cance in scientific and engineering computing.First , the implementing mechanism of C ++ function template isexplored , and the relationship between function templates and overloaded functions is disclosed. C ++ overloa-ded functions are modeled with the generic interface block plus external procedures of Fortran 90. Then , awrapper of C ++ function templates is appended in order to instantiate function templates,convert functiontemplate instances into “ overloaded”procedures , and make use of C ++ function templates in Fortran 90. Theabove-mentioned methods are particularly demonstrated with a demo. The research will also be helpful in ap-plying C ++ function templates in other languages.
更新日期/Last Update:
1900-01-01