]> git.sesse.net Git - stockfish/blobdiff - src/misc.cpp
Revert odd depths razoring
[stockfish] / src / misc.cpp
index 8691c3802aedcddf3b8cc7ac56fa6d40398d467f..68f6103c651b0d467072edcd15812939fead7f44 100644 (file)
@@ -37,6 +37,7 @@ int gettimeofday(struct timeval * tp, struct timezone * tzp);
 
 #endif
 
+#include <cassert>
 #include <cstdio>
 #include <iomanip>
 #include <iostream>
@@ -63,6 +64,43 @@ bool dbg_show_hit_rate = false;
 //// Functions
 ////
 
+void dbg_hit_on(bool b) {
+
+    assert(!dbg_show_mean);
+    dbg_show_hit_rate = true;
+    dbg_cnt0++;
+    if (b)
+        dbg_cnt1++;
+}
+
+void dbg_hit_on_c(bool c, bool b) {
+
+    if (c)
+        dbg_hit_on(b);
+}
+
+void dbg_before() {
+
+    assert(!dbg_show_mean);
+    dbg_show_hit_rate = true;
+    dbg_cnt0++;
+}
+
+void dbg_after() {
+
+    assert(!dbg_show_mean);
+    dbg_show_hit_rate = true;
+    dbg_cnt1++;
+}
+
+void dbg_mean_of(int v) {
+
+    assert(!dbg_show_hit_rate);
+    dbg_show_mean = true;
+    dbg_cnt0++;
+    dbg_cnt1 += v;
+}
+
 void dbg_print_hit_rate() {
 
   std::cout << "Total " << dbg_cnt0 << " Hit " << dbg_cnt1