Refactor Stats Array

* Limit use of `StatsEntry` wrapper to arithmetic types
* Generalize `Stats` to `MultiArray` by discarding the template parameter `D`
* Allow `MultiArray::fill` to take any type assignable to element type
* Remove now-unused operator overloads on `StatsEntry`

closes https://github.com/official-stockfish/Stockfish/pull/5750

No functional change
This commit is contained in:
Shawn Xu
2025-01-05 17:11:22 -08:00
committed by Disservin
parent c47e6fcf84
commit 5370c3035e
4 changed files with 117 additions and 72 deletions
+2 -2
View File
@@ -510,13 +510,13 @@ void Search::Worker::clear() {
for (auto& to : continuationCorrectionHistory)
for (auto& h : to)
h->fill(0);
h.fill(0);
for (bool inCheck : {false, true})
for (StatsType c : {NoCaptures, Captures})
for (auto& to : continuationHistory[inCheck][c])
for (auto& h : to)
h->fill(-427);
h.fill(-427);
for (size_t i = 1; i < reductions.size(); ++i)
reductions[i] = int(19.43 * std::log(i));