13 for (
size_t i = 0; i < weights.
dimension(); ++i)
15 table[i] = weights.
value(i);
18 for (
int black = 0; black < 16; ++black)
20 for (
int white = 0; white < 16; ++white)
24 table[index(Progress16(black), Progress16(white))] =
25 -table[index(Progress16(white), Progress16(black))];
35 Progress16 black_attack, Progress16 white_defense,
36 Progress16 white_attack, Progress16 black_defense)
38 return table[index(black_attack, white_defense)] -
39 table[index(white_attack, black_defense)];
45 for (
size_t i = 0; i < weights.
dimension(); ++i)
47 table[i] = weights.
value(i);
56 Progress16 black_attack, Progress16 white_defense,
57 Progress16 white_attack, Progress16 black_defense)
59 return table[index(black_attack, white_defense,
60 white_attack, black_defense)];
66 for (
size_t i = 0; i < weights.
dimension(); ++i)
68 table[i] = weights.
value(i);
70 for (
int ba = 0; ba < 16; ++ba)
72 for (
int wd = 0; wd < 16; ++wd)
74 for (
int wa = 0; wa < 16; ++wa)
76 for (
int bd = 0; bd < 16; ++bd)
78 if (ba + wd < wa + bd ||
79 (ba + wd == wa + bd &&
82 table[index(Progress16(ba), Progress16(wd),
83 Progress16(wa), Progress16(bd))] =
84 -table[index(Progress16(wa), Progress16(bd),
85 Progress16(ba), Progress16(wd))];
static CArray< int, 65536 > table
static void setUp(const Weights &weights)
static int eval(Progress16 black_attack, Progress16 white_defense, Progress16 white_attack, Progress16 black_defense)
static CArray< int, 256 > table
static int eval(Progress16 black_attack, Progress16 white_defense, Progress16 white_attack, Progress16 black_defense)
static void setUp(const Weights &weights)
static CArray< int, 256 > table
static int eval(Progress16 black, Progress16 white)
static void setUp(const Weights &weights)
static int index(Progress16 black, Progress16 white)
int value(size_t index) const