Array model: Difference between revisions

Jump to navigation Jump to search
489 bytes added ,  13:41, 18 October 2019
Miraheze>Marshall
Miraheze>Marshall
Line 67: Line 67:


== Array characteristics ==
== Array characteristics ==
APL defines the following characteristics of an array. All information about an array is contained in two [[Vector|vectors]]: its [[shape]] and [[ravel]], including, for empty arrays, the ravel's [[prototype]].
* The [[rank]] is the number of dimensions or [[axes]] it has. It is the length of the shape.
* The [[shape]] gives its length along each dimension.
* The [[bound]] is the total number of elements in an array, that is, the product of the shape.
* The [[ravel]] is a [[vector]] containing all of the array's [[Element|elements]]. It's length is the bound.
* The [[Array prototype|prototype]] is a special "null" element for the array. It is derived from the first element for non-empty arrays.
* The [[depth]] is a number indicating how deeply nested an array is.


=== Depth ===
=== Depth ===
Line 82: Line 90:


APLs vary in their definition of depth: for example some may return the depth with a sign to indicate that some level of the array mixes elements of different depths.
APLs vary in their definition of depth: for example some may return the depth with a sign to indicate that some level of the array mixes elements of different depths.
=== Rank ===
{{Main|Rank}}
The concept of rank is very important in APL, and isn't present in many other languages. It refers to the number of dimensions in the array. So far, rank-0 arrays are scalars, rank-1 arrays are vectors, rank-2 arrays are usually called matrices or tables.


== External links ==
== External links ==
Anonymous user

Navigation menu