No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
template<typename T>
class EndgameFunctionBase {
public:
- EndgameFunctionBase(Color c) : strongerSide(c) { weakerSide = opposite_color(strongerSide); }
+ EndgameFunctionBase(Color c) : strongerSide(c), weakerSide(opposite_color(c)) {}
virtual ~EndgameFunctionBase() {}
virtual T apply(const Position&) = 0;
/// arguments to the evaluation function, and the search can make use of its
/// contents to make intelligent search decisions.
///
-/// At the moment, this is not utilized very much: The only part of the
+/// At the moment, this is not utilized very much: The only part of the
/// EvalInfo object which is used by the search is futilityMargin.
class Position;
PawnInfo* pi;
// attackedBy[color][piece type] is a bitboard representing all squares
- // attacked by a given color and piece type. attackedBy[color][0] contains
+ // attacked by a given color and piece type, attackedBy[color][0] contains
// all squares attacked by the given color.
Bitboard attackedBy[2][8];
Bitboard attacked_by(Color c) const { return attackedBy[c][0]; }
Bitboard attacked_by(Color c, PieceType pt) const { return attackedBy[c][pt]; }
// kingZone[color] is the zone around the enemy king which is considered
- // by the king safety evaluation. This consists of the squares directly
+ // by the king safety evaluation. This consists of the squares directly
// adjacent to the king, and the three (or two, for a king on an edge file)
- // squares two ranks in front of the king. For instance, if black's king
+ // squares two ranks in front of the king. For instance, if black's king
// is on g8, kingZone[WHITE] is a bitboard containing the squares f8, h8,
// f7, g7, h7, f6, g6 and h6.
Bitboard kingZone[2];
// Middle game and endgame mobility scores.
Value mgMobility, egMobility;
- // Extra futility margin. This is added to the standard futility margin
+ // Extra futility margin. This is added to the standard futility margin
// in the quiescence search.
Value futilityMargin;
};
// x86 assembly language locks or OS spin locks may perform faster than
-// mutex locks on some platforms. On my machine, mutexes seem to be the
+// mutex locks on some platforms. On my machine, mutexes seem to be the
// best.
//#define ASM_LOCK
/// MaterialInfo::scale_factor takes a position and a color as input, and
-/// returns a scale factor for the given color. We have to provide the
+/// returns a scale factor for the given color. We have to provide the
/// position in addition to the color, because the scale factor need not
/// to be a constant: It can also be a function which should be applied to
/// the position. For instance, in KBP vs K endgames, a scaling function
/// MaterialInfo::evaluate applies a specialized evaluation function
-/// to a given position object. It should only be called when
+/// to a given position object. It should only be called when
/// specialized_eval_exists() returns 'true'.
inline Value MaterialInfo::evaluate(const Position& pos) const {
//// Prototypes
////
-extern std::ostream &operator << (std::ostream &os, Move m);
+extern std::ostream& operator<<(std::ostream &os, Move m);
extern Move move_from_string(const Position &pos, const std::string &str);
extern const std::string move_to_string(Move m);
extern bool move_is_ok(Move m);
extern SearchStack EmptySearchStack;
/// MovePicker is a class which is used to pick one legal move at a time from
-/// the current position. It is initialized with a Position object and a few
-/// moves we have reason to believe are good. The most important method is
+/// the current position. It is initialized with a Position object and a few
+/// moves we have reason to believe are good. The most important method is
/// MovePicker::pick_next_move(), which returns a new legal move each time it
/// is called, until there are no legal moves left, when MOVE_NONE is returned.
/// In order to improve the efficiency of the alpha beta algorithm, MovePicker
class MovePicker {
- MovePicker& operator=(const MovePicker&); // Silence a warning under MSVC
+ MovePicker& operator=(const MovePicker&); // silence a warning under MSVC
public:
PH_NONCAPTURES, // Non-captures and underpromotions
PH_EVASIONS, // Check evasions
PH_QCAPTURES, // Captures in quiescence search
- PH_QCHECKS, // Checks in quiescence search
+ PH_QCHECKS, // Non-capture checks in quiescence search
PH_STOP
};
MovePicker(const Position& p, bool pvnode, Move ttm, const SearchStack& ss, Depth d);
Move get_next_move();
- Move get_next_move(Lock &lock);
+ Move get_next_move(Lock& lock);
int number_of_moves() const;
- int current_move_score() const;
Bitboard discovered_check_candidates() const;
static void init_phase_table();
}
/// MovePicker::discovered_check_candidates() returns a bitboard containing
-/// all pieces which can possibly give discovered check. This bitboard is
+/// all pieces which can possibly give discovered check. This bitboard is
/// computed by the constructor function.
inline Bitboard MovePicker::discovered_check_candidates() const {
////
/// PawnInfo is a class which contains various information about a pawn
-/// structure. Currently, it only includes a middle game and an end game
-/// pawn structure evaluation, and a bitboard of passed pawns. We may want
-/// to add further information in the future. A lookup to the pawn hash table
+/// structure. Currently, it only includes a middle game and an end game
+/// pawn structure evaluation, and a bitboard of passed pawns. We may want
+/// to add further information in the future. A lookup to the pawn hash table
/// (performed by calling the get_pawn_info method in a PawnInfoTable object)
/// returns a pointer to a PawnInfo object.
class Position;