fix dense case of •rand.Subset not updating seed

This commit is contained in:
dzaima 2023-10-30 17:03:38 +02:00
parent 31bfaff9dd
commit 08c4627686
2 changed files with 8 additions and 2 deletions

View File

@ -596,7 +596,7 @@ B rand_subset_c2(B t, B w, B x) {
}
s = taga(cpyBitArr(s));
if (invert) s = bit_negate(s);
return C1(slash, s);
r = C1(slash, s);
} else {
// Sorted "hash" set
u64 sh = 0;

View File

@ -208,7 +208,13 @@ E←•internal.EEqual ⋄ {! (𝕏 4⥊0) E 𝕏 1↓¯1×π∾4⥊0}¨ (⊢∾
0 (•MakeRand 0).Subset 0 %%
{!(•rand.Deal 𝕩)𝕩}¨ ¯101+222 # %SLOW
!"(rand).Range: Result rank too large (256≡≢𝕨)" % (2561) •rand.Range 0
! ˝ a{r•MakeRand 𝕩 r.Range 1e9, 100 r.Range 1e9, r.Deal 100, 100 r.Deal 200, 100 r.Deal 200}¨ 222 !¨´ a
! ˝ a{r•MakeRand 𝕩 r.Range 1e9, 100 r.Range 1e9, r.Deal 100, 100 r.Deal 200, 100 r.Deal 200, 100 r.Subset 200}¨ 222 !¨´ a
r•MakeRand 1 ! 1¨ {𝕊: 800 r.Subset 1000}¨ 4
r•MakeRand 1 ! 1¨ {𝕊: 50 r.Subset 10000}¨ 4
r•MakeRand 1 ! 1¨ {𝕊: 10 r.Range 10000}¨ 4
r•MakeRand 1 ! 1¨ {𝕊: 1010 r.Range 128}¨ 4
r•MakeRand 1 ! 1¨ {𝕊: r.Deal 1000}¨ 4
r•MakeRand 1 ! 1¨ {𝕊: 500 r.Deal 1000}¨ 4
# •bit
!"•bit._cast: 𝕩 must have rank at least 1" % 81 •bit._cast 123