]> git.sesse.net Git - stockfish/commitdiff
Retire init_piece_square_tables()
authorMarco Costalba <mcostalba@gmail.com>
Mon, 13 Jun 2011 14:59:03 +0000 (16:59 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 13 Jun 2011 16:28:09 +0000 (17:28 +0100)
Merge in init_zobrist() and rename the latter.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/main.cpp
src/position.cpp
src/position.h

index e6dfe9344d5837a8194839aa7680927d46a75f3e..72201971a073d769e1e9388a6796ac5e4934a028 100644 (file)
@@ -51,8 +51,7 @@ int main(int argc, char* argv[]) {
 
   // Startup initializations
   init_bitboards();
 
   // Startup initializations
   init_bitboards();
-  Position::init_zobrist();
-  Position::init_piece_square_tables();
+  Position::init();
   init_kpk_bitbase();
   init_search();
   Threads.init();
   init_kpk_bitbase();
   init_search();
   Threads.init();
index 32321b89c6fd51da27fa6ef3820c7ed02e026315..adeef6ec06d3164762b6c3949da8fb20b683e9aa 100644 (file)
@@ -1788,10 +1788,14 @@ bool Position::is_mate() const {
 }
 
 
 }
 
 
-/// Position::init_zobrist() is a static member function which initializes at
-/// startup the various arrays used to compute hash keys.
+/// Position::init() is a static member function which initializes at
+/// startup the various arrays used to compute hash keys and the piece
+/// square tables. The latter is a two-step operation: First, the white
+/// halves of the tables are copied from the MgPST[][] and EgPST[][] arrays.
+/// Second, the black halves of the tables are initialized by mirroring
+/// and changing the sign of the corresponding white scores.
 
 
-void Position::init_zobrist() {
+void Position::init() {
 
   RKISS rk;
 
 
   RKISS rk;
 
@@ -1808,16 +1812,6 @@ void Position::init_zobrist() {
 
   zobSideToMove = rk.rand<Key>();
   zobExclusion  = rk.rand<Key>();
 
   zobSideToMove = rk.rand<Key>();
   zobExclusion  = rk.rand<Key>();
-}
-
-
-/// Position::init_piece_square_tables() initializes the piece square tables.
-/// This is a two-step operation: First, the white halves of the tables are
-/// copied from the MgPST[][] and EgPST[][] arrays. Second, the black halves
-/// of the tables are initialized by mirroring and changing the sign of the
-/// corresponding white scores.
-
-void Position::init_piece_square_tables() {
 
   for (Square s = SQ_A1; s <= SQ_H8; s++)
       for (Piece p = WP; p <= WK; p++)
 
   for (Square s = SQ_A1; s <= SQ_H8; s++)
       for (Piece p = WP; p <= WK; p++)
index 56f5546936650d751db0e14f081120ac49b6b9e2..6307f126a4a613652c1f76ebef662f01babad9f7 100644 (file)
@@ -247,9 +247,8 @@ public:
   // Position consistency check, for debugging
   bool is_ok(int* failedStep = NULL) const;
 
   // Position consistency check, for debugging
   bool is_ok(int* failedStep = NULL) const;
 
-  // Static member functions
-  static void init_zobrist();
-  static void init_piece_square_tables();
+  // Global initialization
+  static void init();
 
 private:
 
 
 private: