Interval Index: Difference between revisions

Jump to navigation Jump to search
258 bytes added ,  23:56, 29 September 2020
Add BQN to table
m (Text replacement - "http://help.dyalog.com" to "https://help.dyalog.com")
(Add BQN to table)
Line 1: Line 1:
{{Built-in|Interval Index|⍸}}, or '''Bins''' (<source lang=apl inline>⍋</source>) in [[A+]], is a [[primitive function|primitive]] [[search function]] which locates [[cell]]s of its right [[argument]] relative to cells of a [[sorted]] left argument. Like searching for the right page for a word in a dictionary, knowing the first word on each page, Interval Index finds for each cell (word to search for) an [[index]] (page number) in the left argument (dictionary) so that the target cell is between the [[major cell]] at that index (first word on the page) and the major cell at the following index (first word on the next page). In general computer science, this problem is known as a '''predecessor search''' (see [[wikipedia:predecessor problem|predecessor problem]]), since it searches for the predecessor—entry immediately preceding—of an array, but may be referred to by the name of a common technique used to solve it, the [[wikipedia:binary search|binary search]]. Interval Index may also be considered a way to perform [[wikipedia:data binning|data binning]].
{{Built-in|Interval Index|⍸}}, or '''Bins''' (<source lang=apl inline>⍋</source>) in [[A+]] and [[BQN]], is a [[primitive function|primitive]] [[search function]] which locates [[cell]]s of its right [[argument]] relative to cells of a [[sorted]] left argument. Like searching for the right page for a word in a dictionary, knowing the first word on each page, Interval Index finds for each cell (word to search for) an [[index]] (page number) in the left argument (dictionary) so that the target cell is between the [[major cell]] at that index (first word on the page) and the major cell at the following index (first word on the next page). In general computer science, this problem is known as a '''predecessor search''' (see [[wikipedia:predecessor problem|predecessor problem]]), since it searches for the predecessor—entry immediately preceding—of an array, but may be referred to by the name of a common technique used to solve it, the [[wikipedia:binary search|binary search]]. Interval Index may also be considered a way to perform [[wikipedia:data binning|data binning]].


Like [[Grade]], Interval Index relies on [[array ordering]], but is not subject to [[comparison tolerance]]. Its result depends on [[index origin]] when present.
Like [[Grade]], Interval Index relies on [[array ordering]], but is not subject to [[comparison tolerance]]. Its result depends on [[index origin]] when present.
Line 73: Line 73:
|-
|-
| [[Dyalog APL]] || Interval Index || <source lang=apl inline>⍸</source>  || <source lang=apl inline>⎕IO-1</source> || [)            || Ascending; no duplicates prior to [[Dyalog APL 17.1|17.1]]
| [[Dyalog APL]] || Interval Index || <source lang=apl inline>⍸</source>  || <source lang=apl inline>⎕IO-1</source> || [)            || Ascending; no duplicates prior to [[Dyalog APL 17.1|17.1]]
|-
| [[BQN]]        || Bins          || <source lang=apl inline>⍋⍒</source> || <source lang=apl inline>0</source>    || [)            || Ascending (<source lang=apl inline>⍋</source>) or descending (<source lang=apl inline>⍒</source>)
|}
|}


Navigation menu