Cell: Difference between revisions

Jump to navigation Jump to search
1,358 bytes added ,  13:07, 11 November 2019
no edit summary
Miraheze>Marshall
No edit summary
Miraheze>Marshall
No edit summary
Line 1: Line 1:
<div class="LeadingAndTrailingCells"></div>
In the APL [[array model]] and in particular [[leading axis theory]], a '''cell''' of an array is a [[subarray]] which is formed by selecting a single [[Index#Index along an axis|index]] along some number of leading [[Axis|axes]] and the whole of each trailing axis. Cells are classified by their [[rank]], which may be between 0 ([[scalar]]s) and the array's rank (in which case the cell must be the entire array). Cells with rank <source lang=apl inline>k</source> are called '''k-cells''' of an array. A [[major cell]] is a cell whose rank is one less than the entire array, or a 0-cell of a [[scalar]].
 
== Leading and trailing axes ==
 
<div class="LeadingAndTrailingCells" style="float:right; background:white; border:1px solid #888; padding:1em; margin:1em;"></div>
 
<div>
The k-cells of an array with [[rank]] <source lang=apl inline>r</source> share the last <source lang=apl inline>k</source> [[Axis|axes]] with that array, and collapse the first <source lang=apl inline>r-k</source> axes by choosing a single [[Index#Index along an axis|index]] along each of them. Using [[bracket indexing]] this can be written
<source lang=apl>
A[3;2; ; ; ]    ⍝ 3-cell of a rank-5 array
</source>
while [[Squad indexing]] allows a cell to be selected without knowing the argument's rank.
<source lang=apl>
3 2⌷A          ⍝ (r-2)-cell of a rank-r array
</source>
</div>
 
{{APL programming language}}
Anonymous user

Navigation menu