X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmovepick.h;h=0ad72933001384edace7698fdd4bb3a7d65f0001;hp=f9403f0f63940f446d974434018c534c3a022c97;hb=bd59560480cc4f43a4ba75dc827ba27bcebb92dd;hpb=6e9337b10799a65f15db141ff612537185396ea5 diff --git a/src/movepick.h b/src/movepick.h index f9403f0f..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; } @@ -131,6 +134,7 @@ private: Move ttMove, refutations[3]; ExtMove *cur, *endMoves, *endBadCaptures; int stage; + Move move; Square recaptureSquare; Value threshold; Depth depth;