mirror of
https://github.com/allaunthefox/Research-Stack.git
synced 2026-08-13 16:50:35 +00:00
fix: update Sidon tests for Mian-Chowla API (68/68 pass)
This commit is contained in:
parent
af2669435f
commit
3e2eda8892
1 changed files with 9 additions and 4 deletions
|
|
@ -328,13 +328,18 @@ def test_sidon():
|
||||||
|
|
||||||
# Edge cases
|
# Edge cases
|
||||||
report("assign_sidon_slots(0) = []", bs.assign_sidon_slots(0) == [])
|
report("assign_sidon_slots(0) = []", bs.assign_sidon_slots(0) == [])
|
||||||
report("assign_sidon_slots(1) = [seed]", bs.assign_sidon_slots(1) == [42])
|
report("assign_sidon_slots(1) = [1]", bs.assign_sidon_slots(1) == [1])
|
||||||
|
|
||||||
# Reproducibility
|
# Reproducibility (deterministic — no seed needed for Mian-Chowla)
|
||||||
s1 = bs.assign_sidon_slots(15, seed=100)
|
s1 = bs.assign_sidon_slots(15)
|
||||||
s2 = bs.assign_sidon_slots(15, seed=100)
|
s2 = bs.assign_sidon_slots(15)
|
||||||
report("sidon is deterministic", s1 == s2)
|
report("sidon is deterministic", s1 == s2)
|
||||||
|
|
||||||
|
# Method comparison
|
||||||
|
p2 = bs.assign_sidon_slots(8, 'powers_of_2')
|
||||||
|
mc = bs.assign_sidon_slots(8, 'greedy_optimal')
|
||||||
|
report("Mian-Chowla denser than powers_of_2", max(mc) < max(p2))
|
||||||
|
|
||||||
|
|
||||||
# ── 8. Soliton Search ────────────────────────────────────────────────────────
|
# ── 8. Soliton Search ────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue