Frame and cell
So far nouns have been considered in their entirety. However, it is useful to think of an array as consisting of cells, parts of the array (subarrays) that when placed in a frame, make up the entire array.
a =. 2 3 $ 'abcdef' a abc def
The array a can be thought of as having 6 cells, where each cell is an atom. The frame would be the shape 2 3 that structures the 6 individual cells into the array a. Visually (cell is atom and frame of 2 3):
a cell 0 b cell 1 ... f cell 5
The array a can also be thought of as having 2 cells, where each cell is a list. The frame would be the shape 2 that structures the cells into the array a. Visually (cell is list and frame of 2):
abc cell 0 def cell 1
Finally, the array a can be thought of as having 1 cell, where the cell is a table. The frame would be the shape empty that structures the cells into the array a. Visually (cell is table and frame is empty) :
abc cell 0 def
A table with shape 2 3 can be thought of as:
- a 2 3 frame of cells that are atoms
- a 2 frame of cells that are lists of shape 3
- an empty frame of a cell that is a table of shape 2 3
Similarly, an array with shape 4 3 2 can be thought of as:
- a 4 3 2 frame of cells that are atoms
- a 4 3 frame of cells that are lists of shape 2
- a 4 frame of cells that are tables of shape 3 2
- an empty frame of a cell that is a rank 3 array of shape 4 3 2
The frame is a prefix of the shape of the array. It can be the entire shape (a prefix of all), in which case the cells are atoms. It can be empty (a prefix of none) in which case there is a single cell which is the array. Or anything in between.
The cell shape is the array shape with the frame prefix removed. The length of the cell shape is the cell rank.
The cells of an array are the subarrays that, when assembled into the corresponding frame, create the entire array.
|Primer Index Hover to reveal titles - Click to access -|