Fully static dimensional analysis with C++
Fully static dimensional analysis with C++
复制标题
使用 C 进行完全静态尺寸分析
DOI:
10.1145/185009.185036
复制
发表时间:
1994
影响因子:
--
通讯作者:
Zerksis D. Umrigar
中科院分区:
文献类型:
--
作者:
Zerksis D. Umrigar
Dimensional analysis is widely used by those involve d in the physical sciences as a quick check on the dimen sional sanity of formulas . Many programming error s can be prevented by performing similar checks automatically . Previous attempts at such dimensiona l analysis of computer programs either entailed som e run-time overhead [CG88] [Hi188], or required th e modification of an existing programming language t o add such a capability [Geh77] [Hou83] . This paper describes how an existing language C++ [Str9l] ca n be used to write programs which can be guaranteed to be dimensionally correct before run-time. Unfortunately, the method depends on a language construc t which violates the language definition . The paper argues that the rule forbidding the construct be re moved from the language definition, or that the for bidden construct be allowed as an extension by mos t compilers . In fact, a popular C++ compiler does accept this construct . This compiler was used to implement a general package for dimensional analysis . The capabilities of the package are briefly illustrated by means of an example . Ultimately, the method should have negligible run-time costs .