mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 17:16:33 +08:00
Use prefix operators wherever possible
No functional change.
This commit is contained in:
committed by
Marco Costalba
parent
bd1c3ed7e3
commit
7f142d6817
@@ -131,7 +131,7 @@ void Search::init() {
|
||||
int mc; // moveCount
|
||||
|
||||
// Init reductions array
|
||||
for (hd = 1; hd < 64; hd++) for (mc = 1; mc < 64; mc++)
|
||||
for (hd = 1; hd < 64; ++hd) for (mc = 1; mc < 64; ++mc)
|
||||
{
|
||||
double pvRed = log(double(hd)) * log(double(mc)) / 3.0;
|
||||
double nonPVRed = 0.33 + log(double(hd)) * log(double(mc)) / 2.25;
|
||||
@@ -146,11 +146,11 @@ void Search::init() {
|
||||
}
|
||||
|
||||
// Init futility margins array
|
||||
for (d = 1; d < 16; d++) for (mc = 0; mc < 64; mc++)
|
||||
for (d = 1; d < 16; ++d) for (mc = 0; mc < 64; ++mc)
|
||||
FutilityMargins[d][mc] = Value(112 * int(log(double(d * d) / 2) / log(2.0) + 1.001) - 8 * mc + 45);
|
||||
|
||||
// Init futility move count array
|
||||
for (d = 0; d < 32; d++)
|
||||
for (d = 0; d < 32; ++d)
|
||||
{
|
||||
FutilityMoveCounts[0][d] = int(3 + 0.3 * pow(double(d ), 1.8)) * 3/4 + (2 < d && d < 5);
|
||||
FutilityMoveCounts[1][d] = int(3 + 0.3 * pow(double(d + 0.98), 1.8));
|
||||
@@ -341,7 +341,7 @@ namespace {
|
||||
RootMoves[i].prevScore = RootMoves[i].score;
|
||||
|
||||
// MultiPV loop. We perform a full root search for each PV line
|
||||
for (PVIdx = 0; PVIdx < PVSize; PVIdx++)
|
||||
for (PVIdx = 0; PVIdx < PVSize; ++PVIdx)
|
||||
{
|
||||
// Reset aspiration window starting size
|
||||
if (depth >= 5)
|
||||
@@ -810,7 +810,7 @@ moves_loop: // When in check and at SpNode search starts from here
|
||||
splitPoint->mutex.unlock();
|
||||
}
|
||||
else
|
||||
moveCount++;
|
||||
++moveCount;
|
||||
|
||||
if (RootNode)
|
||||
{
|
||||
@@ -919,7 +919,7 @@ moves_loop: // When in check and at SpNode search starts from here
|
||||
// Check for legality only before to do the move
|
||||
if (!RootNode && !SpNode && !pos.legal(move, ci.pinned))
|
||||
{
|
||||
moveCount--;
|
||||
--moveCount;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1017,7 +1017,7 @@ moves_loop: // When in check and at SpNode search starts from here
|
||||
// iteration. This information is used for time management: When
|
||||
// the best move changes frequently, we allocate some more time.
|
||||
if (!pvMove)
|
||||
BestMoveChanges++;
|
||||
++BestMoveChanges;
|
||||
}
|
||||
else
|
||||
// All other moves but the PV are set to the lowest value, this
|
||||
@@ -1443,7 +1443,7 @@ moves_loop: // When in check and at SpNode search starts from here
|
||||
static RKISS rk;
|
||||
|
||||
// PRNG sequence should be not deterministic
|
||||
for (int i = Time::now() % 50; i > 0; i--)
|
||||
for (int i = Time::now() % 50; i > 0; --i)
|
||||
rk.rand<unsigned>();
|
||||
|
||||
// RootMoves are already sorted by score in descending order
|
||||
@@ -1514,7 +1514,7 @@ moves_loop: // When in check and at SpNode search starts from here
|
||||
<< " multipv " << i + 1
|
||||
<< " pv";
|
||||
|
||||
for (size_t j = 0; RootMoves[i].pv[j] != MOVE_NONE; j++)
|
||||
for (size_t j = 0; RootMoves[i].pv[j] != MOVE_NONE; ++j)
|
||||
s << " " << move_to_uci(RootMoves[i].pv[j], pos.is_chess960());
|
||||
}
|
||||
|
||||
@@ -1730,7 +1730,7 @@ void check_time() {
|
||||
// Loop across all split points and sum accumulated SplitPoint nodes plus
|
||||
// all the currently active positions nodes.
|
||||
for (size_t i = 0; i < Threads.size(); ++i)
|
||||
for (int j = 0; j < Threads[i]->splitPointsSize; j++)
|
||||
for (int j = 0; j < Threads[i]->splitPointsSize; ++j)
|
||||
{
|
||||
SplitPoint& sp = Threads[i]->splitPoints[j];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user