Integrate gains table in History

This will be useful to use gains table in move
ordering along with history table.

No functional change and big code remove.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2010-01-27 11:19:56 +01:00
parent 54b3d44194
commit f37741cc83
6 changed files with 26 additions and 122 deletions

View File

@@ -42,6 +42,7 @@ History::History() { clear(); }
void History::clear() {
memset(history, 0, 2 * 8 * 64 * sizeof(int));
memset(maxStaticValueDelta, 0, 16 * 64 * 64 * sizeof(int));
}
@@ -94,3 +95,21 @@ int History::move_ordering_score(Piece p, Square to) const {
return history[p][to];
}
/// History::set_gain() and History::gain() store and retrieve the
/// gain of a move given the delta of the static position evaluations
/// before and after the move.
void History::set_gain(Piece p, Square from, Square to, Value delta)
{
if (delta >= maxStaticValueDelta[p][from][to])
maxStaticValueDelta[p][from][to] = delta;
else
maxStaticValueDelta[p][from][to]--;
}
Value History::gain(Piece p, Square from, Square to) const
{
return Value(maxStaticValueDelta[p][from][to]);
}