Content deleted Content added
AdaHephais (talk | contribs) Internal link Tags: Visual edit Mobile edit Mobile web edit |
Rmv duplicate wiki links WP:DUPLINK |
||
Line 7:
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 language|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.
[[Kenneth E. Iverson]] described the rationale behind array programming (actually referring to
{{quote|most programming languages are decidedly inferior to mathematical notation and are little used as tools of thought in ways that would be considered significant by, say, an applied mathematician.
The thesis is that the advantages of executability and universality found in programming languages can be effectively combined, in a single coherent language, with the advantages offered by mathematical notation. it is important to distinguish the difficulty of describing and of learning a piece of notation from the difficulty of mastering its implications. For example, learning the rules for computing a matrix product is easy, but a mastery of its implications (such as its associativity, its distributivity over addition, and its ability to represent linear functions and geometric operations) is a different and much more difficult matter.
Line 24:
==Languages==
The canonical examples of array programming languages are
===Scalar languages===
Line 34:
</syntaxhighlight>
In array-based languages, for example in
<syntaxhighlight lang="fortran">
a = a + b
Line 55:
====APL====
<syntaxhighlight lang="apl">
A ← A + B
Line 175:
====MATLAB====
The implementation in [[MATLAB]] allows the same economy allowed by using the
<syntaxhighlight lang="matlab">
A = A + B;
</syntaxhighlight>
A variant of the MATLAB language is the [[GNU Octave]] language, which extends the original language with
<syntaxhighlight lang="octave">
A += B;
Line 203:
====R====
The
<syntaxhighlight lang="r">
> A <- matrix(1:6, nrow=2) !!this has nrow=2 ... and A has 2 rows
|