aboutsummaryrefslogtreecommitdiff
path: root/docs/doc
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-06-01 16:06:28 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-06-01 16:06:34 -0400
commit4cfeb0f2a9c040e85f67a8d78e8a40de68530e46 (patch)
treef8b19f2fe99a5fcfa29e7d934a505aa18c0a5f8b /docs/doc
parent6078db236e6c34788371576bb51410cf8298b583 (diff)
Consistently use the name Reorder Axes, not dyadic Transpose
Diffstat (limited to 'docs/doc')
-rw-r--r--docs/doc/indices.html2
-rw-r--r--docs/doc/primitive.html2
-rw-r--r--docs/doc/rank.html2
-rw-r--r--docs/doc/transpose.html8
4 files changed, 7 insertions, 7 deletions
diff --git a/docs/doc/indices.html b/docs/doc/indices.html
index 8ed4317e..36bf279c 100644
--- a/docs/doc/indices.html
+++ b/docs/doc/indices.html
@@ -85,7 +85,7 @@
</tr>
</tbody>
</table>
-<p>In Dyadic <a href="transpose.html#dyadic-transpose">Transpose</a> (<code><span class='Function'>⍉</span></code>), <code><span class='Value'>𝕨</span></code> is made up of indices into axes of <code><span class='Value'>𝕩</span></code>. Since array shape is 1-dimensional, there is only one sensible choice for these elements, a single number each.</p>
+<p>In <a href="transpose.html#reorder-axes">Reorder Axes</a> (<code><span class='Function'>⍉</span></code>), <code><span class='Value'>𝕨</span></code> is made up of indices into axes of <code><span class='Value'>𝕩</span></code>. Since array shape is 1-dimensional, there is only one sensible choice for these elements, a single number each.</p>
<h2 id="element-indices"><a class="header" href="#element-indices">Element indices</a></h2>
<p>In general, the index of an element of an array is a list whose length matches the array rank. It is also possible to use a number for an index into a list, as the list index is a singleton, but this must be kept consistent with the rest of the language. NARS-family APLs make the Index Generator (<code><span class='Function'>↕</span></code> in BQN) return a numeric list when the argument has length 1 but a nested array otherwise. This means that the depth of the result depends on the shape of the argument, inverting the typical hierarchy. BQN shouldn't have such an inconsistency.</p>
<p>Functions <a href="range.html">Range</a> (<code><span class='Function'>↕</span></code>), <a href="replicate.html">Indices</a> (<code><span class='Function'>/</span></code>), <a href="group.html">Group</a> (<code><span class='Function'>βŠ”</span></code>), and <a href="pick.html">Pick</a> (<code><span class='Function'>βŠ‘</span></code>) naturally deal with element indices. Each of these can be defined to use list indices. However, this usually rules out the possibility of using atomic indices, which makes these functions harder to use both with generic array manipulation and with the major cell indices discussed in the next section. For this reason BQN restricts <code><span class='Function'>βŠ”</span></code> and <code><span class='Function'>/</span></code> to use atomic indices, which comes with the requirement that the arguments to Group and Indices, and the result of Group Indices, must be lists. For dyadic Group the depth-1 elements of <code><span class='Value'>𝕨</span></code> are arrays of indices along axes of the result (<a href="group.html#multidimensional-grouping">multi-axis documentation</a>). This means each axis of <code><span class='Value'>𝕩</span></code> can only be related to one axis of the result.</p>
diff --git a/docs/doc/primitive.html b/docs/doc/primitive.html
index 7e32c91e..3da3019b 100644
--- a/docs/doc/primitive.html
+++ b/docs/doc/primitive.html
@@ -182,7 +182,7 @@
<tr>
<td><code><span class='Function'>⍉</span></code></td>
<td><a href="transpose.html">Transpose</a></td>
-<td><a href="transpose.html">Reorder axes</a></td>
+<td><a href="transpose.html">Reorder Axes</a></td>
</tr>
<tr>
<td><code><span class='Function'>/</span></code></td>
diff --git a/docs/doc/rank.html b/docs/doc/rank.html
index d030055d..23a5630e 100644
--- a/docs/doc/rank.html
+++ b/docs/doc/rank.html
@@ -281,7 +281,7 @@
<span class='Error'>Error: βŽ‰: Argument frames don't agree (2β€Ώ3β€Ώ5 ≑ ≒𝕨, 3β€Ώ4 ≑ ≒𝕩, common frame of 1 axes)</span>
</pre>
<p>On the other hand, Rank doesn't care about the argument cell shapesβ€”it leaves that up to the function <code><span class='Function'>𝔽</span></code>. If <code><span class='Function'>𝔽</span></code> is an arithmetic function, you'll get <em>two</em> layers of prefix agreement: one outer matching with <code><span class='Modifier2'>βŽ‰</span></code>, and an inner one with <code><span class='Function'>𝔽</span></code>.</p>
-<p>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 <a href="transpose.html#dyadic-transpose">reorder axes</a>).</p>
+<p>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 <a href="transpose.html#reorder-axes">reorder axes</a>).</p>
<p>One of the relatively more common instance of this pattern is a variation on the <a href="map.html#table">Table</a> modifier, to work with cells instead of elements. Here we'll make a table of all combinations of one row (1-cell) from <code><span class='Value'>𝕨</span></code> and one from <code><span class='Value'>𝕩</span></code>. To do this, we want to first line up each row of <code><span class='Value'>𝕨</span></code> with the whole of <code><span class='Value'>𝕩</span></code>. As in a matrix product, that's <code><span class='Modifier2'>βŽ‰</span><span class='Number'>1</span><span class='Ligature'>β€Ώ</span><span class='Number'>∞</span></code>. But then we'd like to pair that row with the rows of <code><span class='Value'>𝕩</span></code> individually, which could be written <code><span class='Modifier2'>βŽ‰</span><span class='Number'>∞</span><span class='Ligature'>β€Ώ</span><span class='Number'>1</span></code>. But since we know the left argument has been reduced to lists, <code><span class='Modifier2'>βŽ‰</span><span class='Number'>1</span></code> also works. We then arrange the two layers of mapping with <code><span class='Modifier2'>βŽ‰</span><span class='Number'>1</span></code> on the inside, giving <code><span class='Paren'>(</span><span class='Function'>∾</span><span class='Modifier2'>βŽ‰</span><span class='Number'>1</span><span class='Paren'>)</span><span class='Modifier2'>βŽ‰</span><span class='Number'>1</span><span class='Ligature'>β€Ώ</span><span class='Number'>∞</span></code>.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=KCJhYmMi4omNImRlZiIpIOKIvuKOiTHijokx4oC/4oieID4iUVIi4oC/IlNUIuKAvyJVViIKCuKJoiAoImFiYyLiiY0iZGVmIikg4oi+4o6JMeKOiTHigL/iiJ4gPiJRUiLigL8iU1Qi4oC/IlVWIgoK4omiICjihpUz4oC/NOKAvzUpIOKIvuKOiTHijokx4oC/4oieIOKGlTDigL8x4oC/MuKAvzg=">↗️</a><pre> <span class='Paren'>(</span><span class='String'>&quot;abc&quot;</span><span class='Function'>≍</span><span class='String'>&quot;def&quot;</span><span class='Paren'>)</span> <span class='Function'>∾</span><span class='Modifier2'>βŽ‰</span><span class='Number'>1</span><span class='Modifier2'>βŽ‰</span><span class='Number'>1</span><span class='Ligature'>β€Ώ</span><span class='Number'>∞</span> <span class='Function'>&gt;</span><span class='String'>&quot;QR&quot;</span><span class='Ligature'>β€Ώ</span><span class='String'>&quot;ST&quot;</span><span class='Ligature'>β€Ώ</span><span class='String'>&quot;UV&quot;</span>
β”Œβ”€
diff --git a/docs/doc/transpose.html b/docs/doc/transpose.html
index fca1d637..952abc2c 100644
--- a/docs/doc/transpose.html
+++ b/docs/doc/transpose.html
@@ -87,8 +87,8 @@
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4omiIOKNieKBvOKOicKvMiDijYkgYTIzNDU2ICAjIFJlc3RyaWN0IFRyYW5zcG9zZSB0byB0aGUgZmlyc3QgdGhyZWUgYXhlcw==">↗️</a><pre> <span class='Function'>β‰’</span> <span class='Function'>⍉</span><span class='Modifier'>⁼</span><span class='Modifier2'>βŽ‰</span><span class='Number'>Β―2</span> <span class='Function'>⍉</span> <span class='Value'>a23456</span> <span class='Comment'># Restrict Transpose to the first three axes
</span>⟨ 3 4 2 5 6 ⟩
</pre>
-<p>In a case like this BQN's Dyadic transpose is much easier.</p>
-<h2 id="dyadic-transpose"><a class="header" href="#dyadic-transpose">Dyadic Transpose</a></h2>
+<p>In a case like this the dyadic version of <code><span class='Function'>⍉</span></code>, called Reorder Axes, is much easier.</p>
+<h2 id="reorder-axes"><a class="header" href="#reorder-axes">Reorder Axes</a></h2>
<p>Transpose also allows a left argument that specifies a permutation of <code><span class='Value'>𝕩</span></code>'s axes. For each index <code><span class='Value'>p</span><span class='Gets'>←</span><span class='Value'>i</span><span class='Function'>βŠ‘</span><span class='Value'>𝕨</span></code> in the left argument, axis <code><span class='Value'>i</span></code> of <code><span class='Value'>𝕩</span></code> is used for axis <code><span class='Value'>p</span></code> of the result. Multiple argument axes can be sent to the same result axis, in which case that axis goes along a diagonal of <code><span class='Value'>𝕩</span></code>, and the result will have a lower rank than <code><span class='Value'>𝕩</span></code>.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4omiIDHigL8z4oC/MuKAvzDigL80IOKNiSBhMjM0NTYKCuKJoiAx4oC/MuKAvzLigL8w4oC/MCDijYkgYTIzNDU2ICAjIERvbid0IHdvcnJ5IHRvbyBtdWNoIGFib3V0IHRoaXMgY2FzZSB0aG91Z2g=">↗️</a><pre> <span class='Function'>β‰’</span> <span class='Number'>1</span><span class='Ligature'>β€Ώ</span><span class='Number'>3</span><span class='Ligature'>β€Ώ</span><span class='Number'>2</span><span class='Ligature'>β€Ώ</span><span class='Number'>0</span><span class='Ligature'>β€Ώ</span><span class='Number'>4</span> <span class='Function'>⍉</span> <span class='Value'>a23456</span>
⟨ 5 2 4 3 6 ⟩
@@ -108,9 +108,9 @@
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4omiIDIg4o2JIGEyMzQ1NiAgIyBSZXN0cmljdCBUcmFuc3Bvc2UgdG8gdGhlIGZpcnN0IHRocmVlIGF4ZXM=">↗️</a><pre> <span class='Function'>β‰’</span> <span class='Number'>2</span> <span class='Function'>⍉</span> <span class='Value'>a23456</span> <span class='Comment'># Restrict Transpose to the first three axes
</span>⟨ 3 4 2 5 6 ⟩
</pre>
-<p>Finally, it's worth noting that, as monadic Transpose moves the first axis to the end, it's equivalent to dyadic Transpose with a &quot;default&quot; left argument: <code><span class='Paren'>(</span><span class='Function'>=-</span><span class='Number'>1</span><span class='Modifier'>Λ™</span><span class='Paren'>)</span><span class='Modifier2'>⊸</span><span class='Function'>⍉</span></code>.</p>
+<p>Finally, it's worth noting that, as monadic Transpose moves the first axis to the end, it's equivalent to Reorder Axes with a &quot;default&quot; left argument: <code><span class='Paren'>(</span><span class='Function'>=-</span><span class='Number'>1</span><span class='Modifier'>Λ™</span><span class='Paren'>)</span><span class='Modifier2'>⊸</span><span class='Function'>⍉</span></code>.</p>
<h2 id="definitions"><a class="header" href="#definitions">Definitions</a></h2>
<p>Here we define the two valences of Transpose more precisely.</p>
<p>An atom right argument to either valence of Transpose is always enclosed to get an array before doing anything else.</p>
<p>Monadic transpose is identical to <code><span class='Paren'>(</span><span class='Function'>=-</span><span class='Number'>1</span><span class='Modifier'>Λ™</span><span class='Paren'>)</span><span class='Modifier2'>⊸</span><span class='Function'>⍉</span></code>, except that if <code><span class='Value'>𝕩</span></code> is a unit it is returned unchanged (after enclosing, if it's an atom) rather than giving an error.</p>
-<p>In dyadic Transpose, <code><span class='Value'>𝕨</span></code> is a number or numeric array of rank 1 or less, and <code><span class='Value'>𝕨</span><span class='Function'>≀</span><span class='Modifier2'>β—‹</span><span class='Function'>β‰ β‰’</span><span class='Value'>𝕩</span></code>. Define the result rank <code><span class='Value'>r</span><span class='Gets'>←</span><span class='Paren'>(</span><span class='Function'>=</span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Function'>-+</span><span class='Modifier'>Β΄</span><span class='Function'>¬∊</span><span class='Value'>𝕨</span></code> to be the right argument rank minus the number of duplicate entries in the left argument. We require <code><span class='Function'>∧</span><span class='Modifier'>Β΄</span><span class='Value'>𝕨</span><span class='Function'>&lt;</span><span class='Value'>r</span></code>. Bring <code><span class='Value'>𝕨</span></code> to full length by appending the missing indices: <code><span class='Value'>𝕨</span><span class='Function'>∾</span><span class='Gets'>↩</span><span class='Value'>𝕨</span><span class='Paren'>(</span><span class='Function'>Β¬</span><span class='Modifier2'>∘</span><span class='Function'>∊</span><span class='Modifier'>˜</span><span class='Function'>/⊒</span><span class='Paren'>)</span><span class='Function'>↕</span><span class='Value'>r</span></code>. Now the result shape is defined to be <code><span class='Function'>⌊</span><span class='Modifier'>´¨</span><span class='Value'>𝕨</span><span class='Function'>βŠ”β‰’</span><span class='Value'>𝕩</span></code>. Element <code><span class='Value'>i</span><span class='Function'>βŠ‘</span><span class='Value'>z</span></code> of the result <code><span class='Value'>z</span></code> is element <code><span class='Paren'>(</span><span class='Value'>𝕨</span><span class='Function'>⊏</span><span class='Value'>i</span><span class='Paren'>)</span><span class='Function'>βŠ‘</span><span class='Value'>𝕩</span></code> of the argument.</p>
+<p>In Reorder Axes, <code><span class='Value'>𝕨</span></code> is a number or numeric array of rank 1 or less, and <code><span class='Value'>𝕨</span><span class='Function'>≀</span><span class='Modifier2'>β—‹</span><span class='Function'>β‰ β‰’</span><span class='Value'>𝕩</span></code>. Define the result rank <code><span class='Value'>r</span><span class='Gets'>←</span><span class='Paren'>(</span><span class='Function'>=</span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Function'>-+</span><span class='Modifier'>Β΄</span><span class='Function'>¬∊</span><span class='Value'>𝕨</span></code> to be the right argument rank minus the number of duplicate entries in the left argument. We require <code><span class='Function'>∧</span><span class='Modifier'>Β΄</span><span class='Value'>𝕨</span><span class='Function'>&lt;</span><span class='Value'>r</span></code>. Bring <code><span class='Value'>𝕨</span></code> to full length by appending the missing indices: <code><span class='Value'>𝕨</span><span class='Function'>∾</span><span class='Gets'>↩</span><span class='Value'>𝕨</span><span class='Paren'>(</span><span class='Function'>Β¬</span><span class='Modifier2'>∘</span><span class='Function'>∊</span><span class='Modifier'>˜</span><span class='Function'>/⊒</span><span class='Paren'>)</span><span class='Function'>↕</span><span class='Value'>r</span></code>. Now the result shape is defined to be <code><span class='Function'>⌊</span><span class='Modifier'>´¨</span><span class='Value'>𝕨</span><span class='Function'>βŠ”β‰’</span><span class='Value'>𝕩</span></code>. Element <code><span class='Value'>i</span><span class='Function'>βŠ‘</span><span class='Value'>z</span></code> of the result <code><span class='Value'>z</span></code> is element <code><span class='Paren'>(</span><span class='Value'>𝕨</span><span class='Function'>⊏</span><span class='Value'>i</span><span class='Paren'>)</span><span class='Function'>βŠ‘</span><span class='Value'>𝕩</span></code> of the argument.</p>