Vector: Difference between revisions

Jump to navigation Jump to search
27 bytes added ,  14:59, 30 April 2020
m
Kinds of array category
No edit summary
m (Kinds of array category)
Line 10: Line 10:


Many APL functions, such as [[Reverse]], are most naturally defined on vectors. They may be extended to general arrays by applying along a specific axis (see [[function axis]]) or, in [[leading axis theory]], by treating an array as a vector of its [[major cell]]s (an array can be converted to such a vector using <source lang=apl inline>⊂⍤¯1</source>). For many operations, such as [[scalar function]] [[reduction]]s and most [[structural function]]s, these extensions are equivalent. Reversing along the first axis of an array by reversing each vector [[subarray]] along that axis is identical to reversing the array's major cells. For more complicated operations like general reductions they are different: a reduction along the first axis (<source lang=apl inline>⌿</source> in most APLs) passes individual array elements to its operand while reducing the major cells (<source lang=j inline>/</source> in [[J]]) passes entire cells, and performs fewer function calls.
Many APL functions, such as [[Reverse]], are most naturally defined on vectors. They may be extended to general arrays by applying along a specific axis (see [[function axis]]) or, in [[leading axis theory]], by treating an array as a vector of its [[major cell]]s (an array can be converted to such a vector using <source lang=apl inline>⊂⍤¯1</source>). For many operations, such as [[scalar function]] [[reduction]]s and most [[structural function]]s, these extensions are equivalent. Reversing along the first axis of an array by reversing each vector [[subarray]] along that axis is identical to reversing the array's major cells. For more complicated operations like general reductions they are different: a reduction along the first axis (<source lang=apl inline>⌿</source> in most APLs) passes individual array elements to its operand while reducing the major cells (<source lang=j inline>/</source> in [[J]]) passes entire cells, and performs fewer function calls.
{{APL features}}
{{APL features}}[[Category:Kinds of array]]

Navigation menu