一种基于模板元编程的量纲检测方法  被引量:1

Dimensional Unit Analysis Method Based on Template Meta-programming

在线阅读下载全文

作  者:罗京丽 杜建革[2] 

机构地区:[1]江西省轻工高级技校,江西宜春336000 [2]南京理工大学,江苏南京210094

出  处:《现代电子技术》2009年第4期80-85,共6页Modern Electronics Technique

基  金:国家自然科学基金资助项目(60703072)

摘  要:量纲误用是科学计算应用程序中一种常见的错误,对计算结果的正确性影响很大。在此提出一种基于模板元编程的量纲检测方法TADA,能够有效完成C和C++程序代码的量纲检测工作。该方法利用程序设计语言自身的模板元编程功能,通过定义相关的量纲模板及其计算和标注方法,依靠编译器在编译期间完成量纲分析和检测,无需任何运行开销,有效解决了传统量纲检测系统中解方程组的计算量瓶颈等问题。Misuse of measurement units is a common mistake in many scientific computing applications. It greatly influences the correctness of the application results. TADA,a tool that effectively detects errors of this kind for C/C^++ programs is proposed. Making use of the function of template meta - programming in the language itself, TADA analyses the dimensional units and detects mismatches only by a standard C++ compiler in compile time without any runtime overhead. It avoids the computational bottleneck of solving linear equations introduced by traditional methods.

关 键 词:模板元编程 TADA 量纲 计算量瓶颈 

分 类 号:TP393[自动化与计算机技术—计算机应用技术]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象