]> git.sesse.net Git - stockfish/blobdiff - src/rkiss.h
Remove CONNECTED_KINGS from Syzygy code
[stockfish] / src / rkiss.h
index b9b82cef4fc5b1ad4b434f61d7225747bc7aa9b8..f3468db4e0f056edede0914c5a9d7cde72ea0bba 100644 (file)
@@ -68,6 +68,14 @@ public:
   }
 
   template<typename T> T rand() { return T(rand64()); }
   }
 
   template<typename T> T rand() { return T(rand64()); }
+
+  /// Special generator used to fast init magic numbers. Here the
+  /// trick is to rotate the randoms of a given quantity 's' known
+  /// to be optimal to quickly find a good magic candidate.
+  template<typename T> T magic_rand(int s) {
+    return rotate_L(rotate_L(rand<T>(), (s >> 0) & 0x3F) & rand<T>()
+                                      , (s >> 6) & 0x3F) & rand<T>();
+  }
 };
 
 #endif // #ifndef RKISS_H_INCLUDED
 };
 
 #endif // #ifndef RKISS_H_INCLUDED