fix ∾2‿2⥊<0‿0⥊⟨⟩

This commit is contained in:
dzaima 2024-09-22 01:42:26 +03:00
parent f65906721d
commit 989970f7fd
2 changed files with 52 additions and 38 deletions

View File

@ -883,10 +883,14 @@ B join_c1(B t, B x) {
st[a] = len;
}
// Move the data
// Shapes known correct; move the data
usz* csh = tr ? SH(x0) + r0-tr : NULL; // Trailing shape
usz csz = shProd(csh, 0, tr);
MAKE_MUT(r, shProd(st, 0, xr)*csz);
usz ria = shProd(st, 0, xr);
if (mulOn(ria, csz)) thrOOM();
Arr* ra;
if (ria>0) {
MAKE_MUT(r, ria);
// Element index and effective shape, updated progressively
usz *ei =tsh; for (usz i=0; i<xr; i++) ei [i]=0;
usz ri = 0;
@ -927,7 +931,11 @@ B join_c1(B t, B x) {
ri += (lp[lp[a]+ei[a]]-1) * str;
}
}
Arr* ra = mut_fp(r);
ra = mut_fp(r);
} else {
ra = (Arr*) m_harrUp(0).c;
}
usz* sh = arr_shAlloc(ra, xr+tr);
shcpy(sh , st , xr);
shcpy(sh+xr, csh, tr);

View File

@ -193,6 +193,12 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expe
"ab", 12, "de" %% 'a','b',12,'d','e'
!"∾: Item trailing shapes must be equal (contained arrays with shapes 3‿3 and 3‿4)" % 33,34
!"∾: Item trailing shapes must be equal (contained arrays with shapes ⟨2⟩ and 3‿3)" % 12,33
!"∾: Item ranks along an axis can differ by at most one (contained ranks 1 and 3 along axis 0)" % 21 0¨ 023, 0
!"∾: Incompatible item shapes (contained arrays with shapes 1‿0 and 1‿0 along axis 1)" % {1𝕩0}¨ [01, 00]
!"∾: Incompatible item ranks" % 0¨ [0101, 011]
33<1030 %% 3030
33<00 %% 00
133<103<"hi" %% " "
# 𝕨∾𝕩
!"∾: Lengths not matchable (⟨6⟩ ≡ ≢𝕨, 1‿1 ≡ ≢𝕩)" % ("abc""def")"a"