共查询到20条相似文献,搜索用时 0 毫秒
1.
P. A. Lebedev 《Programming and Computer Software》2016,42(3):142-154
In this work we discuss usage of expression templates with features of modern C++ language standards. We give an evaluation model for expression templates that accounts for requirements of operator implementation functions. An algorithm for evaluation of expression templates in this model is presented with proof of its optimality. In conclusion we describe implementation methods that are necessary for implementing this algorithm on modern compilers. 相似文献
2.
Marco Nehmeier 《Computing》2012,94(2-4):215-228
In this paper we will discuss different realizations for an efficient interval arithmetic implementation using expression templates and template meta programming in C++. We will improve the handling of the rounding mode switches using expression templates and show how the constructed expression trees can be combined with other features like automatic differentiation. For a further improvement of the run time performance we try to move as many functionality as possible to the compile time using template meta programming techniques. In addition we will illustrate how an interval arithmetic implementation will profit from new features and keywords defined in the upcoming C++ standard. 相似文献
3.
最优化设计的程序实现方法决定了优化算法的执行效率及代码可读性,进而影响到优化设计在工程中的应用前景.最优化设计算法中常涉及到复杂的矩阵运算.通过分析比较几类实现矩阵运算的常用方法的优缺点,提出了基于C 表达式模板的最优化设计程序实现方法.最后,以DFP变尺度优化程序为实例,从程序可读性及执行效率上将几类方法进行了对比.结果表明,基于C 表达式模板实现的最优化设计程序在保证程序执行效率的基础上,能够提高程序的可重用性及可读性. 相似文献
4.
Joseph Gil 《Science of Computer Programming》2010,75(7):573-595
Most large software applications rely on an external relational database for storing and managing persistent data. Typically, such applications interact with the database by first constructing strings that represent SQL statements, and then submitting these for execution by the database engine. The fact that these statements are only checked for correctness at runtime is a source for many potential defects, including type and syntax errors and vulnerability to injection attacks.The AraRat system presented here offers a method for dealing with these difficulties by coercing the host C++ compiler to do the necessary checks of the generated strings. A library of templates and preprocessor directives is used to embed in C++ a little language representing an augmented relational algebra formalism. Type checking of this embedded language, carried out by our template library, assures, at compile-time, the correctness and safety of the generated SQL strings. All SQL statements constructed by AraRat are guaranteed to be syntactically correct, and type safe with respect to the database schema. Moreover, AraRat statically ensures that the generated statements are immune to all injection attacks.The standard techniques of “expression templates” and “compile-time symbolic derivation” for compile-time representation of symbolic structures, are enhanced in our system. We demonstrate the support of a type system and a symbol table lookup of the symbolic structure. A key observation of this work is that type equivalence of instantiated nominally typed generics in C++ (as well as other languages, e.g., Java) is structural rather than nominal. This makes it possible to embed the structural type system, characteristic to persistent data management, in the nominal type system of C++.For some of its advanced features, AraRat relies on two small extensions to the standard C++ language: the typeof pseudo operator and the __COUNTER__ preprocessor macro. 相似文献
5.
6.
This paper concerns the use of design/source-code complexity metrics in analysing C++ software. It describes the use of one suite of object-oriented metrics published by Chidamber and Kemerer1 to evaluate a commercial C++ application. It provides an interpretation and critique of these metrics, including the use of two traditional metrics (Cyclomatic Complexity2 and Software Science3) in association with these object-oriented metrics. The evolution, over a two and a half year period, of one commercial grade C++ application comprising 114 classes with 25,000 lines of code is studied. The efforts consumed in bug fixes and enhancements are correlated with the complexity measures on a per class basis, and results are presented. These results are compared to those from other workers. The paper provides a detailed analysis of the practical strengths and weaknesses of the metrics suite in the light of experiences with its use. © 1998 John Wiley & Sons, Ltd. 相似文献
7.
在计算机软件中,程序缺陷不可避免且极有可能造成重大损失.因此,尽早发现并排除程序中潜在的缺陷,是学术界和工业界的普遍共识.目前的程序缺陷自动修复方法大都遵循缺陷定位、修复候选项生成、选择及验证的流程,但在修复实际程序时存在修复率低、无法保证修复结果的正确性等问题.提出了一种基于程序合成的C/C++程序缺陷自动修复方法.首先,从满足相同规约的程序集中,通过人工整理的方式总结错误模式及其对应的修复方法,使用重写规则表达错误模式,在此基础上实现了基于重写规则和基于程序频谱的缺陷定位方法,得到程序中可能的缺陷位置;其次,基于重写规则,使用修复选项生成方法得到缺陷的修复选项,同时,通过深度学习的方式学习正确程序的书写结构,帮助预测错误程序错误点应有的语句结构,通过这两种方式提高候选项质量,进而提高修复率;最后,在选择验证过程中,使用程序合成的方法将样例程序作为约束,保证合成后代码的正确性.基于上述方法实现了原型工具AutoGrader,并在容易出错、缺陷典型的学生作业程序上进行了实验,结果显示,该方法对学生作业程序中的缺陷有着较高的修复率,同时也能保证修复后代码的正确性. 相似文献
8.
介绍了一种基于Visual C++的编程环境实现UPS电源性能指标的自动测试系统的设计方案,该系统方案采用了16位高速A/D采集卡,通过多线程协调运行结合事件和消息机制达到数据的采集和处理工作,利用中间临时数据区的方式很好解决了读写冲突的难题,结合共用数据区的方式,实现了UPS电源的稳态指标和瞬态性能指标的测试。实验结果表明,该系统能够有效的完成UPS电源的性能指标测试。 相似文献
9.
10.
MSC/PATRAN是著名的有限元分析软件,广泛应用于航空、航天、汽车、造船、国防等各大领域,它为用户提供了二次开发的PCL语言。对用MSC/PATRAN的PCL语言进行二次开发的过程和如何运用c++Builder语言编写程序实现对MSC/PATRAN的控制作了实例说明,本实例具有普遍性,用户可参照本实例开发自己的应用程序。 相似文献
11.
12.
13.
The paper treats an example arising from a problem in educational planning. The provision of places in a sector of education to satisfy an unknown social demand is treated as a "dual-control" process. Dynamic programming is used to determine the sequence of decisions which extremizes a performance criterion. Results are obtained for different forms of a priori distributions of the unknown demand. Because answers can be obtained analytically without approximation, the optimum policy can be compared with the nonoptimum policy of optimizing stage by stage. The paper also discusses the effect of the decision maker's a priori knowledge upon the infinite stage process. 相似文献
14.
Gustavo Zavala Antonio J. Nebro Francisco Luna Carlos A. Coello Coello 《Structural and Multidisciplinary Optimization》2016,53(3):545-566
Many structural design problems in the field of civil engineering are naturally multi-criteria, i.e., they have several conflicting objectives that have to be optimized simultaneously. An example is when we aim to reduce the weight of a structure while enhancing its robustness. There is no a single solution to these types of problems, but rather a set of designs representing trade-offs among the conflicting objectives. This paper focuses on the application of multi-objective metaheuristics to solve two variants of a real-world structural design problem. The goal is to compare a representative set of state-of-the-art multi-objective metaheuristic algorithms aiming to provide civil engineers with hints as to what optimization techniques to use when facing similar problems as those selected in the study presented in this paper. Accordingly, our study reveals that MOCell, a cellular genetic algorithm, provides the best overall performance, while NSGA-II, the de facto standard multi-objective metaheuristic technique, also demonstrates a competitive behavior. 相似文献
15.
This paper presents an algebraic approach to polynomial spectral factorization, an important mathematical tool in signal processing and control. The approach exploits an intriguing relationship between the theory of Gröbner bases and polynomial spectral factorization which can be observed through the sum of roots, and allows us to perform polynomial spectral factorization in the presence of real parameters. It is discussed that parametric polynomial spectral factorization enables us to express quantities such as the optimal cost in terms of parameters and the sum of roots. Furthermore an optimization method over parameters is suggested that makes use of the results from parametric polynomial spectral factorization and also employs two quantifier elimination techniques. This proposed approach is demonstrated in a numerical example of a particular control problem. 相似文献
16.
余建宝 《数字社区&智能家居》2007,3(14):430-431
本文从Web Service的特性和关键技术入手,全面论述了Web Service的工作原理,并在此基础之上提出了在C builder中调,用远端的Web Service具体实现方案,为跨平台跨语言之间的WEB服务调用提供了一种普适性的解决方法. 相似文献
17.
The author proposes a new approach for multimethod implementation in C++ based on recursive deferred dispatching. The proposed approach provides a partially broken dependency between target classes and a broken dependency between target classes and multimethods. This approach provides multimethods with strong type safety and constant execution time. A multimethod is a virtual method of several objects. Programming languages such as Dylan and the Common Lisp Object System (CLOS) allow for multimethods. 相似文献
18.
19.
《Information and Software Technology》2001,43(13):801-812
This paper describes an investigation into the use of coupling complexity metrics to obtain early indications of various properties of a system of C++ classes. The properties of interest are: (i) the potential reusability of a class and (ii) the likelihood that a class will be affected by maintenance changes made to the overall system. The study indicates that coupling metrics can provide useful indications of both reusable classes and of classes that may have a significant influence on the effort expended during system maintenance and testing. 相似文献
20.
M. Bielli G. Calicchio B. Nicoletti S. Ricciardelli 《Computers & Operations Research》1982,9(4):265-278
In this paper the air traffic flow control is approached as a constrained optimization problem on a multicommodity network. The proposed dynamic mathematical model, by means of a suitable time discretization, has been changed into a “static” one, in order to use static network flow algorithms while taking into account the “unsteady” nature of the air traffic congestion problems.The complexity of the model requires some preliminary effort, such as the identification of some characteristic parameters of the system.In this paper, the network theory is applied to evaluate the influence of the time discretization interval on the model significancy with respect to the actual traffic situation. In particular, a computational example concerning the Rome air traffic control region is presented and the relative results are discussed. 相似文献