X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmovepick.cpp;h=e6b16cc495d238ff078324bf9057e85ca09aa6df;hb=ddbe6082c47befcfe2bd2e778866c8fbda33b8e2;hp=e2bb974170a00afc11a10a1a625166f591dae4a7;hpb=53051eefc741586f72ccbf9a765592c4ca6030bd;p=stockfish diff --git a/src/movepick.cpp b/src/movepick.cpp index e2bb9741..e6b16cc4 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -18,7 +18,6 @@ along with this program. If not, see . */ -#include #include #include "movegen.h" @@ -52,23 +51,6 @@ namespace { } -/// History class method definitions - -void History::clear() { - memset(history, 0, sizeof(history)); - memset(gains, 0, sizeof(gains)); -} - -void History::update(Piece p, Square to, Value bonus) { - if (abs(history[p][to] + bonus) < History::Max) - history[p][to] += bonus; -} - -void History::update_gain(Piece p, Square to, Value gain) { - gains[p][to] = std::max(gain, gains[p][to] - 1); -} - - /// Constructors of the MovePicker class. As arguments we pass information /// to help it to return the presumably good moves first, to decide which /// moves to return (in the quiescence search, for instance, we only want to @@ -76,7 +58,7 @@ void History::update_gain(Piece p, Square to, Value gain) { /// move ordering is at the current node. MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h, - Search::Stack* s, Value beta) : pos(p), H(h), depth(d) { + Search::Stack* s, Value beta) : pos(p), Hist(h), depth(d) { assert(d > DEPTH_ZERO); @@ -109,7 +91,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h, } MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h, - Square sq) : pos(p), H(h), cur(moves), end(moves) { + Square sq) : pos(p), Hist(h), cur(moves), end(moves) { assert(d <= DEPTH_ZERO); @@ -141,7 +123,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h, } MovePicker::MovePicker(const Position& p, Move ttm, const History& h, PieceType pt) - : pos(p), H(h), cur(moves), end(moves) { + : pos(p), Hist(h), cur(moves), end(moves) { assert(!pos.checkers()); @@ -197,7 +179,7 @@ void MovePicker::score_noncaptures() { for (MoveStack* it = moves; it != end; ++it) { m = it->move; - it->score = H[pos.piece_moved(m)][to_sq(m)]; + it->score = Hist[pos.piece_moved(m)][to_sq(m)]; } } @@ -220,7 +202,7 @@ void MovePicker::score_evasions() { it->score = PieceValue[MG][pos.piece_on(to_sq(m))] - type_of(pos.piece_moved(m)) + History::Max; else - it->score = H[pos.piece_moved(m)][to_sq(m)]; + it->score = Hist[pos.piece_moved(m)][to_sq(m)]; } }