Commit e9d9386
committed
simplex: concrete sort.Interface for the dual ratio test (drop sort.Slice reflection)
The Clp long-step / DSE ratio test sorts entering candidates by ascending
ratio every dual pivot. sort.Slice does this via reflection (a per-element
reflect-based swap); on 020 it was 740ms / 6.8% of the solve. Replaced with
a concrete sort.Interface (dualCandByRatio / dual2CandByRatio) — the same
pdqsort, same comparator, so the order is byte-identical and results are
unchanged: 020 774 nodes / 182619 pivots / same objective, 018/021 identical.
Interleaved timing (controls for thermal drift): ~11.55s vs ~11.79s, a
consistent ~2% on 020 (new faster in all 5 paired runs). Numerics-neutral —
no tree re-roll. All tests + PuLP green.1 parent 9e30107 commit e9d9386
2 files changed
Lines changed: 19 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
| |||
238 | 246 | | |
239 | 247 | | |
240 | 248 | | |
241 | | - | |
| 249 | + | |
242 | 250 | | |
243 | 251 | | |
244 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
692 | | - | |
| 692 | + | |
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
| |||
804 | 804 | | |
805 | 805 | | |
806 | 806 | | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
807 | 816 | | |
808 | 817 | | |
809 | 818 | | |
| |||
0 commit comments