]> git.sesse.net Git - stockfish/commitdiff
Revert "Clarify the mapping of files to queenside"
authorStéphane Nicolet <cassio@free.fr>
Mon, 23 Sep 2019 07:10:28 +0000 (09:10 +0200)
committerStéphane Nicolet <cassio@free.fr>
Mon, 23 Sep 2019 07:10:28 +0000 (09:10 +0200)
This reverts commit 7756344d5d2b93970e7cd423f8cbf6fb1da11b74.

src/evaluate.cpp
src/pawns.cpp
src/psqt.cpp
src/types.h

index f37820afcef975b2f5bb326b30bbe16588d4b6ea..9521cd100282487f44ba3926f01afde124797bc6 100644 (file)
@@ -662,7 +662,7 @@ namespace {
             || (pos.pieces(PAWN) & (s + Up)))
             bonus = bonus / 2;
 
-        score += bonus - PassedFile * map_to_queenside(f);
+        score += bonus - PassedFile * std::min(f, ~f);
     }
 
     if (T)
index d822ef4ef85e8387d7a206db3f85714646844ee2..f60411993fcc0877ed83a8a632f25945018aa9db 100644 (file)
@@ -198,7 +198,7 @@ Score Entry::evaluate_shelter(const Position& pos, Square ksq) {
       b = theirPawns & file_bb(f);
       int theirRank = b ? relative_rank(Us, frontmost_sq(Them, b)) : 0;
 
-      int d = map_to_queenside(f);
+      int d = std::min(f, ~f);
       bonus += make_score(ShelterStrength[d][ourRank], 0);
 
       if (ourRank && (ourRank == theirRank - 1))
index 13e69499b185afd9760d93f4d26edbfec5426f7e..36d99feb7e05280ce9ee6aacc9ab84aec8ebd8d8 100644 (file)
@@ -119,7 +119,7 @@ void init() {
 
       for (Square s = SQ_A1; s <= SQ_H8; ++s)
       {
-          File f = map_to_queenside(file_of(s));
+          File f = std::min(file_of(s), ~file_of(s));
           psq[ pc][ s] = score + (type_of(pc) == PAWN ? PBonus[rank_of(s)][file_of(s)]
                                                       : Bonus[pc][rank_of(s)][f]);
           psq[~pc][~s] = -psq[pc][s];
index 6af0368720313d4c8cb7260566a92726f5256daa..c77d804037ee7a094b54843b1482801baa2c6aed 100644 (file)
@@ -366,10 +366,6 @@ constexpr Piece operator~(Piece pc) {
   return Piece(pc ^ 8); // Swap color of piece B_KNIGHT -> W_KNIGHT
 }
 
-inline File map_to_queenside(File f) {
-  return std::min(f, File(FILE_H - f)); // Map files ABCDEFGH to files ABCDDCBA
-}
-
 constexpr CastlingRights operator&(Color c, CastlingRights cr) {
   return CastlingRights((c == WHITE ? WHITE_CASTLING : BLACK_CASTLING) & cr);
 }