void clear() { std::memset(table, 0, sizeof(table)); }
void update(Color c, Move m, Value v) {
- if (abs(int(v)) >= 324)
- return;
-
Square from = from_sq(m);
Square to = to_sq(m);
- table[c][from][to] -= table[c][from][to] * abs(int(v)) / 324;
+ const int denom = 324;
+
+ assert(abs(int(v)) <= denom); // Needed for stability.
+
+ table[c][from][to] -= table[c][from][to] * abs(int(v)) / denom;
table[c][from][to] += int(v) * 32;
}
void update(Piece pc, Square to, Move m) { table[pc][to] = m; }
void update(Piece pc, Square to, Value v) {
- if (abs(int(v)) >= 324)
- return;
+ const int denom = 936;
+
+ assert(abs(int(v)) <= denom); // Needed for stability.
- table[pc][to] -= table[pc][to] * abs(int(v)) / 936;
+ table[pc][to] -= table[pc][to] * abs(int(v)) / denom;
table[pc][to] += int(v) * 32;
}
MovePicker(const Position&, Move, Depth, Square);
MovePicker(const Position&, Move, Depth, Search::Stack*);
- Move next_move();
+ Move next_move(bool skipQuiets = false);
private:
template<GenType> void score();