+private:
+ T table[PIECE_NB][SQUARE_NB];
+};
+
+typedef Stats<Move> MoveStats;
+typedef Stats<Value, false> HistoryStats;
+typedef Stats<Value, true> CounterMoveStats;
+typedef Stats<CounterMoveStats> CounterMoveHistoryStats;
+
+struct FromToStats {
+
+ Value get(Color c, Move m) const { return table[c][from_sq(m)][to_sq(m)]; }
+ 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);