Book contents
- Frontmatter
- Contents
- List of Figures
- Preface
- 1 The Key Idea
- 2 Approaches to Parallel Software Development
- 3 Architectural Background
- 4 Models and Their Properties
- 5 The Categorical Data Type of Lists
- 6 Software Development Using Lists
- 7 Other Operations on Lists
- 8 A Cost Calculus for Lists
- 9 Building Categorical Data Types
- 10 Lists, Bags, and Finite Sets
- 11 Trees
- 12 Arrays
- 13 Graphs
- 14 Conclusions
- A C++ Library for Lists
- B Historical Background
- References
- Index
12 - Arrays
Published online by Cambridge University Press: 25 October 2009
- Frontmatter
- Contents
- List of Figures
- Preface
- 1 The Key Idea
- 2 Approaches to Parallel Software Development
- 3 Architectural Background
- 4 Models and Their Properties
- 5 The Categorical Data Type of Lists
- 6 Software Development Using Lists
- 7 Other Operations on Lists
- 8 A Cost Calculus for Lists
- 9 Building Categorical Data Types
- 10 Lists, Bags, and Finite Sets
- 11 Trees
- 12 Arrays
- 13 Graphs
- 14 Conclusions
- A C++ Library for Lists
- B Historical Background
- References
- Index
Summary
In this chapter we build a much more complex type, the type of arrays. The construction of arrays as a categorical data type is significantly different and more complex than the constructions seen so far, so this chapter illustrates new aspects of the construction technique.
Arrays are an important type because of the ubiquitous use of Cartesian coordinate systems and the huge edifice of linear algebra built on top of them. Almost all scientific and numeric computations require arrays as central data structures.
While the need for a data type of arrays is undisputed, there has always been some disagreement about exactly what arrays should represent: should the entries of an array all be of the same type (homogeneous) or might they be different (inhomogeneous); should extents be the same in each dimension (rectangular) or might they differ (ragged); are arrays of different sizes members of the same type or of different types. Different programming languages have answered these questions differently.
Arrays appeared early in languages such as Fortran, which had homogeneous, rectangular arrays but was ambivalent about how they should be typed. Arrays had to be declared with their shapes, and shapes of arguments and parameters had to agree (although some of these rules were relaxed later). Fortran even went so far as to reveal the storage allocation of arrays (by columns) at the language level.
- Type
- Chapter
- Information
- Foundations of Parallel Programming , pp. 151 - 162Publisher: Cambridge University PressPrint publication year: 1994