Vector: Difference between revisions

Jump to navigation Jump to search
12 bytes removed ,  23:37, 16 November 2019
m
Text replacement - "{{APL programming language}}" to "{{APL features}}"
Miraheze>Marshall
mNo edit summary
Miraheze>Adám Brudzewsky
m (Text replacement - "{{APL programming language}}" to "{{APL features}}")
Line 8: Line 8:


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 programming language}}
{{APL features}}

Navigation menu