Total array ordering: Difference between revisions

Jump to navigation Jump to search
reorder paragraphs to improve flow to next section
No edit summary
(reorder paragraphs to improve flow to next section)
Line 1: Line 1:
In APL, a '''total array ordering''', or '''TAO''', is an [[ordering]] on all arrays which is used primarily by [[Grade]] and [[Interval Index]], but optionally also by the [[comparison function]]s. Traditionally ordering is defined only for [[simple]] arrays of the same [[shape]] and [[type]], so ''TAO'' refers to the extension to [[Nested array|nested]] or [[box]]ed arrays of arbitrary [[rank]], shape, and type.
In APL, a '''total array ordering''', or '''TAO''', is an [[ordering]] on all arrays which is used primarily by [[Grade]] and [[Interval Index]], but optionally also by the [[comparison function]]s. Traditionally ordering is defined only for [[simple]] arrays of the same [[shape]] and [[type]], so ''TAO'' refers to the extension to [[Nested array|nested]] or [[box]]ed arrays of arbitrary [[rank]], shape, and type.
The name ''total array ordering'' is taken partly from the mathematical concept of a [[wikipedia:total order|total order]], which must order any two elements, with elements ordering equally only if they are identical. This concept is transferred to APL by specifying that arrays should only order equally if they [[match]].


[[J]] has had such an ordering since 1996 (release 3.01). [[Dyalog APL]] added a total array ordering with [[Dyalog APL 17.0|version 17.0]]. Both of these are based on a [[wikipedia:lexicographic order|lexicographic order]]ing.<ref>[[Roger Hui|Hui, R.]]. [https://code.jsoftware.com/wiki/Essays/The_TAO_of_J The TAO of J].</ref><ref>Hui, R. and [[M. Kromberg|Morten Kromberg]]. [https://dl.acm.org/doi/abs/10.1145/3386319 ''APL since 1978'']. ACM HOPL IV. 2020-06.</ref> [[GNU APL]] and [[NARS2000]] also implement total ordering, but based on [[wikipedia:shortlex order|shortlex order]]ing instead, comparing first [[rank]], then [[shape]], then [[type]], and finally value.
[[J]] has had such an ordering since 1996 (release 3.01). [[Dyalog APL]] added a total array ordering with [[Dyalog APL 17.0|version 17.0]]. Both of these are based on a [[wikipedia:lexicographic order|lexicographic order]]ing.<ref>[[Roger Hui|Hui, R.]]. [https://code.jsoftware.com/wiki/Essays/The_TAO_of_J The TAO of J].</ref><ref>Hui, R. and [[M. Kromberg|Morten Kromberg]]. [https://dl.acm.org/doi/abs/10.1145/3386319 ''APL since 1978'']. ACM HOPL IV. 2020-06.</ref> [[GNU APL]] and [[NARS2000]] also implement total ordering, but based on [[wikipedia:shortlex order|shortlex order]]ing instead, comparing first [[rank]], then [[shape]], then [[type]], and finally value.


The name ''total array ordering'' is taken partly from the mathematical concept of a [[wikipedia:total order|total order]], which must order any two elements, with elements ordering equally only if they are identical. This concept is transferred to APL by specifying that arrays should only order equally if they [[match]].
== Exceptions from the ordering ==
== Exceptions from the ordering ==
Some dialects do not implement a true ''total'' order because they include arrays without defining an order for them.
Some dialects do not implement a true ''total'' order because they include arrays without defining an order for them.

Navigation menu