alpha = (alpha + beta) / 2;
beta = std::min(bestValue + delta, VALUE_INFINITE);
}
alpha = (alpha + beta) / 2;
beta = std::min(bestValue + delta, VALUE_INFINITE);
}
Move ttMove, move, excludedMove, bestMove;
Depth ext, newDepth, predictedDepth;
Value bestValue, value, ttValue, eval, nullValue, futilityValue;
Move ttMove, move, excludedMove, bestMove;
Depth ext, newDepth, predictedDepth;
Value bestValue, value, ttValue, eval, nullValue, futilityValue;
- bool inCheck, givesCheck, pvMove, singularExtensionNode, improving;
+ bool inCheck, givesCheck, singularExtensionNode, improving;
bool captureOrPromotion, dangerous, doFullDepthSearch;
int moveCount, quietCount;
bool captureOrPromotion, dangerous, doFullDepthSearch;
int moveCount, quietCount;
// For PV nodes only, do a full PV search on the first move or after a fail
// high (in the latter case search only if value < beta), otherwise let the
// parent node fail low with value <= alpha and to try another move.
// For PV nodes only, do a full PV search on the first move or after a fail
// high (in the latter case search only if value < beta), otherwise let the
// parent node fail low with value <= alpha and to try another move.
value = newDepth < ONE_PLY ?
givesCheck ? -qsearch<PV, true>(pos, ss+1, -beta, -alpha, DEPTH_ZERO)
: -qsearch<PV, false>(pos, ss+1, -beta, -alpha, DEPTH_ZERO)
value = newDepth < ONE_PLY ?
givesCheck ? -qsearch<PV, true>(pos, ss+1, -beta, -alpha, DEPTH_ZERO)
: -qsearch<PV, false>(pos, ss+1, -beta, -alpha, DEPTH_ZERO)
RootMove& rm = *std::find(RootMoves.begin(), RootMoves.end(), move);
// PV move or new best move ?
RootMove& rm = *std::find(RootMoves.begin(), RootMoves.end(), move);
// PV move or new best move ?
// We record how often the best move has been changed in each
// iteration. This information is used for time management: When
// the best move changes frequently, we allocate some more time.
// We record how often the best move has been changed in each
// iteration. This information is used for time management: When
// the best move changes frequently, we allocate some more time.