X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmovepick.h;h=d3bca28a7ae982aa1cd619c3a581f532711a6020;hp=e64ebfade18308a55046c7b61e396e1800bb7f75;hb=4eca981e557704f4ce3db829adf380b8fc058926;hpb=ca3835857435590865fd41aac9bf4c1cda76dfc3 diff --git a/src/movepick.h b/src/movepick.h index e64ebfad..d3bca28a 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -39,7 +39,7 @@ template struct Stats { - static const Value Max = Value(1 << 28); + static const Value Max = Value(1<<28); const T* operator[](Piece pc) const { return table[pc]; } T* operator[](Piece pc) { return table[pc]; } @@ -51,10 +51,20 @@ struct Stats { table[pc][to] = m; } - void update(Piece pc, Square to, Value v) { + void updateH(Piece pc, Square to, Value v) { - table[pc][to] -= table[pc][to] * std::min(abs(v), 512) / 512; - table[pc][to] += v * 64; + if (abs(int(v)) >= 324) + return; + table[pc][to] -= table[pc][to] * abs(int(v)) / 324; + table[pc][to] += int(v) * 32; + } + + void updateCMH(Piece pc, Square to, Value v) { + + if (abs(int(v)) >= 324) + return; + table[pc][to] -= table[pc][to] * abs(int(v)) / 512; + table[pc][to] += int(v) * 64; } private: @@ -82,7 +92,7 @@ public: MovePicker(const Position&, Move, const HistoryStats&, const CounterMovesHistoryStats&, Value); MovePicker(const Position&, Move, Depth, const HistoryStats&, const CounterMovesHistoryStats&, Move, Search::Stack*); - template Move next_move(); + Move next_move(); private: template void score();