diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-08 23:44:03 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-08 23:47:21 -0400 |
| commit | 52f8a6655c65584cf0740021dcd6fed428fc9b6c (patch) | |
| tree | 521474b6ad6127bd2c969ab22c23c683780c6a4c /src | |
| parent | 2ff502e46f9d7e6929059479da2e160d0cbbf5de (diff) | |
Faster high-rank Join implementation
Diffstat (limited to 'src')
| -rw-r--r-- | src/r.bqn | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -314,20 +314,21 @@ Replicate β {0<=π¨}βΆ{π¨ΛβΈRepπ©}βΏ{"π¨/π©: lengths of component Joinβ(1β =)βΆβ¨β¨Β΄1β =β,1β©βΆ{ # List of lists - iβjβΒ―1βeββ¨β©βaβπ© + iβjβΒ―1 β eββ¨β© β aβπ© {{eβ©aβΛiβ©π©βjβ©Β―1}β(iβΈβ )π©β(jβ©j+1)βe}β/β βπ© }βΏ{ # Multidimensional - Cβ(<β¨β©)β₯βΈβΎβΒ΄β’ # Cartesian array product "βΎπ©: π© must be an array" ! IsArray π© - sββ’βπ© - dββ 0ββ₯s - "βΎπ©: elements of π© must all have the same rank" ! β§Β΄β₯d=β βs + nββ zββ₯π© β sββ’βz β dββ 0βs + "βΎπ©: elements of π© must all have the same rank" ! β§Β΄d=β βs "βΎπ©: π© element rank must be at least argument rank" ! dβ₯=π© - lβ(β’π©){(π©βββ’a Pick1Λ(j=π©)βΈΓ)ββπ¨}Β¨jββrβ=aβπ© - "βΎπ©: π© element shapes must be compatible" ! (rβΈββs)β‘C l - iβC{pβ+Β΄ββπ©β(β0ββ½p)-π©/Β―1βp}βl - >i<ββΈβΒ¨l/π© + scmβ"βΎπ©: π© element shapes must be compatible" + 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<β t)βΆβ¨βββ₯Β¨,{tiβtβ₯βtpβΓΒ΄tβ((tpΓπ¨)+βti)βββ₯Β¨π©β£βti}β©(β½l)/π© }β(0<β ββ₯) _groupβ{ |
