aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-09-09 13:53:14 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-09-09 13:53:14 -0400
commit4f7974ff14a5ba4f7d09aeb9cf931198a7cf8cc6 (patch)
treebb8304fff74dc52bae3a601db16c753251bf8fb2 /src
parent6fee64c6141cf783c3d2ac758021d4b39f48c2b2 (diff)
Iterate forward across axes to generate inner Join indices
Diffstat (limited to 'src')
-rw-r--r--src/r.bqn3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/r.bqn b/src/r.bqn
index 56802762..c5bab8b2 100644
--- a/src/r.bqn
+++ b/src/r.bqn
@@ -326,8 +326,7 @@ Join←(1≠=)◶⟨∨´1≠=⌜,1⟩◶{
q←1 ⋄ l←(≢𝕩){m←𝕩⊸⊑⌜s ⋄ r←⊑⟜m⌜q×↕𝕨 ⋄ scm!m≡n⥊r⊣⌜↕q ⋄ q×↩𝕨 ⋄ r}¨○⌽↕=𝕩
t←(=𝕩)↓0⊑s
"∾𝕩: 𝕩 element trailing shapes must match" ! ∧´(t≡(=𝕩)⊸↓)⌜s
- i←<0 ⋄ q↩<1
- {s←0⋄p←{o←s⋄s+↩𝕩⋄o}⌜𝕩 ⋄ j←↕s ⋄ i↩(j⊢⌜i)+(j-𝕩/p)×⌜q ⋄ q×⌜˜↩𝕩/𝕩}⌜l
+ i←(<0) {s←0⋄p←{o←s⋄s+↩𝕩⋄o}⌜𝕨 ⋄ (𝕩×⌜𝕨/𝕨)+𝕩⊢⌜(↕s)-𝕨/p}´ l
i(0<≠t)◶⟨⊑⟜⥊¨,{ti←t⥊↕tp←×´t⋄((tp×𝕨)+⌜ti)⊑⟜⥊¨𝕩⊣⌜ti}⟩(⌽l)/𝕩
}⍟(0<≠∘⥊)