Total array ordering

From APL Wiki
Revision as of 10:24, 22 November 2020 by Adám Brudzewsky (talk | contribs)
Jump to navigation Jump to search

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 functions. Traditionally ordering is defined only for simple arrays of the same shape and type, so TAO refers to the extension to nested or boxed arrays of arbitrary rank, shape, and type.

J has had such an ordering since 1996 (release 3.01). Dyalog APL added a total array ordering with version 17.0. Both of these are based on a lexicographic ordering. GNU APL and [[NARS2000] also implement total ordering, but based on wikipedia:shortlex ordering instead.

Dyalog's ordering is not a true total order because it does not handle arrays containing simple scalars other than nulls, numbers or characters, namely namespaces and objects. Roger Hui has argued that these scalars are not truly arrays, and are not in the scope of a total array ordering.

The name total array ordering is taken partly from the mathematical concept of a 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.

Documentation

External links

  • n_le, a dfn implementation of a total array ordering
APL features [edit]
Built-ins Primitives (functions, operators) ∙ Quad name
Array model ShapeRankDepthBoundIndex (Indexing) ∙ AxisRavelRavel orderElementScalarVectorMatrixSimple scalarSimple arrayNested arrayCellMajor cellSubarrayEmpty arrayPrototype
Data types Number (Boolean, Complex number) ∙ Character (String) ∙ BoxNamespaceFunction array
Concepts and paradigms Conformability (Scalar extension, Leading axis agreement) ∙ Scalar function (Pervasion) ∙ Identity elementComplex floorArray ordering (Total) ∙ Tacit programming (Function composition, Close composition) ∙ GlyphLeading axis theoryMajor cell search
Errors LIMIT ERRORRANK ERRORSYNTAX ERRORDOMAIN ERRORLENGTH ERRORINDEX ERRORVALUE ERROREVOLUTION ERROR