Vector: Difference between revisions

Jump to navigation Jump to search
121 bytes added ,  14:59, 30 April 2020
m
Kinds of array category
Miraheze>Adám Brudzewsky
m (Text replacement - "{{APL programming language}}" to "{{APL features}}")
m (Kinds of array category)
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
:''This article is about one-dimensional arrays. For the periodical, see [[Vector journal]].
In the APL [[array model]], a '''vector''' is an array with [[rank]] 1. Its shape is thus a [[singleton]], whose only element is equal to the array's [[bound]]. Outside of APL, such one-dimensional data might also be called a "list" or "array".
In the APL [[array model]], a '''vector''' is an array with [[rank]] 1. Its shape is thus a [[singleton]], whose only element is equal to the array's [[bound]]. Outside of APL, such one-dimensional data might also be called a "list" or "array".


Line 8: 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