From 4cfeb0f2a9c040e85f67a8d78e8a40de68530e46 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 1 Jun 2022 16:06:28 -0400 Subject: Consistently use the name Reorder Axes, not dyadic Transpose --- doc/indices.md | 2 +- doc/primitive.md | 2 +- doc/rank.md | 2 +- doc/transpose.md | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'doc') diff --git a/doc/indices.md b/doc/indices.md index bffd132c..b2bff7cd 100644 --- a/doc/indices.md +++ b/doc/indices.md @@ -20,7 +20,7 @@ The following functions take or return indices. Except where marked, the indices | | `⊏` | `𝕨` | Major cell or along-axis number | `⍉` | | | Axis number -In Dyadic [Transpose](transpose.md#dyadic-transpose) (`⍉`), `𝕨` is made up of indices into axes of `𝕩`. Since array shape is 1-dimensional, there is only one sensible choice for these elements, a single number each. +In [Reorder Axes](transpose.md#reorder-axes) (`⍉`), `𝕨` is made up of indices into axes of `𝕩`. Since array shape is 1-dimensional, there is only one sensible choice for these elements, a single number each. ## Element indices diff --git a/doc/primitive.md b/doc/primitive.md index afa5a7f7..fd514390 100644 --- a/doc/primitive.md +++ b/doc/primitive.md @@ -46,7 +46,7 @@ A function call with one argument (prefix) is called "monadic" and one with two | `Β»` | [Nudge](shift.md) | [Shift Before](shift.md) | `Β«` | [Nudge Back](shift.md) | [Shift After](shift.md) | `⌽` | [Reverse](reverse.md) | [Rotate](reverse.md#rotate) -| `⍉` | [Transpose](transpose.md) | [Reorder axes](transpose.md) +| `⍉` | [Transpose](transpose.md) | [Reorder Axes](transpose.md) | `/` | [Indices](replicate.md#indices) | [Replicate](replicate.md) | `⍋` | [Grade Up](order.md#grade) | [Bins Up](order.md#bins) | `⍒` | [Grade Down](order.md#grade) | [Bins Down](order.md#bins) diff --git a/doc/rank.md b/doc/rank.md index 3bce4c44..7c1e2912 100644 --- a/doc/rank.md +++ b/doc/rank.md @@ -196,7 +196,7 @@ This is why the rank of `βŽ‰1β€Ώβˆž` that leads to a frame `⟨3⟩` on the left On the other hand, Rank doesn't care about the argument cell shapesβ€”it leaves that up to the function `𝔽`. If `𝔽` is an arithmetic function, you'll get *two* layers of prefix agreement: one outer matching with `βŽ‰`, and an inner one with `𝔽`. -It's also possible to apply multiple copies of Rank, which in general is powerful enough to match and not-match axes in any combination as long as the axes for each argument stay in order (of course, BQN also provides the tools to [reorder axes](transpose.md#dyadic-transpose)). +It's also possible to apply multiple copies of Rank, which in general is powerful enough to match and not-match axes in any combination as long as the axes for each argument stay in order (of course, BQN also provides the tools to [reorder axes](transpose.md#reorder-axes)). One of the relatively more common instance of this pattern is a variation on the [Table](map.md#table) modifier, to work with cells instead of elements. Here we'll make a table of all combinations of one row (1-cell) from `𝕨` and one from `𝕩`. To do this, we want to first line up each row of `𝕨` with the whole of `𝕩`. As in a matrix product, that's `βŽ‰1β€Ώβˆž`. But then we'd like to pair that row with the rows of `𝕩` individually, which could be written `βŽ‰βˆžβ€Ώ1`. But since we know the left argument has been reduced to lists, `βŽ‰1` also works. We then arrange the two layers of mapping with `βŽ‰1` on the inside, giving `(βˆΎβŽ‰1)βŽ‰1β€Ώβˆž`. diff --git a/doc/transpose.md b/doc/transpose.md index 64d1cbe2..f1f978ad 100644 --- a/doc/transpose.md +++ b/doc/transpose.md @@ -63,9 +63,9 @@ Axis permutations of the types we've shown generate the complete permutation gro β‰’ β‰βΌβŽ‰Β―2 ⍉ a23456 # Restrict Transpose to the first three axes -In a case like this BQN's Dyadic transpose is much easier. +In a case like this the dyadic version of `⍉`, called Reorder Axes, is much easier. -## Dyadic Transpose +## Reorder Axes Transpose also allows a left argument that specifies a permutation of `𝕩`'s axes. For each index `p←iβŠ‘π•¨` in the left argument, axis `i` of `𝕩` is used for axis `p` of the result. Multiple argument axes can be sent to the same result axis, in which case that axis goes along a diagonal of `𝕩`, and the result will have a lower rank than `𝕩`. @@ -85,7 +85,7 @@ In particular, the case with only one axis specified is interesting. Here, the f β‰’ 2 ⍉ a23456 # Restrict Transpose to the first three axes -Finally, it's worth noting that, as monadic Transpose moves the first axis to the end, it's equivalent to dyadic Transpose with a "default" left argument: `(=-1Λ™)βŠΈβ‰`. +Finally, it's worth noting that, as monadic Transpose moves the first axis to the end, it's equivalent to Reorder Axes with a "default" left argument: `(=-1Λ™)βŠΈβ‰`. ## Definitions @@ -95,4 +95,4 @@ An atom right argument to either valence of Transpose is always enclosed to get Monadic transpose is identical to `(=-1Λ™)βŠΈβ‰`, except that if `𝕩` is a unit it is returned unchanged (after enclosing, if it's an atom) rather than giving an error. -In dyadic Transpose, `𝕨` is a number or numeric array of rank 1 or less, and `𝕨≀○≠≒𝕩`. Define the result rank `r←(=𝕩)-+Β΄Β¬βˆŠπ•¨` to be the right argument rank minus the number of duplicate entries in the left argument. We require `βˆ§Β΄π•¨