major correction history | bench 1744326
This commit is contained in:
1 parent
194c3d3bc4
commit
4b3e8020fa
3 files changed
+15
-1
No files matched your search
+5
-1
@@ -74,6 +74,7 @@ private:
|
||||
// indexed by [stm][key]
|
||||
MultiArray<int, 2, CORRHIST_SIZE> pawnHist;
|
||||
MultiArray<int, 2, CORRHIST_SIZE> nonPawnHist;
|
||||
MultiArray<int, 2, CORRHIST_SIZE> majorHist;
|
||||
public:
|
||||
void Update(Board& board, int depth, int diff, int* entry) {
|
||||
const int scaledDiff = diff * CORRHIST_GRAIN;
|
||||
@@ -86,16 +87,19 @@ public:
|
||||
void UpdateAll(Board& board, int depth, int diff) {
|
||||
Update(board, depth, diff, &pawnHist[board.sideToMove][board.pawnKey % CORRHIST_SIZE]);
|
||||
Update(board, depth, diff, &nonPawnHist[board.sideToMove][board.nonPawnKey % CORRHIST_SIZE]);
|
||||
Update(board, depth, diff, &majorHist[board.sideToMove][board.majorKey % CORRHIST_SIZE]);
|
||||
}
|
||||
|
||||
int GetAllHist(Board& board) {
|
||||
return pawnHist[board.sideToMove][board.pawnKey % CORRHIST_SIZE]
|
||||
+ nonPawnHist[board.sideToMove][board.nonPawnKey % CORRHIST_SIZE];
|
||||
+ nonPawnHist[board.sideToMove][board.nonPawnKey % CORRHIST_SIZE]
|
||||
+ majorHist[board.sideToMove][board.majorKey % CORRHIST_SIZE];
|
||||
}
|
||||
|
||||
void Clear() {
|
||||
std::fill(&pawnHist[0][0], &pawnHist[0][0] + sizeof(pawnHist) / sizeof(int), 0);
|
||||
std::fill(&nonPawnHist[0][0], &nonPawnHist[0][0] + sizeof(nonPawnHist) / sizeof(int), 0);
|
||||
std::fill(&majorHist[0][0], &majorHist[0][0] + sizeof(majorHist) / sizeof(int), 0);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user