From: Marco Costalba Date: Mon, 13 Jun 2011 14:59:03 +0000 (+0200) Subject: Retire init_piece_square_tables() X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=fc519ca74a110a0ceea3c710c88da096fa850c65 Retire init_piece_square_tables() Merge in init_zobrist() and rename the latter. No functional change. Signed-off-by: Marco Costalba --- diff --git a/src/main.cpp b/src/main.cpp index e6dfe934..72201971 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -51,8 +51,7 @@ int main(int argc, char* argv[]) { // Startup initializations init_bitboards(); - Position::init_zobrist(); - Position::init_piece_square_tables(); + Position::init(); init_kpk_bitbase(); init_search(); Threads.init(); diff --git a/src/position.cpp b/src/position.cpp index 32321b89..adeef6ec 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -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; @@ -1808,16 +1812,6 @@ void Position::init_zobrist() { zobSideToMove = rk.rand(); zobExclusion = rk.rand(); -} - - -/// 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++) diff --git a/src/position.h b/src/position.h index 56f55469..6307f126 100644 --- a/src/position.h +++ b/src/position.h @@ -247,9 +247,8 @@ public: // 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: