mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 02:27:00 +08:00
Consolidate to centipawns conversion
avoid doing this calculations in multiple places. closes https://github.com/official-stockfish/Stockfish/pull/4686 No functional change
This commit is contained in:
@@ -58,8 +58,6 @@ namespace Eval {
|
||||
|
||||
string currentEvalFileName = "None";
|
||||
|
||||
static double to_cp(Value v) { return double(v) / UCI::NormalizeToPawnValue; }
|
||||
|
||||
/// NNUE::init() tries to load a NNUE network at startup time, or when the engine
|
||||
/// receives a UCI command "setoption name EvalFile value nn-[a-z0-9]{12}.nnue"
|
||||
/// The name of the NNUE network is always retrieved from the EvalFile option.
|
||||
@@ -194,11 +192,11 @@ std::string Eval::trace(Position& pos) {
|
||||
Value v;
|
||||
v = NNUE::evaluate(pos, false);
|
||||
v = pos.side_to_move() == WHITE ? v : -v;
|
||||
ss << "NNUE evaluation " << to_cp(v) << " (white side)\n";
|
||||
ss << "NNUE evaluation " << 0.01 * UCI::to_cp(v) << " (white side)\n";
|
||||
|
||||
v = evaluate(pos);
|
||||
v = pos.side_to_move() == WHITE ? v : -v;
|
||||
ss << "Final evaluation " << to_cp(v) << " (white side)";
|
||||
ss << "Final evaluation " << 0.01 * UCI::to_cp(v) << " (white side)";
|
||||
ss << " [with scaled NNUE, ...]";
|
||||
ss << "\n";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user