Merge Stats tables

Use a recursive std::array with variadic template
parameters to get rid of the last redundacy.

The first template T parameter is the base type of
the array, the W parameter is the weight applied to
the bonuses when we update values with the << operator,
the D parameter limits the range of updates (range is
[-W * D, W * D]), and the last parameters (Size and
Sizes) encode the dimensions of the array.

This allows greater flexibility because we can now tweak
the range [-W * D, W * D] for each table.

Patch removes more lines than what adds and streamlines
the Stats soup in movepick.h

Closes PR#1422 and PR#1421

No functional change.
This commit is contained in:
Marco Costalba
2018-03-03 11:29:29 +01:00
committed by Stéphane Nicolet
parent 94b3cdd908
commit f35e52f030
4 changed files with 65 additions and 76 deletions

View File

@@ -62,9 +62,9 @@ void Thread::clear() {
for (auto& to : contHistory)
for (auto& h : to)
h.fill(0);
h.get()->fill(0);
contHistory[NO_PIECE][0].fill(Search::CounterMovePruneThreshold - 1);
contHistory[NO_PIECE][0].get()->fill(Search::CounterMovePruneThreshold - 1);
}
/// Thread::start_searching() wakes up the thread that will start the search