-/// engine_name() returns the full name of the current Glaurung version.
-/// This will be either "Glaurung YYMMDD" (where YYMMDD is the date when the
-/// program was compiled) or "Glaurung <version number>", depending on whether
+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
+ << " hit rate (%) " << (dbg_cnt1*100)/(dbg_cnt0 ? dbg_cnt0 : 1)
+ << std::endl;
+}
+
+void dbg_print_mean() {
+
+ std::cout << "Total " << dbg_cnt0 << " Mean "
+ << (float)dbg_cnt1 / (dbg_cnt0 ? dbg_cnt0 : 1) << std::endl;
+}
+
+void dbg_print_hit_rate(std::ofstream& logFile) {
+
+ logFile << "Total " << dbg_cnt0 << " Hit " << dbg_cnt1
+ << " hit rate (%) " << (dbg_cnt1*100)/(dbg_cnt0 ? dbg_cnt0 : 1)
+ << std::endl;
+}
+
+void dbg_print_mean(std::ofstream& logFile) {
+
+ logFile << "Total " << dbg_cnt0 << " Mean "
+ << (float)dbg_cnt1 / (dbg_cnt0 ? dbg_cnt0 : 1) << std::endl;
+}
+
+/// engine_name() returns the full name of the current Stockfish version.
+/// This will be either "Stockfish YYMMDD" (where YYMMDD is the date when the
+/// program was compiled) or "Stockfish <version number>", depending on whether