mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Small lnArray[] cleanup
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
c01af56769
commit
a1b8c8109b
1 changed files with 9 additions and 13 deletions
|
@ -23,6 +23,7 @@
|
||||||
////
|
////
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <cmath>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -235,6 +236,10 @@ namespace {
|
||||||
bool UseLogFile;
|
bool UseLogFile;
|
||||||
std::ofstream LogFile;
|
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
|
// MP related variables
|
||||||
int ActiveThreads = 1;
|
int ActiveThreads = 1;
|
||||||
Depth MinimumSplitDepth;
|
Depth MinimumSplitDepth;
|
||||||
|
@ -319,13 +324,6 @@ namespace {
|
||||||
//// Functions
|
//// 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
|
/// 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.
|
/// moves up to given depth are generated and counted and the sum returned.
|
||||||
|
@ -559,20 +557,18 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
|
||||||
/// and initializes the split point stack and the global locks and condition
|
/// and initializes the split point stack and the global locks and condition
|
||||||
/// objects.
|
/// objects.
|
||||||
|
|
||||||
#include <cmath> //FIXME: HACK
|
|
||||||
|
|
||||||
void init_threads() {
|
void init_threads() {
|
||||||
|
|
||||||
// FIXME: HACK!!
|
|
||||||
for (int i = 0; i < 512; i++)
|
|
||||||
lnArray[i] = log(double(i));
|
|
||||||
|
|
||||||
volatile int i;
|
volatile int i;
|
||||||
|
|
||||||
#if !defined(_MSC_VER)
|
#if !defined(_MSC_VER)
|
||||||
pthread_t pthread[1];
|
pthread_t pthread[1];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Init our logarithmic lookup table
|
||||||
|
for (int i = 0; i < 512; i++)
|
||||||
|
lnArray[i] = log(double(i)); // log() returns base-e logarithm
|
||||||
|
|
||||||
for (i = 0; i < THREAD_MAX; i++)
|
for (i = 0; i < THREAD_MAX; i++)
|
||||||
Threads[i].activeSplitPoints = 0;
|
Threads[i].activeSplitPoints = 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue