X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=3d130efcdb2e790917470f6fe968e0bd19ee14a2;hp=7f6abf15aef1a2a3ab81d2bffae42cc2ad77b9fb;hb=37e38639279bf58558b92932739da57e7c2e3bdc;hpb=9690cd6295fbed93ee434e7b2e16181e475755ac diff --git a/src/search.cpp b/src/search.cpp index 7f6abf15..3d130efc 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -365,7 +365,7 @@ void Thread::search() { // for match (TC 60+0.6) results spanning a wide range of k values. PRNG rng(now()); double floatLevel = Options["UCI_LimitStrength"] ? - clamp(std::pow((Options["UCI_Elo"] - 1346.6) / 143.4, 1 / 0.806), 0.0, 20.0) : + Utility::clamp(std::pow((Options["UCI_Elo"] - 1346.6) / 143.4, 1 / 0.806), 0.0, 20.0) : double(Options["Skill Level"]); int intLevel = int(floatLevel) + ((floatLevel - int(floatLevel)) * 1024 > rng.rand() % 1024 ? 1 : 0); @@ -538,7 +538,7 @@ void Thread::search() { { double fallingEval = (332 + 6 * (mainThread->previousScore - bestValue) + 6 * (mainThread->iterValue[iterIdx] - bestValue)) / 704.0; - fallingEval = clamp(fallingEval, 0.5, 1.5); + fallingEval = Utility::clamp(fallingEval, 0.5, 1.5); // If the bestMove is stable over several iterations, reduce time accordingly timeReduction = lastBestMoveDepth + 9 < completedDepth ? 1.94 : 0.91; @@ -1197,7 +1197,7 @@ moves_loop: // When in check, search starts from here else if (depth < 8 && moveCount > 2) r++; - Depth d = clamp(newDepth - r, 1, newDepth); + Depth d = Utility::clamp(newDepth - r, 1, newDepth); value = -search(pos, ss+1, -(alpha+1), -alpha, d, true);