From 8d58eafa341b5a65bed1a267bc34653e46bbc6e8 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 14 Jul 2021 22:25:01 -0400 Subject: Document high-rank search function behavior --- docs/doc/leading.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/doc/leading.html') diff --git a/docs/doc/leading.html b/docs/doc/leading.html index 72ce1450..69f04d77 100644 --- a/docs/doc/leading.html +++ b/docs/doc/leading.html @@ -201,12 +201,12 @@

If one argument is a unit, that is, it has no axes, then leading axis agreement reduces to APL's "scalar extension" (where "scalar" is equivalent to BQN's "unit"), where a single unit is matched with an entire array by repeating it at every application. A unit always agrees with any other array under leading axis agreement because it has no axes whose lengths would need to be checked.

With leading axis agreement, there are k+1 shapes for arrays that can be added (or any other function with Each) to a given array x without changing its rank. These are precisely the prefixes of x, with ranks from 0 to k inclusive. Arrays with larger rank can also be used as the other argument, but then the result shape will match that argument and not x.

Search functions

-

The search functions Bins (⍋⍒), Index of (), Progressive Index of (), and Member of () look through cells of one argument to find cells of the other. Find () also does a search, but a slightly different one: it tries to find slices of cells of 𝕩 that match 𝕨.

+

The search functions, Index of (), Progressive Index of (), and Member of (), and also Bins (⍋⍒), look through cells of one argument to find cells of the other. Find () also does a search, but a slightly different one: it tries to find slices of cells of 𝕩 that match 𝕨.

- - + + @@ -223,4 +223,4 @@
Searching throughLook forSearch inSearch for Functions
-

For all of these functions but Find, the argument to search through is treated as a list of its major cells. It is the rank of these major cells—let's call this rank c—that determines how the other argument is treated. That argument must have rank at least c, and it is treated as an array of c-cells. For example, if the left argument to is a matrix, then each 1-cell or row of 𝕩 is treated independently, and each one yields one number in the result: a 0-cell. The result rank of is always 𝕨¬=𝕩.

+

For all of these functions but Find, the searched-in argument is treated as a list of its major cells, and the searched-for argument is considered a collection of cells with the same rank. See the search function documentation.

-- cgit v1.2.3