Rev 96 | Rev 169 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 96 | Rev 154 | ||
|---|---|---|---|
| Line 28... | Line 28... | ||
| 28 | using namespace std; | 28 | using namespace std; | 
| 29 | 29 | ||
| 30 | namespace { | 30 | namespace { | 
| 31 | 31 | ||
| 32 |   // Polynomial material imbalance parameters | 32 |   // Polynomial material imbalance parameters | 
| 33 | - | ||
| 34 |   //                      pair  pawn knight bishop rook queen | - | |
| 35 | const int Linear[6] = { 1667, -168, -1027, -166, 238, -138 }; | - | |
| 36 | 33 | ||
| 37 | const int QuadraticOurs[][PIECE_TYPE_NB] = { | 34 | const int QuadraticOurs[][PIECE_TYPE_NB] = { | 
| 38 |     //            OUR PIECES | 35 |     //            OUR PIECES | 
| 39 |     // pair pawn knight bishop rook queen | 36 |     // pair pawn knight bishop rook queen | 
| 40 | { | 37 | {1667 }, // Bishop pair | 
| 41 | { 40, 2 }, // Pawn | 38 | { 40, 2 }, // Pawn | 
| 42 | { 32, 255, -3 }, // Knight OUR PIECES | 39 | { 32, 255, -3 }, // Knight OUR PIECES | 
| 43 | { 0, 104, 4, 0 }, // Bishop | 40 | { 0, 104, 4, 0 }, // Bishop | 
| 44 | { -26, -2, 47, 105, -149 }, // Rook | 41 | { -26, -2, 47, 105, -149 }, // Rook | 
| 45 | {-185, 24, 122, 137, -134, 0 } // Queen | 42 | {-185, 24, 122, 137, -134, 0 } // Queen | 
| Line 98... | Line 95... | ||
| 98 | for (int pt1 = NO_PIECE_TYPE; pt1 <= QUEEN; ++pt1) | 95 | for (int pt1 = NO_PIECE_TYPE; pt1 <= QUEEN; ++pt1) | 
| 99 |     { | 96 |     { | 
| 100 | if (!pieceCount[Us][pt1]) | 97 | if (!pieceCount[Us][pt1]) | 
| 101 | continue; | 98 | continue; | 
| 102 | 99 | ||
| 103 | int v = | 100 | int v = 0; | 
| 104 | 101 | ||
| 105 | for (int pt2 = NO_PIECE_TYPE; pt2 <= pt1; ++pt2) | 102 | for (int pt2 = NO_PIECE_TYPE; pt2 <= pt1; ++pt2) | 
| 106 | v += QuadraticOurs[pt1][pt2] * pieceCount[Us][pt2] | 103 | v += QuadraticOurs[pt1][pt2] * pieceCount[Us][pt2] | 
| 107 | + QuadraticTheirs[pt1][pt2] * pieceCount[Them][pt2]; | 104 | + QuadraticTheirs[pt1][pt2] * pieceCount[Them][pt2]; | 
| 108 | 105 | ||