]> git.sesse.net Git - stockfish/blobdiff - src/movepick.h
Combination of two ideas:
[stockfish] / src / movepick.h
index e64ebfade18308a55046c7b61e396e1800bb7f75..b488313a446833db0b5a8a2d1e8a3fa495964252 100644 (file)
@@ -39,7 +39,7 @@
 template<typename T>
 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: