Shape: Difference between revisions

Jump to navigation Jump to search
6 bytes added ,  10:55, 18 October 2019
m
no edit summary
Miraheze>Marshall
No edit summary
Miraheze>Marshall
mNo edit summary
Line 1: Line 1:
The shape of an array is a [[vector]] of lengths of the array along each [[axis]]. The Shape function <code class="apl">⍴</code> is a [[monadic function]] which returns the shape of its argument array. The [[dyadic function]] [[Reshape]] (<code class="apl">⍴</code>) produces an array of the shape specified by its left argument.
The shape of an array is a [[vector]] of lengths of the array along each [[axis]]. The Shape function <code class="apl">⍴</code> is a [[monadic function]] which returns the shape of its argument array. The [[dyadic function]] [[Reshape]] (<code class="apl">⍴</code>) produces an array of the shape specified by its left argument.


An array's shape may be any vector of nonnegative integers with length less than or equal to the [[maximum rank]]. The length of an array's shape is the array's [[rank]], and the product of the shape is its [[bound]]. If the shape is [[Empty array]] then the array is a [[scalar]].
An array's shape may be any vector of nonnegative integers with length less than or equal to the [[maximum rank]]. The length of an array's shape is the array's [[rank]], and the product of the shape is its [[bound]]. If the shape is [[Empty array|empty]] then the array is a [[scalar]].


An array's shape, along with the [[index origin]], determine the possible values which can be used as an [[index]] into the array. A complete index is a vector of integers with the same length as the shape. When the index origin is subtracted from the index each element must be at least 0 and less than the corresponding element of the shape. In languages with [[negative indexing]] it may be greater than or equal to the negative of the shape rather than 0.
An array's shape, along with the [[index origin]], determine the possible values which can be used as an [[index]] into the array. A complete index is a vector of integers with the same length as the shape. When the index origin is subtracted from the index each element must be at least 0 and less than the corresponding element of the shape. In languages with [[negative indexing]] it may be greater than or equal to the negative of the shape rather than 0.
Anonymous user

Navigation menu