From 35782079749c8f16560a13b9740d1a76654c6fe2 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 3 Jul 2010 05:48:43 +0100 Subject: [PATCH] PSQT access functions can be static Also renamed history access value in something more in line with the meaning. No functional change. Signed-off-by: Marco Costalba --- src/history.cpp | 4 ++-- src/history.h | 2 +- src/movepick.cpp | 4 ++-- src/position.h | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/history.cpp b/src/history.cpp index a57e6de8..75b19709 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -85,10 +85,10 @@ void History::failure(Piece p, Square to, Depth d) { } -/// History::move_ordering_score() returns an integer value used to order the +/// History::value() returns an integer value used to order the /// non-capturing moves in the MovePicker class. -int History::move_ordering_score(Piece p, Square to) const { +int History::value(Piece p, Square to) const { assert(piece_is_ok(p)); assert(square_is_ok(to)); diff --git a/src/history.h b/src/history.h index fdc77ada..2abd26b1 100644 --- a/src/history.h +++ b/src/history.h @@ -49,7 +49,7 @@ public: void clear(); void success(Piece p, Square to, Depth d); void failure(Piece p, Square to, Depth d); - int move_ordering_score(Piece p, Square to) const; + int value(Piece p, Square to) const; void set_gain(Piece p, Square to, Value delta); Value gain(Piece p, Square to) const; diff --git a/src/movepick.cpp b/src/movepick.cpp index 20681108..dcc94015 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -228,7 +228,7 @@ void MovePicker::score_noncaptures() { from = move_from(m); to = move_to(m); piece = pos.piece_on(from); - cur->score = H.move_ordering_score(piece, to); + cur->score = H.value(piece, to); } } @@ -253,7 +253,7 @@ void MovePicker::score_evasions_or_checks() { cur->score = pos.midgame_value_of_piece_on(move_to(m)) - pos.type_of_piece_on(move_from(m)) + HistoryMax; else - cur->score = H.move_ordering_score(pos.piece_on(move_from(m)), move_to(m)); + cur->score = H.value(pos.piece_on(move_from(m)), move_to(m)); } } diff --git a/src/position.h b/src/position.h index 88090ad2..be43c2e4 100644 --- a/src/position.h +++ b/src/position.h @@ -258,7 +258,7 @@ public: // Incremental evaluation Score value() const; Value non_pawn_material(Color c) const; - Score pst_delta(Piece piece, Square from, Square to) const; + static Score pst_delta(Piece piece, Square from, Square to); // Game termination checks bool is_mate() const; @@ -310,7 +310,7 @@ private: Key compute_material_key() const; // Computing incremental evaluation scores and material counts - Score pst(Color c, PieceType pt, Square s) const; + static Score pst(Color c, PieceType pt, Square s); Score compute_value() const; Value compute_non_pawn_material(Color c) const; @@ -507,11 +507,11 @@ inline Key Position::get_material_key() const { return st->materialKey; } -inline Score Position::pst(Color c, PieceType pt, Square s) const { +inline Score Position::pst(Color c, PieceType pt, Square s) { return PieceSquareTable[piece_of_color_and_type(c, pt)][s]; } -inline Score Position::pst_delta(Piece piece, Square from, Square to) const { +inline Score Position::pst_delta(Piece piece, Square from, Square to) { return PieceSquareTable[piece][to] - PieceSquareTable[piece][from]; } -- 2.39.2