fix insert_scal fill issues
This commit is contained in:
parent
cbc1ef397b
commit
c4685bcc0c
@ -416,7 +416,7 @@ static B insert_scal(B f, FC2 fc2, B x, bool has_w, B fxw, usz xia, ur rr) {
|
||||
B rf;
|
||||
if (has_w) {
|
||||
// fxw is (⊢˝𝕩)𝔽𝕨 so shape errors have been caught
|
||||
rf = getFillR(fxw);
|
||||
rf = noFill(xf)? bi_noFill : getFillR(fxw);
|
||||
COPY_TO(r.a, el_B, 0, fxw, 0, csz);
|
||||
decG(fxw);
|
||||
} else {
|
||||
@ -443,6 +443,7 @@ static B insert_scal(B f, FC2 fc2, B x, bool has_w, B fxw, usz xia, ur rr) {
|
||||
if (!has_w) rf = fc2(f, inc(xf), rf);
|
||||
if (n%2 == !has_w) rf = fc2(f, inc(xf), rf);
|
||||
else fc2(f, inc(xf), inc(rf)); // could error, -˜˝"abc"
|
||||
rf = asFill(rf);
|
||||
popCatch();
|
||||
}
|
||||
#else
|
||||
@ -450,7 +451,7 @@ static B insert_scal(B f, FC2 fc2, B x, bool has_w, B fxw, usz xia, ur rr) {
|
||||
#endif
|
||||
}
|
||||
decG(x);
|
||||
return withFill(r.b, rf);
|
||||
return noFill(rf)? squeeze_any(r.b) : withFill(r.b, rf);
|
||||
}
|
||||
|
||||
B insert_c1(Md1D* d, B x) { B f = d->f;
|
||||
@ -491,7 +492,7 @@ B insert_c1(Md1D* d, B x) { B f = d->f;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
if (len>2 && xia<6*(u64)len) {
|
||||
if (len>2 && HEURISTIC(xia<6*(u64)len)) {
|
||||
return insert_scal(f, c2fn(f), x, 0, m_f64(0), xia, xr-1);
|
||||
}
|
||||
}
|
||||
@ -545,7 +546,7 @@ B insert_c2(Md1D* d, B w, B x) { B f = d->f;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
if (len>2 && xia<6*(u64)len && !(isArr(w) && RNK(w)>rr)) {
|
||||
if (len>2 && HEURISTIC(xia<6*(u64)len) && !(isArr(w) && RNK(w)>rr)) {
|
||||
FC2 fc2 = c2fn(f);
|
||||
w = fc2(f, C2(select, m_f64(-1), incG(x)), w);
|
||||
return insert_scal(f, fc2, x, 1, w, xia, rr);
|
||||
|
||||
@ -41,6 +41,10 @@
|
||||
{3↑ -˝𝕩‿2⥊<<'a'}¨ 5‿6 %!HEAPVERIFY %% <¨¨ ⟨"aa ", 3⥊0⟩
|
||||
{3↑ (2⥊2)-˝𝕩‿2⥊<<'x'}¨ 5‿6 %!HEAPVERIFY %% <¨¨ ⟨"vv ", 2‿2‿0⟩
|
||||
{3↑ "ee"-˝𝕩‿2⥊<<'a'}¨ 5‿6 %!HEAPVERIFY %% <¨¨ ⟨¯4‿¯4‿0, "ee "⟩
|
||||
%USE fill ⋄ Fill (↕ 4) ≠˝ "Ah"•internal.Variation 4‿4⥊'a' %% 0
|
||||
%USE fill ⋄ Fill (↕⋈4) ≠˝ "Ah"•internal.Variation 4‿4⥊'a' %% 'e'
|
||||
%USE fill ⋄ Fill (↕ 4) ≠˝ 4‿4⥊'a' %% 0
|
||||
%USE fill ⋄ Fill (↕⋈4) ≠˝ 4‿4⥊'a' %% ⋈0 %!HEAPVERIFY
|
||||
|
||||
%DEF sqfill SqFill ← {•internal.Squeeze "Ah"•internal.Variation 𝕩}
|
||||
%USE fill ⋄ %USE eqall ⋄ %USE sqfill ⋄ F←•internal.Keep∘⊢ ⋄ {EqAll Fill¨ ⟨SqFill ⟨𝕩⟩, F¨<𝕩, @F¨<𝕩, @F¨⋈𝕩⟩}¨ ⟨"abc", 4, 'a', {⇐}⟩
|
||||
|
||||
@ -552,6 +552,7 @@ b←1↓1∾a←"hello" ⋄ b ⌽⎊'e' ⥊⟜1⍟2 5 ⋄ a ≡○•Hash b %% 1
|
||||
( ↕4) +˝ ↕10‿4 %% (↕4) + 45 ⋈¨ 10×↕4
|
||||
(<¨ ↕4) +˝ ↕10‿4 %% (↕4) + 45 ⋈¨ 10×↕4
|
||||
(0‿5⊸+¨↕4) +˝ ↕10‿4 %% ((↕4) + 45) ⋈¨ 5 + 11×↕4
|
||||
{! 1≥•internal.ElType 𝕏˜ "Ah"•internal.Variation 10⥊1}¨ ⟨+,-,×,÷,⋆,√,⌊,⌈,|,¬,∧,∨,<,>,≠,=,≤,≥⟩ # insert_scal relies on all pervasive dyadic builtins implicitly squeezing
|
||||
|
||||
# ⌜
|
||||
!"𝕨𝔽⌜𝕩: Result rank too large (200≡=𝕨, 200≡=𝕩)" % +⌜˜(200⥊1)⥊1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user