diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-06-04 17:40:31 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-06-04 17:40:31 -0400 |
| commit | 7e5d0fcc39fd8a683fc7010af064849b454b432b (patch) | |
| tree | 272f7003486c3e94c41e8eec155f4095c47e6661 /docs/doc/transpose.html | |
| parent | cd0f461eee93367459dd82a29dd148fff75e5ec6 (diff) | |
Further editing
Diffstat (limited to 'docs/doc/transpose.html')
| -rw-r--r-- | docs/doc/transpose.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/doc/transpose.html b/docs/doc/transpose.html index 952abc2c..807173ba 100644 --- a/docs/doc/transpose.html +++ b/docs/doc/transpose.html @@ -27,7 +27,7 @@ 3 </pre> <p>With two axes the only interesting operation of this sort is to swap them (and with one or zero axes there's nothing interesting to do, and <code><span class='Function'>⍉</span></code> just returns the argument array). But a BQN programmer may well want to work with higher-rank arrays—although such a programmer might call them "tensors"—and this means there are many more ways to rearrange the axes. Transpose extends to high-rank arrays to allow some useful special cases as well as completely general axis rearrangement, as described below.</p> -<h2 id="monadic-transpose"><a class="header" href="#monadic-transpose">Monadic Transpose</a></h2> +<h2 id="transposing-tensors"><a class="header" href="#transposing-tensors">Transposing tensors</a></h2> <p>APL extends matrix transposition to any rank by reversing all axes for its monadic <code><span class='Function'>⍉</span></code>, but this generalization isn't very natural and is almost never used. The main reason for it is to maintain the equivalence <code><span class='Value'>a</span> <span class='Function'>MP</span> <span class='Value'>b</span> <span class='Gets'>←→</span> <span class='Value'>b</span> <span class='Function'>MP</span><span class='Modifier2'>⌾</span><span class='Function'>⍉</span> <span class='Value'>a</span></code>, where <code><span class='Function'>MP</span> <span class='Gets'>←</span> <span class='Function'>+</span><span class='Modifier'>˝</span><span class='Modifier2'>∘</span><span class='Function'>×</span><span class='Modifier2'>⎉</span><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>∞</span></code> is the generalized matrix product. But even here APL's Transpose is suspect. It does much more work than it needs to, as we'll see.</p> <p>BQN's transpose takes the first axis of <code><span class='Value'>𝕩</span></code> and moves it to the end.</p> <a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4omiIGEyMzQ1NiDihpAg4oaVMuKAvzPigL804oC/NeKAvzYKCuKJoiDijYkgYTIzNDU2">↗️</a><pre> <span class='Function'>≢</span> <span class='Value'>a23456</span> <span class='Gets'>←</span> <span class='Function'>↕</span><span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>4</span><span class='Ligature'>‿</span><span class='Number'>5</span><span class='Ligature'>‿</span><span class='Number'>6</span> |
