+ /// The BetaCounterType class
+
+ BetaCounterType::BetaCounterType() { clear(); }
+
+ void BetaCounterType::clear() {
+
+ for (int i = 0; i < THREAD_MAX; i++)
+ hits[i][WHITE] = hits[i][BLACK] = 0ULL;
+ }
+
+ void BetaCounterType::add(Color us, Depth d, int threadID) {
+
+ // Weighted count based on depth
+ hits[threadID][us] += int(d);
+ }
+
+ void BetaCounterType::read(Color us, int64_t& our, int64_t& their) {
+
+ our = their = 0UL;
+ for (int i = 0; i < THREAD_MAX; i++)
+ {
+ our += hits[i][us];
+ their += hits[i][opposite_color(us)];
+ }
+ }
+