Axis Operator


A number of primitive functions and operators can be applied to a particular axis (or dimension) of an array. The [ ] brackets are used to indicate the axis being specified.

The highest dimension of a data item is considered to be the first dimension and the lowest dimension the last . Thus the first dimension of a matrix is the rows and the last dimension is the columns. In the case of a three-dimensional object, the first dimension is the planes followed by the rows and columns.

Axis numbers are governed by the Index Origin, ŒIO, and in Index Origin 1, (the default), the first dimension is represented by [1], the second by [2] and so on. In Index Origin 0 the first dimension would be [0], the second [1] and so on. The number used to represent the axis is always a whole number, except for the ravel and laminate functions.

The primitive functions and operators which will accept an axis operator include the dyadic forms of the primitive scalar functions :

     + - × ÷ | — ˜ * µ ± ! ^ Ÿ Š ‹ < ˆ = ‰ > ¬

and some primitive mixed functions :

     , ®       Ravel/Catenate/Laminate       (note first axis variant)
     ² ´       Reverse/Rotate                (note first axis variant)
     ›         Enclose/Partition
     œ         Disclose
     †         Take
     ‡         Drop
     Þ         Index

as well as the operators:

     / š       Compress/Replicate            (note first axis variant)
     / š       Reduce                        (note first axis variant)
     \ ™       Scan                          (note first axis variant)
     \ ™       Expand                        (note first axis variant)

See the reference section entry for Axis ([]) for more details, as well as the reference entries for individual mixed functions and operators listed above.


Topic: APLX Help : Help on APL language : APL Fundamentals : Axis operator
[ Previous | Next | Contents | Index ]