Rank (operator): Difference between revisions

Jump to navigation Jump to search
42 bytes added ,  13:47, 8 August 2021
m
Citation formatting
(Revert changes based on APL Campfire, as it's less reliable than HOPL)
m (Citation formatting)
Line 61: Line 61:


== History ==
== History ==
The rank operator was invented by Arthur Whitney in 1982 and first implemented in [[SHARP APL]] in 1983. It has been described as "a microcosm of APL history"<ref name="hopl4">[https://dl.acm.org/doi/pdf/10.1145/3386319 Hui, R.K. and Kromberg, M.J., 2020. APL Since 1978. Proceedings of the ACM on Programming Languages.]</ref>, its evolution a progression from [[scalar extension]], which has been in APL since its inception, through [[leading axis theory]] to a construct which is a generalisation of scalar extension, [[inner product|inner (matrix) product]], [[outer product]], maplist in LISP, map in modern functional programming languages and the broadcast facility in NumPy.
The rank operator was invented by Arthur Whitney in 1982 and first implemented in [[SHARP APL]] in 1983. It has been described as "a microcosm of APL history"<ref name="hopl4">[[Roger Hui]] and [[Morten Kromberg]]. [https://dl.acm.org/doi/abs/10.1145/3386319 ''APL since 1978'']. ACM [[HOPL]] IV. 2020-06.</ref>, its evolution a progression from [[scalar extension]], which has been in APL since its inception, through [[leading axis theory]] to a construct which is a generalisation of scalar extension, [[inner product|inner (matrix) product]], [[outer product]], maplist in LISP, map in modern functional programming languages and the broadcast facility in NumPy.


== Rank vs Axis ==
== Rank vs Axis ==
Due to its ability to apply functions to specified subarrays, rank is frequently contrasted with [https://aplwiki.com/wiki/Function_axis bracket-axis]. It provides nearly all of the functionality of the anomalous axis operator (<source lang=apl inline>f[a]</source>) without its draw-backs.<ref name="intro2rank">Bernecky, R., 1987. An introduction to function rank. ACM SIGAPL APL Quote Quad, 18(2), pp.39-43.</ref>
Due to its ability to apply functions to specified subarrays, rank is frequently contrasted with [https://aplwiki.com/wiki/Function_axis bracket-axis]. It provides nearly all of the functionality of the anomalous axis operator (<source lang=apl inline>f[a]</source>) without its draw-backs.<ref name="intro2rank">[[Robert Bernecky]]. [https://doi.org/10.1145/55626.55632 An introduction to function rank] at [[APL88]]. ACM SIGAPL APL Quote Quad, 18(2), pp.39-43. 1987.</ref>


One of these draw-backs is that bracket-axis is specified ad hoc for each of the specific primitives on which it applies. Rank benefits from consistent behaviour when applied to any function, including [[user-defined functions]]. The ad hoc nature of bracket-axis definitions means that a generalised axis operator which works on any function, but behaves just as bracket-axis on those particular primitives, is impossible to formulate.
One of these draw-backs is that bracket-axis is specified ad hoc for each of the specific primitives on which it applies. Rank benefits from consistent behaviour when applied to any function, including [[user-defined functions]]. The ad hoc nature of bracket-axis definitions means that a generalised axis operator which works on any function, but behaves just as bracket-axis on those particular primitives, is impossible to formulate.

Navigation menu