////
#include <cassert>
+#include <cmath>
#include <cstring>
#include <fstream>
#include <iostream>
/// Variables initialized by UCI options
- // Minimum number of full depth (i.e. non-reduced) moves at PV and non-PV nodes
- int LMRPVMoves, LMRNonPVMoves;
-
// Depth limit for use of dynamic threat detection
Depth ThreatDepth;
bool UseLogFile;
std::ofstream LogFile;
+ // Natural logarithmic lookup table and its getter function
+ double lnArray[512];
+ inline double ln(int i) { return lnArray[i]; }
+
// MP related variables
int ActiveThreads = 1;
Depth MinimumSplitDepth;
//// Functions
////
-//FIXME: HACK
-static double lnArray[512];
-
-inline double ln(int i)
-{
- return lnArray[i];
-}
/// perft() is our utility to verify move generation is bug free. All the legal
/// moves up to given depth are generated and counted and the sum returned.
MateThreatExtension[1] = Depth(get_option_value_int("Mate Threat Extension (PV nodes)"));
MateThreatExtension[0] = Depth(get_option_value_int("Mate Threat Extension (non-PV nodes)"));
- LMRPVMoves = get_option_value_int("Full Depth Moves (PV nodes)") + 1;
- LMRNonPVMoves = get_option_value_int("Full Depth Moves (non-PV nodes)") + 1;
ThreatDepth = get_option_value_int("Threat Depth") * OnePly;
Chess960 = get_option_value_bool("UCI_Chess960");
/// and initializes the split point stack and the global locks and condition
/// objects.
-#include <cmath> //FIXME: HACK
-
void init_threads() {
- // FIXME: HACK!!
- for (int i = 0; i < 512; i++)
- lnArray[i] = log(double(i));
-
volatile int i;
#if !defined(_MSC_VER)
pthread_t pthread[1];
#endif
+ // Init our logarithmic lookup table
+ for (i = 0; i < 512; i++)
+ lnArray[i] = log(double(i)); // log() returns base-e logarithm
+
for (i = 0; i < THREAD_MAX; i++)
Threads[i].activeSplitPoints = 0;