aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/r1.bqn20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/r1.bqn b/src/r1.bqn
index 498784e4..57166278 100644
--- a/src/r1.bqn
+++ b/src/r1.bqn
@@ -347,6 +347,16 @@ Merge←{
(Deshape⌜𝕩)⊑˜⌜c⥊↕1×´c
}_fillMerge_∾⍟IsArray
+JoinTo←(1<⌈○=)◶(∾○⥊)‿{
+ a←1-˜𝕨⌈○=𝕩
+ s←𝕨Pair○≢𝕩
+ "𝕨∾𝕩: Rank of 𝕨 and 𝕩 must differ by at most 1" ! 1×´(a≤≠)⌜s
+ c←(≠-a˙)⊸↓⌜s
+ "𝕨∾𝕩: Cell shapes of 𝕨 and 𝕩 must match" ! MatchS´c
+ l←0+´(a<≠)◶1‿(0⊑⊢)⌜s
+ (⟨l⟩∾0⊑c)⥊𝕨∾○⥊𝕩
+}○ToArray _fillBy_ IF
+
Join1←{
# List of lists
i←j←¯1 ⋄ e←⟨⟩ ⋄ a←𝕩
@@ -640,16 +650,6 @@ _rankOp_←{
> ((0⊑k)Enc𝕨) 𝔽_each ((1-˜≠)⊸⊑k)Enc𝕩
}
-JoinTo←∨○(1<=)◶(∾○⥊)‿{
- s←𝕨Pair○≢𝕩
- a←1⌈´k←≠⌜s
- "𝕨∾𝕩: Rank of 𝕨 and 𝕩 must differ by at most 1" ! 1∧´1≥a-k
- c←(k¬a)+⟜(↕a-1)⊸⊏¨s
- "𝕨∾𝕩: Cell shapes of 𝕨 and 𝕩 must match" ! MatchS´c
- l←0+´(a=k)⊣◶1‿(0⊑⊢)¨s
- (⟨l⟩∾0⊑c)⥊𝕨∾○⥊𝕩
-} _fillBy_ IF
-
_repeat_←{
F←𝔽 ⋄ b←𝕨{𝕏⊣}˙⊘{𝕨˙{𝔽𝕏⊣}}0
n←𝕨𝔾𝕩