APA

From NARS2000
Revision as of 20:19, 7 May 2008 by Sudleyplace (talk | contribs) (New page: <p>So as to more efficiently represent this commonly occurring array, a new datatype — '''Arithmetic Progression Arrays''' ('''APAs''') — are created by the Index Generator...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

So as to more efficiently represent this commonly occurring array, a new datatype — Arithmetic Progression Arrays (APAs) — are created by the Index Generator function and may be reshaped arbitrarily (as long as no replication occurs) and still retain the datatype.

For example, 2 3 4⍴⍳24 has a very compact storage consisting of the array shape (2 3 4), the starting offset (⎕IO) and multiplier (1), plus the normal array overhead (which includes the number of elements (24)), for a total of 96 bytes. This datatype is also used to store reshaped Boolean or integer scalars, as in 1e6⍴12 which uses 80 bytes (16 bytes less than the preceding example because it has two fewer shape elements at eight bytes per).