- const int LinearCoefficients[6] = { 1617, -162, -1172, -190, 105, 26 };
-
- const int QuadraticCoefficientsSameColor[][8] = {
- { 7, 7, 7, 7, 7, 7 }, { 39, 2, 7, 7, 7, 7 }, { 35, 271, -4, 7, 7, 7 },
- { 7, 25, 4, 7, 7, 7 }, { -27, -2, 46, 100, 56, 7 }, { 58, 29, 83, 148, -3, -25 } };
-
- const int QuadraticCoefficientsOppositeColor[][8] = {
- { 41, 41, 41, 41, 41, 41 }, { 37, 41, 41, 41, 41, 41 }, { 10, 62, 41, 41, 41, 41 },
- { 57, 64, 39, 41, 41, 41 }, { 50, 40, 23, -22, 41, 41 }, { 106, 101, 3, 151, 171, 41 } };
-
- // Endgame evaluation and scaling functions accessed direcly and not through
- // the function maps because correspond to more then one material hash key.
- Endgame<Value, KmmKm> EvaluateKmmKm[] = { Endgame<Value, KmmKm>(WHITE), Endgame<Value, KmmKm>(BLACK) };
- Endgame<Value, KXK> EvaluateKXK[] = { Endgame<Value, KXK>(WHITE), Endgame<Value, KXK>(BLACK) };
-
- Endgame<ScaleFactor, KBPsK> ScaleKBPsK[] = { Endgame<ScaleFactor, KBPsK>(WHITE), Endgame<ScaleFactor, KBPsK>(BLACK) };
- Endgame<ScaleFactor, KQKRPs> ScaleKQKRPs[] = { Endgame<ScaleFactor, KQKRPs>(WHITE), Endgame<ScaleFactor, KQKRPs>(BLACK) };
- Endgame<ScaleFactor, KPsK> ScaleKPsK[] = { Endgame<ScaleFactor, KPsK>(WHITE), Endgame<ScaleFactor, KPsK>(BLACK) };
- Endgame<ScaleFactor, KPKP> ScaleKPKP[] = { Endgame<ScaleFactor, KPKP>(WHITE), Endgame<ScaleFactor, KPKP>(BLACK) };
+ // pair pawn knight bishop rook queen
+ const int LinearCoefficients[6] = { 1852, -162, -1122, -183, 249, -52 };
+
+ const int QuadraticCoefficientsSameColor[][PIECE_TYPE_NB] = {
+ // pair pawn knight bishop rook queen
+ { 0 }, // Bishop pair
+ { 39, 2 }, // Pawn
+ { 35, 271, -4 }, // Knight
+ { 0, 105, 4, 0 }, // Bishop
+ { -27, -2, 46, 100, -141 }, // Rook
+ { 58, 29, 83, 148, -163, 0 } // Queen
+ };
+
+ const int QuadraticCoefficientsOppositeColor[][PIECE_TYPE_NB] = {
+ // THEIR PIECES
+ // pair pawn knight bishop rook queen
+ { 0 }, // Bishop pair
+ { 37, 0 }, // Pawn
+ { 10, 62, 0 }, // Knight OUR PIECES
+ { 57, 64, 39, 0 }, // Bishop
+ { 50, 40, 23, -22, 0 }, // Rook
+ { 106, 101, 3, 151, 171, 0 } // Queen
+ };
+
+ // Endgame evaluation and scaling functions are accessed directly and not through
+ // the function maps because they correspond to more then one material hash key.
+ Endgame<KmmKm> EvaluateKmmKm[] = { Endgame<KmmKm>(WHITE), Endgame<KmmKm>(BLACK) };
+ Endgame<KXK> EvaluateKXK[] = { Endgame<KXK>(WHITE), Endgame<KXK>(BLACK) };
+
+ Endgame<KBPsK> ScaleKBPsK[] = { Endgame<KBPsK>(WHITE), Endgame<KBPsK>(BLACK) };
+ Endgame<KQKRPs> ScaleKQKRPs[] = { Endgame<KQKRPs>(WHITE), Endgame<KQKRPs>(BLACK) };
+ Endgame<KPsK> ScaleKPsK[] = { Endgame<KPsK>(WHITE), Endgame<KPsK>(BLACK) };
+ Endgame<KPKP> ScaleKPKP[] = { Endgame<KPKP>(WHITE), Endgame<KPKP>(BLACK) };