首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 31 毫秒
1.
对于泛型程序设计来说,类型理论中的参数化多态是其理论框架,因为参数化多态引入了类型变量,使得类型参数化,从而完全支持类型上的抽象。然而对于现行的泛型算法,无论是C++标准模版库中的泛型算法还是基于函数式程序设计语言的算法,函数功能的定义比较具体化、单一化,因而缺乏可扩展性和高度的复用性。将对递归算法进行抽象,构造原始递归构造子,使得一般的泛型算法都可以通过该算子来构造,从而加强泛型算法的可复用型与可扩展性。除此之外,分析了递归算法构造子与泛型程序设计中的iterator概念和用于描叙泛型概念的形式化语言Tecton中所提倡的reuse概念的一致性。也给出算法复杂度的定量分析,并用函数式语言ML来实现。  相似文献   

2.
Design solutions have been proposed to implement generic data structures, however such techniques dedicated to algorithms are not well known. This article discusses various recurrent problems encountered when designing reusable, extensible algorithms for operations research. It explains how to use object‐oriented concepts and the notion of genericity to design algorithms that are independent of the data structures and the algorithms they use, but that can still interact deeply with them. An object‐oriented design is sometimes considered to be less efficient than a classical one, and operations research is one of these scientific fields where efficiency really matters. Hence, the main goal of this article is to explain how to design algorithms that are both generic and efficient. It also discusses specific recurring design issues for operations research software and proposes solutions that improve the genericity of the algorithms. Copyright © 2005 John Wiley & Sons, Ltd.  相似文献   

3.
The Standard Template Library(STL)is a C library that provides a set of well structured generic C components that work together.Based on its well-structured design,STL can be extended by adding new generic algorithms or new generic containers.In this paper,the work on extending STY by adding several efficient container classes for threaded binary search trees is discussed.It is shown that the addition of threads significantly increases the efficiency of some important access operations on the binary tree containers.In general,significant gain in efficiency can be expected in situations where the data structures ar relatively stable,that is,the data structures are looked up often but modified little.  相似文献   

4.
Over the years a wide variety of access control models and policies have been proposed, and almost all the models have assumed “grant the access request or deny it.” They do not provide any mechanism that enables us to bind authorization rules with required operations such as logging and encryption. We propose the notion of a “provisional action” that tells the user that his request will be authorized provided he (and/or the system) takes certain actions. The major advantage of our approach is that arbitrary actions such as cryptographic operations can all coexist in the access control policy rules. We define a fundamental authorization mechanism and then formalize a provision-based access control model. We also present algorithms and describe their algorithmic complexity. Finally, we illustrate how provisional access control policy rules can be specified effectively in practical usage scenarios. Published online: 22 January 2002  相似文献   

5.
In the traditional programming paradigm, data structures and algorithms are developed for specific data types and requirements. This leads to code redundancy and inflexibility, thus not allowing effective code reuse for similar applications. One effective approach to increase code reuse is generic programming, which focuses on the development of efficient, reusable software libraries through suitable abstractions for the common requirements. In this paper, we present how we applied generic programming to an ongoing effort for mesh-based adaptive simulations on massively parallel computers. Three generic components, iterator, set and tag, were developed using design pattern, C++ template programming and the standard template library. The scaling studies on petascale supercomputers demonstrate the efficiency of the reusable, generic components which do not sacrifice the performance of the previous tools developed in the traditional object-oriented programming paradigm.  相似文献   

6.
Various integer programming models have been proposed for sequencing problems. However, little is known about the practical value of these models. This paper reports a comparison of six different integer programming formulations of the single-machine total tardiness problem. We created a set of especially difficult test problems and attempted to solve them with each of the formulations, using CPLEX software. We found that one formulation performs much more effectively than the others. A generic integer programming approach is still not capable of solving problems with hundreds of jobs, so in that respect, it does not compete with state-of-the-art tardiness algorithms. However, the integer programming approach remains viable for problems containing as many as 40 or 50 jobs and may be the better algorithmic choice when convenience in implementation is considered.  相似文献   

7.
In this paper we present new implementations for morphological binary image processing on a general-purpose computer, using a bitmap representation of binary images instead of representing binary images as bitplanes inserted in gray value images. The bitmap data representation is a very efficient one, both in terms of memory requirements and in terms of algorithmic efficiency because of the CPU operates on 32 pixels in parallel. The algorithms described in this paper are capable of performing the basic morphological image transforms using structuring elements of arbitrary size and shape. In order to speed up morphological operations with respect to commonly used, large, convex structuring elements, the logarithmic decomposition of structuring elements is used. Experiments indicate that the new algorithms are more than 30 times faster for pixelwise operations and about an order of magnitude faster for the basic morphological transforms than the fastest known software implementations.  相似文献   

8.
A structural approach to modelling algorithms is proposed. The concept of an algorithmic structure with operations over algorithms is introduced. Models of algorithms constructed from algorithmic structures reflect aspects of algorithm representation and execution. Examples of structural and path models of algorithms are considered. Translated from Kibernetika i Sistemnyi Analiz, No. 3, pp. 3–14, May-June 2009.  相似文献   

9.
10.
Algorithmic skeletons simplify software development: they abstract typical patterns of parallelism and provide their efficient implementations, allowing the application developer to focus on the structure of algorithms, rather than on implementation details. This becomes especially important for modern parallel systems with multiple graphics processing units (GPUs) whose programming is complex and error-prone, because state-of-the-art programming approaches like CUDA and OpenCL lack high-level abstractions. We define a new algorithmic skeleton for allpairs computations which occur in real-world applications, ranging from bioinformatics to physics. We develop the skeleton’s generic parallel implementation for multi-GPU Systems in OpenCL. To enable the automatic use of the fast GPU memory, we identify and implement an optimized version of the allpairs skeleton with a customizing function that follows a certain memory access pattern. We use matrix multiplication as an application study for the allpairs skeleton and its two implementations and demonstrate that the skeleton greatly simplifies programming, saving up to 90 % of lines of code as compared to OpenCL. The performance of our optimized implementation is up to 6.8 times higher as compared with the generic implementation and is competitive to the performance of a manually written optimized OpenCL code.  相似文献   

11.
Generic programming is an especially attractive paradigm for developing libraries for high-performance computing because it simultaneously emphasizes generality and efficiency. In the generic programming approach, interfaces are based on sets of specified requirements on types, rather than on any particular types, allowing algorithms to inter-operate with any data types meeting the necessary requirements. These sets of requirements, known as concepts, can specify syntactic as well as semantic requirements. Besides providing a powerful means of describing interfaces to maximize software reuse, concepts provide a uniform mechanism for more closely coupling libraries with compilers and for effecting domain-specific library-based compiler extensions. To realize this goal however, programming languages and their associated tools must support concepts as first-class constructs. In this paper we advocate better syntactic and semantic support to make concepts first-class and present results demonstrating the kinds of improvements that are possible with static checking, compiler optimization, and algorithm correctness proofs for generic libraries based on concepts.  相似文献   

12.
Software pipelining is an efficient method of loop optimization that allows for parallelism of operations related to different loop iterations. Currently, most commercial compilers use loop pipelining methods based on modulo scheduling algorithms. This paper reviews these algorithms and considers algorithmic solutions designed for overcoming the negative effects of software pipelining of loops (a significant growth in code size and increase in the register pressure) as well as methods making it possible to use some hardware features of a target architecture. The paper considers global-scheduling mechanisms allowing one to pipeline loops containing a few basic blocks and loops in which the number of iterations is not known before the execution.  相似文献   

13.
基于角色访问控制模型的缓存机制研究   总被引:1,自引:0,他引:1  
陈阳  赵琛  窦燕  俞诗鹏  林作铨 《计算机工程》2006,32(12):142-144
在基于角色的访问控制(RBAC)模型的实现系统中,考虑到查询操作远多于修改操作,文章引入缓存机制,通过记录历史数据以提高后续查找的效率。讨论了4种缓存策略,给出了相应的缓存算法,并对算法的优劣进行了比较。在一个实际的访问控制系统WebDaemon中使用了缓存机制,证明查询效率得到了明显的提高。  相似文献   

14.
Programming languages have traditionally had more data types than database systems. The flexibility of abstract types could make a database system more useful in supporting application development. Abstract types allow users to think about and manipulate data in terms and structures that they are familiar with. This paper proposes that databases have a type system interface and describes a representation of a type system in terms of relations. The type system model supports a variety of programming language constructs, such as user-defined parameterized data types and user-defined generic operations. The efficiency of the type system is compared to the access time of the database system.  相似文献   

15.
用C语言编写DSP软件时,优化设计尤为重要。近年来提出了多种针对DSP代码生成阶段的偏移分配优化算法,这些算法通过调整局部变量在存储器中的布局来提高变量地址的计算效率。该文提出一种将微粒群算法与遗传算法相结合的算法(类PSO算法),对变量访问序列中各变量地址的分配进行优化,使计算地址所需的代码数量最小,从而减少程序的运行时间,提高DSP的工作效率。  相似文献   

16.
左正康  薛锦云 《软件学报》2015,26(6):1340-1355
泛型程序设计可大幅提高程序的可重用性、可靠性和开发效率.泛型约束机制是对泛型参数进行形式描述,并对其合法性进行检测及验证,从而保证泛型程序的可靠性和安全性.分析总结多种主流语言的泛型约束特性,存在难以描述及验证基于动态语义的复杂约束需求问题,与完整实现GP尚有距离;以抽象程序设计语言Apla为宿主语言,提出了基于代数结构及公理语义的泛型约束方法,给出了基本数据类型、自定义抽象数据类型和子程序的3类泛型约束机制,拓展了泛型程序设计约束的应用范围.同时,支持静态语法和动态语义层约束,提高了泛型约束的精确度;借助Isabelle定理证明器,设计了泛型约束匹配检测和验证算法;进一步设计了泛型约束机制在PAR平台的实现方案及其系统原型.实验部分给出了该泛型约束机制描述、检测及验证一系列复杂泛型约束问题的全过程,自动生成的C++模板程序的可靠性和安全性得到显著提高.  相似文献   

17.
PAR方法基于分划与递推、量词变换规则、循环不变式开发新策略和软件转换工具,实现了复杂算法问题的形式化开发.采用PAR方法形式化推导几个典型的算法问题.通过量词变换规则对程序规约进行形式化推导,可以得到具有数学引用透明性、易于形式化证明的求解算法问题的递推关系;并在此基础上,自然地导出循环不变式.在得到简短、易于理解、高可靠性的Apla算法程序之后,通过转换工具自动生成Java,C 等可执行程序.  相似文献   

18.
Although efficient identification of user access sessions from very large web logs is an unavoidable data preparation task for the success of higher level web log mining, little attention has been paid to algorithmic study of this problem. In this paper we consider two types of user access sessions, interval sessions and gap sessions. We design two efficient algorithms for finding respectively those two types of sessions with the help of some proposed structures. We present theoretical analysis of the algorithms and prove that both algorithms have optimal time complexity and certain error-tolerant properties as well. We conduct empirical performance analysis of the algorithms with web logs ranging from 100 megabytes to 500 megabytes. The empirical analysis shows that the algorithms just take several seconds more than the baseline time, i.e., the time needed for reading the web log once sequentially from disk to RAM, testing whether each user access record is valid or not, and writing each valid user access record back to disk. The empirical analysis also shows that our algorithms are substantially faster than the sorting based session finding algorithms. Finally, optimal algorithms for finding user access sessions from distributed web logs are also presented.  相似文献   

19.
Roll pass design is one of the most important tasks in shape rolling operations that are employed to provide raw materials with appropriate cross-section profiles for various industrial applications. Currently, many approaches, such as experience-based trial-and-error strategies, finite element methods, and expert systems, are applied to improve both quality and efficiency of roll pass design. However, due to lack of a flexible geometrical modelling strategy, the application of extant approaches is largely limited. This study attempts to develop a novel approach for generic geometrical modelling to support optimal design of roll passes. Features of the proposed model are analysed to support its application. Furthermore, a parameters estimation approach based on genetic algorithm is also developed to facilitate the transformation between the generic model and other geometrical models, as well as to improve its flexibility and applicability. The results from the case study presented in the paper indicate that the new model is more flexible and efficient, and that the parameters estimation approach also can achieve high transformation accuracy and efficiency.  相似文献   

20.
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号