From e2b07a5fd0bbaad232c717fb90a31d6c61d72bd4 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 14 Jul 2022 20:06:50 -0400 Subject: Try to include previous variable definitions in REPL links --- docs/doc/replicate.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/doc/replicate.html') diff --git a/docs/doc/replicate.html b/docs/doc/replicate.html index 1e1fabc5..6ffec63c 100644 --- a/docs/doc/replicate.html +++ b/docs/doc/replicate.html @@ -149,7 +149,7 @@ ┘

Here the 20 indicates that the first row of b is copied twice and the second is ignored, while 10011 picks out three entries from that row. As in the single-axis case, 𝕩 can have extra trailing axes that aren't modified by 𝕨. The rules are that 𝕨 can't have more elements than axes of 𝕩 (so (𝕨)≤=𝕩), and that each element has to have the same length as the corresponding axis—or it can be a unit, as shown below.

-↗️
    <2,<3 / b
+↗️
    <2,<3 / b
 ┌─                               
 ╵ 0 0 0 1 1 1 2 2 2 3 3 3 4 4 4  
   0 0 0 1 1 1 2 2 2 3 3 3 4 4 4  
@@ -158,7 +158,7 @@
                                 ┘
 

Above, both elements of 𝕨 are enclosed numbers. An individual element doesn't have to be enclosed, but I don't recommend this, since if none of them are enclosed, then 𝕨 will have depth 1 and it will be interpreted as replicating along the first axis only.

-↗️
    2,3 / b
+↗️
    2,3 / b
 ┌─           
 ╵ 0 1 2 3 4  
   0 1 2 3 4  
@@ -169,7 +169,7 @@
 

The example above has a different result from the previous one! The function <¨/ could be used in place of / to replicate each axis by a different number.

If 𝕨 is ⟨⟩, then it has depth 1, but is handled with the multidimensional case anyway, giving a result of 𝕩. The one-dimensional case could also only ever return 𝕩, but it would be required to have length 0, so this convention still only extends the simple case.

-↗️
    b  ⟨⟩ / b
+↗️
    b  ⟨⟩ / b
 1
 

Indices

@@ -243,7 +243,7 @@ Error: /: Argument must have rank 1 (3‿6 ≡ ≢𝕩)

Error. But the two 1s are located at 03 and 12. What's wrong with those? First, let's note that you can find these indices if you need to, using Replicate. Make the list of all indices ↕≢𝕩, and filter Over Deshape ().

-↗️
    /(↕≢) r
+↗️
    /(↕≢) r
 ⟨ ⟨ 0 3 ⟩ ⟨ 1 2 ⟩ ⟩
 

The issue with this function is that it's not consistent with the result of / on a list. This is because the extension gives element indices, which are lists, while the original / gives single-number indices, which is only possible when 𝕩 has rank 1.

-- cgit v1.2.3