X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmovepick.h;h=0ad72933001384edace7698fdd4bb3a7d65f0001;hp=d9f0457a122fad9a6c9206cf79f371371d107594;hb=bd59560480cc4f43a4ba75dc827ba27bcebb92dd;hpb=f35e52f030af837ed8a89eecd67a6f746ee2e897 diff --git a/src/movepick.h b/src/movepick.h index d9f0457a..0ad72933 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -49,7 +49,7 @@ public: void operator<<(int bonus) { assert(abs(bonus) <= D); // Ensure range is [-W * D, W * D] - assert(abs(W * D) < std::numeric_limits::max()); // Ensure we don't overflow + assert(W * D < std::numeric_limits::max()); // Ensure we don't overflow entry += bonus * W - entry * abs(bonus) / D; @@ -110,6 +110,8 @@ typedef Stats ContinuationHi /// beta algorithm, MovePicker attempts to return the moves which are most likely /// to get a cut-off first. +enum PickType { NEXT, BEST_SCORE }; + class MovePicker { public: MovePicker(const MovePicker&) = delete; @@ -120,6 +122,7 @@ public: Move next_move(bool skipQuiets = false); private: + template Move select_move(Pred); template void score(); ExtMove* begin() { return cur; } ExtMove* end() { return endMoves; } @@ -128,9 +131,10 @@ private: const ButterflyHistory* mainHistory; const CapturePieceToHistory* captureHistory; const PieceToHistory** contHistory; - Move ttMove, countermove, killers[2]; + Move ttMove, refutations[3]; ExtMove *cur, *endMoves, *endBadCaptures; int stage; + Move move; Square recaptureSquare; Value threshold; Depth depth;