/*
Stockfish, a UCI chess playing engine derived from Glaurung 2.1
- Copyright (C) 2004-2020 The Stockfish developers (see AUTHORS file)
+ Copyright (C) 2004-2021 The Stockfish developers (see AUTHORS file)
Stockfish is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "../../evaluate.h"
#include "features_common.h"
-namespace Eval::NNUE::Features {
+namespace Stockfish::Eval::NNUE::Features {
// Feature HalfKP: Combination of the position of own king
// and the position of pieces other than kings
public:
// Feature name
- static constexpr const char* kName = "HalfKP(Friend)";
+ static constexpr const char* Name = "HalfKP(Friend)";
// Hash value embedded in the evaluation file
- static constexpr std::uint32_t kHashValue =
- 0x5D69D5B9u ^ (AssociatedKing == Side::kFriend);
+ static constexpr std::uint32_t HashValue =
+ 0x5D69D5B9u ^ (AssociatedKing == Side::Friend);
// Number of feature dimensions
- static constexpr IndexType kDimensions =
- static_cast<IndexType>(SQUARE_NB) * static_cast<IndexType>(PS_END);
+ static constexpr IndexType Dimensions =
+ static_cast<IndexType>(SQUARE_NB) * static_cast<IndexType>(PS_NB);
// Maximum number of simultaneously active features
- static constexpr IndexType kMaxActiveDimensions = 30; // Kings don't count
+ static constexpr IndexType MaxActiveDimensions = 30; // Kings don't count
// Trigger for full calculation instead of difference calculation
- static constexpr TriggerEvent kRefreshTrigger = TriggerEvent::kFriendKingMoved;
+ static constexpr TriggerEvent RefreshTrigger = TriggerEvent::FriendKingMoved;
// Get a list of indices for active features
- static void AppendActiveIndices(const Position& pos, Color perspective,
- IndexList* active);
+ static void append_active_indices(const Position& pos, Color perspective,
+ IndexList* active);
// Get a list of indices for recently changed features
- static void AppendChangedIndices(const Position& pos, Color perspective,
- IndexList* removed, IndexList* added);
-
- private:
- // Index of a feature for a given king position and another piece on some square
- static IndexType MakeIndex(Color perspective, Square s, Piece pc, Square sq_k);
+ static void append_changed_indices(const Position& pos, const DirtyPiece& dp, Color perspective,
+ IndexList* removed, IndexList* added);
};
-} // namespace Eval::NNUE::Features
+} // namespace Stockfish::Eval::NNUE::Features
#endif // #ifndef NNUE_FEATURES_HALF_KP_H_INCLUDED