Stockfish, a UCI chess playing engine derived from Glaurung 2.1
Copyright (C) 2004-2008 Tord Romstad (Glaurung author)
Copyright (C) 2008-2015 Marco Costalba, Joona Kiiski, Tord Romstad
- Copyright (C) 2015-2016 Marco Costalba, Joona Kiiski, Gary Linscott, Tord Romstad
+ Copyright (C) 2015-2017 Marco Costalba, Joona Kiiski, Gary Linscott, Tord Romstad
Stockfish is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
PawnValueMg = 188, PawnValueEg = 248,
KnightValueMg = 753, KnightValueEg = 832,
- BishopValueMg = 826, BishopValueEg = 897,
+ BishopValueMg = 814, BishopValueEg = 890,
RookValueMg = 1285, RookValueEg = 1371,
- QueenValueMg = 2513, QueenValueEg = 2650,
+ QueenValueMg = 2513, QueenValueEg = 2648,
MidgameLimit = 15258, EndgameLimit = 3915
};
#define ENABLE_BASE_OPERATORS_ON(T) \
inline T operator+(T d1, T d2) { return T(int(d1) + int(d2)); } \
inline T operator-(T d1, T d2) { return T(int(d1) - int(d2)); } \
-inline T operator*(int i, T d) { return T(i * int(d)); } \
-inline T operator*(T d, int i) { return T(int(d) * i); } \
inline T operator-(T d) { return T(-int(d)); } \
inline T& operator+=(T& d1, T d2) { return d1 = d1 + d2; } \
inline T& operator-=(T& d1, T d2) { return d1 = d1 - d2; } \
-inline T& operator*=(T& d, int i) { return d = T(int(d) * i); }
#define ENABLE_FULL_OPERATORS_ON(T) \
ENABLE_BASE_OPERATORS_ON(T) \
+inline T operator*(int i, T d) { return T(i * int(d)); } \
+inline T operator*(T d, int i) { return T(int(d) * i); } \
inline T& operator++(T& d) { return d = T(int(d) + 1); } \
inline T& operator--(T& d) { return d = T(int(d) - 1); } \
inline T operator/(T d, int i) { return T(int(d) / i); } \
inline int operator/(T d1, T d2) { return int(d1) / int(d2); } \
+inline T& operator*=(T& d, int i) { return d = T(int(d) * i); } \
inline T& operator/=(T& d, int i) { return d = T(int(d) / i); }
ENABLE_FULL_OPERATORS_ON(Value)
return make_score(mg_value(s) / i, eg_value(s) / i);
}
+/// Multiplication of a Score by an integer. We check for overflow in debug mode.
+inline Score operator*(Score s, int i) {
+ Score result = Score(int(s) * i);
+
+ assert(eg_value(result) == (i * eg_value(s)));
+ assert(mg_value(result) == (i * mg_value(s)));
+ assert((i == 0) || (result / i) == s );
+
+ return result;
+}
+
inline Color operator~(Color c) {
return Color(c ^ BLACK); // Toggle color
}