FACTOID # 70: Contrary to the popular rhyme, the rain falls mainly on Guinea.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Array programming

Array programming languages (also known as vector or multidimensional languages) generalize operations on scalars to apply transparently to vectors, matrices, and higher dimensional arrays. In computing, a scalar is a variable or field that can hold only one value at a time; as opposed to composite variables like array, list, record, etc. ... In physics and in vector calculus, a spatial vector is a concept characterized by a magnitude, which is a scalar, and a direction (which can be defined in a 3-dimensional space by the Euler angles). ... In mathematics, a matrix (plural matrices) is a rectangular table of numbers or, more generally, a table consisting of abstract quantities that can be added and multiplied. ...


APL, designed by Ken Iverson, was the first programming language to provide array programming capabilities. APL (for A Programming Language) is an array programming language based on a notation invented in 1957 by Kenneth E. Iverson while at Harvard University. ... Kenneth Eugene Iverson (17 December 1920, Camrose, Alberta/Canada –October 19, 2004,Toronto, Ontario/Canada) was a computer scientist most notable for developing the APL programming language. ... A programming language is an artificial language that can be used to control the behavior of a machine (often a computer). ...


The fundamental idea behind array programming is that operations apply at once to an entire set of values. This makes it a high-level programming model as it allows the programmer to think and operate on whole aggregates of data, without having to resort to explicit loops of individual scalar operations.


Array programming primitives concisely express broad ideas about data manipulation. The level of conciseness can be dramatic in certain cases: it is not uncommon to find array programming language one-liners that require more than a couple of pages of Java code. A one-liner is a computer program or expression that takes no more than a single line. ...


Array programming is very well suited to implicit parallelization; a topic of much research nowadays.


Function rank is an important concept to array programming languages in general, by analogy to tensor rank in mathematics: functions that operate on data may be classified by the number of dimensions they act on. Ordinary multiplication, for example, is a scalar ranked function because it operates on zero-dimensional data (individual numbers). The cross product operation is an example of a vector rank function because it operates on vectors, not scalars. Matrix multiplication is an example of a 2-rank function, because it operates on 2-dimensional objects (matrices). Collapse operators reduce the dimensionality of an input data array by one or more dimensions. For example, summing over elements collapses the input array by 1 dimension. In mathematics, a tensor is (in an informal sense) a generalized linear quantity or geometrical entity that can be expressed as a multi-dimensional array relative to a choice of basis; however, as an object in and of itself, a tensor is independent of any chosen frame of reference. ... In mathematics, the cross product is a binary operation on vectors in a three-dimensional Euclidean space. ... This article gives an overview of the various ways to multiply matrices. ...

Contents


Overview

In scalar languages like FORTRAN 77, C, Pascal, Ada, etc. operations apply only to single values, so a+b expresses the addition of two numbers. In such languages adding two arrays requires indexing and looping:


FORTRAN 77

 DO 10 I = 1, N DO 10 J = 1, N 10 A(I,J) = A(I,J) + B(I,J) 


C

 for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { a[i][j] = a[i][j] + b[i][j]; } } 

PASCAL

 for i:=1 to n do for j:=1 to n do a[i,j] := a[i,j] + b[i,j]; 

This need to loop and index to perform operations on arrays is both tedious and error prone.


In array languages, operations are generalized to apply to both scalars and arrays. Thus, a+b expresses the sum of two scalars if a and b are scalars, or the sum of two arrays if they are arrays. When applied to arrays, the operations act on corresponding elements as illustrated in the loops above. Indeed, when the array language compiler/interpreter encounters a statement like:

 A := A + B 

where A and B are two-dimensional arrays, it generates code that is effectively the same as the C loops shown above. An array language, therefore, simplifies programming.


Example languages

The canonical examples of array programming languages are APL, its successor J, and Fortran 90. Others include: A+, Analytica, IDL, K, Mathematica, MATLAB, PDL, SAC and ZPL. APL (for A Programming Language, or sometimes Array Processing Language) is an array programming language invented in 1962 by Kenneth E. Iverson while at Harvard University. ... The J programming language, developed in the early 1990s by Ken Iverson and Roger Hui, is a synthesis of APL (also by Iverson) and the FP and FL functional programming languages created by John Backus (of FORTRAN, ALGOL, and BNF fame). ... FORTRAN[1] is a general-purpose[2], procedural[3], imperative programming language that is especially suited to numeric computation and scientific computing. ... A+ is a powerful and efficient array programming language written at Morgan Stanley. ... Prior Analytics is Aristotles work on deductive reasoning, part of his Organon, the instrument or manual of logical and scientific methods. ... IDL, short for interactive data language, is a programming language which is a popular data analysis language among scientists. ... K is a high level array programming language developed by Arthur Whitney, a very influential member of the APL community. ... This article is about computer software. ... MATLAB is a numerical computing environment and programming language. ... PDL (short for Perl Data Language) is a set of Array programming extensions to the Perl programming language. ... SAC (for Single Assignment C) is a strict purely functional programming language whose design is focussed on the needs of numerical applications. ... ZPL (short for Z-level Programming Language) is an array programming language designed to replace C and C++ programming languages in engineering and scientific applications. ...


Category:Array programming languages provides an exhaustive list.


See also

Scalar programming is a term used to refer to those programming approaches that do not follow the Array programming paradigm. ... A programming paradigm is a paradigmatic style of programming (compare with a methodology, which is a paradigmatic style of doing software engineering). ...

External links

  • "No stinking loops" programming
  • Discovering Array Languages


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.