首页 | 官方网站   微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 140 毫秒
1.
吕聆春 《福建电脑》2009,25(6):210-210
C语言中的指针和数组既是难点又是重点,本文以指针的运用与数组的关系为线索,结合具体例题帮助初学者理解指针及复杂指针的相关概念。  相似文献   

2.
数组和指针是C语言学习的重点与难点,就数组与指针的密切关系,分别对指针、数组元素的引用、数组指针和指针数组等知识点进行归纳总结,探讨了不同类型指针在数组中的使用方法,并通过实例进行说明.  相似文献   

3.
使用好C或C++编程的关键在于深入理解和正确使用指针。C或C++的很多特性得依赖于指针才能实现,但指针又是极具危险性的。在编写程序,尤其是多媒体应用程序的开发,因涉及大量的数据处理,一般要用到指针数组和二级指针。如:要对一批原始数据块进行某种规则的划分得到一个指针数组,然后  相似文献   

4.
韩雨涝 《福建电脑》2009,25(7):62-62
在C语言中指针和数组的关系密不可分,本文通过探讨指针与数组关联的方法,论述了C语言程序设计中指针与数组的几种常见关系,最后给出了一个通过指针访问数组的实例,很好的体现了指针与数组的关系。  相似文献   

5.
C++数组与指针深入剖析   总被引:5,自引:0,他引:5  
分析编译系统对数组和指针的处理,用系统为它们分配的内存图来剖析数组与指针,并举例说明如何正确使用数组与指针。  相似文献   

6.
针对C程序设计中指针与数组的教学难点,以二维数组为例,从其逻辑上不同的数据结构出发,分析推理导出通过指针引用数组元素的表示式,揭示并阐明了表达式之间的内在联系及其区别,从而较系统地阐述了指针与数组的关系.  相似文献   

7.
卓明敏 《福建电脑》2008,24(7):213-214
在C语言中引入指针常量的概念,将指针常量与指针变量统称为指针。字符串常量和字符串变量都是指针常量。在C语言教学中引入破损数组的概念,区别字符型破损数组与字符型二维数组。这样,指针的概念变得异常清晰。  相似文献   

8.
丁锐  赵荣彩  韩林 《计算机科学》2012,39(3):290-294
计算和数据自动划分是并行化编译中一种自动分配计算和数据到各个处理机的优化技术,划分的结果直接影响程序并行的性能。数组是划分处理的主要对象之一,一些数组分布后的收益不高,但带来的并行约束却能对其它数组的划分产生干扰,导致大量数据重分布通信的产生。现有的划分算法中没有约定数组分布的优先次序,因此无法限制这些数组并行约束的传播,降低了优化编译器后端自动生成并行代码的性能。提出了一种基于主导值的计算和数据自动划分算法:将划分过程中数组对程序并行性的影响量化为主导值,并依据主导值的大小约定数组分布的优先次序,限制干扰数组并行约束的传播速度,提高划分结果的合理性。实验结果表明,算法能够获得良好的划分效果。  相似文献   

9.
关于指针数组的一个应用实例—用VC实现矩阵的运算   总被引:1,自引:0,他引:1  
论述了指针数组与数组指针的区别,并以一个实例说明指针数组的应用。  相似文献   

10.
《软件》2019,(6):197-199
随着互联网技术的飞速发展,计算机教学对基础课程的要求越来越高。本文以《C语言程序设计》中指针教学为对象,通过探讨概念、种类和用法,详细讲解了二维数组、行指针、二级指针、指针数组之间的区别和关系。实践证明,对于指针重点难点的分析,有利于学生C语言知识体系的建立。  相似文献   

11.
丁强  臧斌宇  朱传琪 《计算机工程与设计》2005,26(5):1135-1139,1143
数据划分是分布主存系统中并行编译的关键技术,它以教组和包含这些教组的嵌套循环为研究对象,以提高教据局部性和挖掘计算并行性为根本目的。对满足给定模式的动态分布的教组向量,通过选取代表元,给出数据划分模式。将单个嵌套循环内的数据划分技术和过程间投影技术很好地结合,解决了动态分布教组的数据划分问题。这种模式弥补了现有数据划分研究的不足。  相似文献   

12.
划分是把程序中不同的计算和数据分配到并行处理系统的不同处理机来充分利用并行系统的计算资源、提高程序处理速度的一种优化技术.划分的效果对程序在并行系统上的执行效率将产生至关重要的影响,因此划分问题一直是并行领域研究的一个热点.但是应用程序的一些特性,如非紧密嵌套循环、一条语句对非只读数组的多次引用间存在重叠、不同语句对同一数组不同步长的引用,给有效解决划分问题设置了极大的障碍.已有的划分算法无法对具有这些特征的程序进行自动划分.虽然在对具有这些特征的程序进行手工优化过程中,存在一些直观上的划分策略,但这些策略无法应用到编译器中来指导编译器完成对程序的自动划分.文中根据这类程序的特点,提出了一种基于代表元的划分算法.该算法通过使用程序中对划分计算产生实际影响的数组引用作为代表元素构造各种划分的限制条件,完成程序的划分.同时通过寻找最大一致性数据划分方向有效减少了程序划分过程中的数据重组织通信.该算法已经在AFT2004中实现,并对应用程序获得了很好的效果.  相似文献   

13.
处理器阵列的容错重构技术是片上网络多核、众核高性能体系结构的可靠性技术之一。现有的最大逻辑阵列并行重构技术仅对单条逻辑列的构造实现了并行化,而对多条逻辑列的同步并行仍未见可行算法。依据处理器阵列的潜在并行性,在分治策略的基础上,提出了一种阵列分块的并行重构算法。算法对处理器阵列实施横向分块划分,对每个阵列块进行并行重构,并对所得逻辑子阵列进行归并,实现了多条逻辑列的同步并行重构。与现有的并行算法相比,新算法同样能够生成最大逻辑列,并且减少了通信开销与计算中的数据冗余,有效提高了运行速度。实验结果表明,在物理阵列大小为64×64的处理器阵列上,运行速度比现有并行算法提高39.55%,并且具有良好的可扩展性。  相似文献   

14.
In distributed memory multicomputers, local memory accesses are much faster than those involving interprocessor communication. For the sake of reducing or even eliminating the interprocessor communication, the array elements in programs must be carefully distributed to local memory of processors for parallel execution. We devote our efforts to the techniques of allocating array elements of nested loops onto multicomputers in a communication-free fashion for parallelizing compilers. We first analyze the pattern of references among all arrays referenced by a nested loop, and then partition the iteration space into blocks without interblock communication. The arrays can be partitioned under the communication-free criteria with nonduplicate or duplicate data. Finally, a heuristic method for mapping the partitioned array elements and iterations onto the fixed-size multicomputers under the consideration of load balancing is proposed. Based on these methods, the nested loops can execute without any communication overhead on the distributed memory multicomputers. Moreover, the performance of the strategies with nonduplicate and duplicate data for matrix multiplication is studied  相似文献   

15.
基于Hadoop的FP-Growth关联规则并行改进算法   总被引:1,自引:0,他引:1  
大数据环境下,传统的串行FP-Growth算法在处理海量数据时,占用内存过大、频繁项多,适用于大数据情况的PFP(Parallel FP-Growth)算法存在数据量增大无法处理的缺陷。针对这些问题,本文提出了基于Hadoop的负载均衡数据分割FP-Growth并行算法。在Hadoop平台下,本文使用负载均衡和数据分割相结合的方式对原始事务数据集分片实现并行化。实验证明基于Hadoop的负载均衡数据分割FP-Growth并行算法在处理数据量和效率上有所提高。  相似文献   

16.
The performance of striped disk arrays is governed by two parameters: the stripe unit size and the degree of striping. In this paper, we describe techniques for determining the stripe unit size and degree of striping for disk arrays storing variable bit rate continuous media data. We present an analytical model to determine the optimal stripe unit size in redundant and non-redundant disk arrays. We then use the model to study the effect of various system parameters on the optimal stripe unit size. To determine the degree of striping, we first demonstrate that striping a continuous media stream across all disks in the array causes the number of clients supported to increase sub-linearly with increase in the number of disks. To overcome this limitation, we propose a technique that partitions a disk array and stripes each media stream across a single partition. We then propose an analytical model to determine the optimal partition size and maximize the number of clients supported by the array.  相似文献   

17.
Partitioning and mapping of nested loops for linear array multicomputers   总被引:1,自引:1,他引:0  
In distributed-memory multicomputers, minimizing interprocessor communication is the key to the efficient execution of parallel programs. In order to reduce the amount of communication overhead, parallel programs on multicomputers must be carefully scheduled by parallelizing compilers. This paper proposes some compilation techniques for partitioning and mapping nested loops with constant data dependences onto linear array multicomputers. First, a systematic partition strategy is proposed to project ann-dimensional computational structure, representing ann-nested loop, onto a line to form a one-dimensional projected structure with low communication overhead. Then, a mapping algorithm is proposed for mapping the partitioned loops onto linear arrays in a way that balances the workload and minimizes the communication cost among processors. Finally, parallel execution codes can be automatically generated for such linear array multicomputers.  相似文献   

18.
Fortran 90 provides a rich set of array intrinsic functions. Each of these array intrinsic functions operates on the elements of multi-dimensional array objects concurrently. They provide a rich source of parallelism and play an increasingly important role in automatic support of data parallel programming. However, there is no such support if these intrinsic functions are applied to sparse data sets. In this paper, we address this open gap by presenting an efficient library for parallel sparse computations with Fortran 90 array intrinsic operations. Our method provides both compression schemes and distribution schemes on distributed memory environments applicable to higher-dimensional sparse arrays. This way, programmers need not worry about low-level system details when developing sparse applications. Sparse programs can be expressed concisely using array expressions, and parallelized with the help of our library. Our sparse libraries are built for array intrinsics of Fortran 90, and they include an extensive set of array operations such as CSHIFT, EOSHIFT, MATMUL, MERGE, PACK, SUM, RESHAPE, SPREAD, TRANSPOSE, UNPACK, and section moves. Our work, to our best knowledge, is the first work to give sparse and parallel sparse supports for array intrinsics of Fortran 90. In addition, we provide a complete complexity analysis for our sparse implementation. The complexity of our algorithms is in proportion to the number of nonzero elements in the arrays, and that is consistent with the conventional design criteria for sparse algorithms and data structures. Our current testbed is an IBM SP2 workstation cluster. Preliminary experimental results with numerical routines, numerical applications, and data-intensive applications related to OLAP (on-line analytical processing) show that our approach is promising in speeding up sparse matrix computations on both sequential and distributed memory environments if the programs are expressed with Fortran 90 array expressions.  相似文献   

19.
New compact, low-power implementation technologies for processors and imaging arrays can enable a new generation of portable video products. However, software compatibility with large bodies of existing applications written in C prevents more efficient, higher performance data parallel architectures from being used in these embedded products. If this software could be automatically retargeted explicitly for data parallel execution, product designers could incorporate these architectures into embedded products. The key challenge is exposing the parallelism that is inherent in these applications but that is obscured by artifacts imposed by sequential programming languages. This paper presents a recognition-based approach for automatically extracting a data parallel program model from sequential image processing code and retargeting it to data parallel execution mechanisms. The explicitly parallel model presented, called multidimensional data flow (MDDF), captures a model of how operations on data regions (e.g., rows, columns, and tiled blocks) are composed and interact. To extract an MDDF model, a partial recognition technique is used that focuses on identifying array access patterns in loops, transforming only those program elements that hinder parallelization, while leaving the core algorithmic computations intact. The paper presents results of retargeting a set of production programs to a representative data parallel processor array to demonstrate the capacity to extract parallelism using this technique. The retargeted applications yield a potential execution throughput limited only by the number of processing elements, exceeding thousands of instructions per cycle in massively parallel implementations.  相似文献   

20.
This research is concerned with the dynamic modeling of satellite with deployable solar arrays equipped with strain energy hinges (SEH). The SEH is a new deployment device consisting of a strip tape measure, which utilizes the buckling behavior of a thin curved shell to produce nonlinear dynamic characteristics during deployment of solar arrays. For dynamic simulation, the SEH is assumed to be a massless-nonlinear elastic member and the solar panels are assumed to be rigid bodies which are connected by the SEHs. The planar deployment is of interest in this study since the deployment of solar arrays mainly occurs in a two-dimensional plane. In deriving the equations of motion, we developed a new systematic approach suitable for the simulation of solar array deployment in space. The simulation results were compared to the ground experimental results obtained at the laboratory of Korea Aerospace Research Institute. In the ground experiments, the hub of the solar arrays was attached to the frictionless rotational bearing, and the solar arrays were hanged by bungee cables. Even though the dynamic model was derived for the space deployment of the solar arrays, the simulation result corresponding to the solar array deployment was similar to the ground experimental results thus validating the simulation model developed in this paper.  相似文献   

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

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

京公网安备 11010802026262号