期刊文献+

Fortran 90借用C++函数模板 被引量:1

Fortran 90 Using Function Templates from C++
下载PDF
导出
摘要 函数模板作为一种泛型编程方法,对科学与工程计算具有重要现实意义.首先,探讨了C++函数模板的实现机制,揭示了函数模板与重载函数间的关系;运用Fortran 90泛型接口块结合外部例程,对C++重载函数进行了模拟;然后,在C++环境中添加包装子以实例化函数模板,并将函数模板实例转化成接口一致的"重载"例程,进而在Fortran 90环境中使用C++函数模板.辅以示例程序,对相关的处理方法给予详细说明,也为其它语言借用C++函数模板提供了借鉴. 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 is explored,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, a wrapper of C ++ function templates is appended in order to instantiate function templates, convert function template instances into "overloaded" procedures, and make use of C ++ function templates in Fortran 90. The above-mentioned methods are particularly demonstrated with a demo. The research will also be helpful in ap- plying C ++ function templates in other languages.
出处 《郑州大学学报(工学版)》 CAS 北大核心 2013年第2期64-66,共3页 Journal of Zhengzhou University(Engineering Science)
基金 国家自然科学基金资助项目(41101095)
关键词 科学与计算工程 泛型编程 函数模板 泛型接口块 混合编译 scientific and engineering computing generic programming function template generic interface block mixed compiling
  • 相关文献

参考文献6

  • 1ALEXANDER A. STEPANOV. Generic programming [ EB/OL]. http ://www. stepanovpapers, corn/,2012. 5.22.
  • 2DAVID V, NICOLAI M J. C ++ Templates: The Complete Guide[ M ]. Addison Wesley,2003.
  • 3周振红,郭恒亮,张君静,等.Fo:ran90/95高级程序设计[M].郑州:黄河水利出版社,2005.
  • 4Fortran 2003 standard [ EB/OL ]. http ://www. j3-for- tran. org/doc/year/04/04-O07, pdf,2012. 5. 22.
  • 5CHIVERS S. Introduction to programming with fortran with coverage of fortran 90, 95,2003, 2008 and 77 [ M]. Springer, 2012.
  • 6任慧,周振红,张成才.Fortran与C/C++的混合编译[J].计算机工程与设计,2007,28(17):4096-4098. 被引量:14

二级参考文献4

共引文献13

同被引文献3

引证文献1

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部