diff --git a/src/builtins/select.c b/src/builtins/select.c index 02707911..433d7424 100644 --- a/src/builtins/select.c +++ b/src/builtins/select.c @@ -362,17 +362,7 @@ B select_c2(B t, B w, B x) { - - -B select_ucw(B t, B o, B w, B x) { - if (isAtm(x) || RNK(x)!=1 || isAtm(w)) return def_fn_ucw(t, o, w, x); - usz xia = IA(x); - usz wia = IA(w); - SGetU(w) - if (TI(w,elType)!=el_i32) for (usz i = 0; i < wia; i++) if (!q_i64(GetU(w,i))) return def_fn_ucw(t, o, w, x); - B arg = select_c2(t, incG(w), incG(x)); - B rep = c1(o, arg); - if (isAtm(rep) || !eqShape(w, rep)) thrF("π”½βŒΎ(a⊸⊏)𝕩: 𝔽 must return an array with the same shape as its input (expected %H, got %H)", w, rep); +B select_replace(u32 chr, B w, B x, B rep, usz wia, usz xia) { // rep⌾(w⊏β₯Š) x #if CHECK_VALID TALLOC(bool, set, xia); bool sparse = wia < xia/64; @@ -381,9 +371,9 @@ B select_ucw(B t, B o, B w, B x) { if (sparse) for (usz i = 0; i < wia; i++) { \ i64 cw = WI; if (RARE(cw<0)) cw+= (i64)xia; set[cw] = false; \ } - #define EQ(F) if (set[cw] && (F)) thrM("π”½βŒΎ(a⊸⊏): Incompatible result elements"); set[cw] = true; + #define EQ(F) if (set[cw] && (F)) thrF("π”½βŒΎ(a⊸%c): Incompatible result elements", chr); set[cw] = true; #define FREE_CHECK TFREE(set) - SLOWIF(xia>100 && wia100 && wia100 && wia100 && wia