nissy-core

The "engine" of nissy, including the H48 optimal solver.
git clone https://git.tronto.net/nissy-core
Download | Log | Files | Refs | README | LICENSE

constants.h (1018B)


      1 #define UINT8_BIT(i) (UINT8_C(1) << (uint8_t)(i))
      2 
      3 #define FACTORIAL_MAX INT64_C(12)
      4 
      5 #define POW_2_11   INT64_C(2048)
      6 #define POW_3_7    INT64_C(2187)
      7 #define FACT_12    INT64_C(479001600)
      8 #define FACT_8     INT64_C(40320)
      9 #define COMB_12_4  INT64_C(495)
     10 #define COMB_8_4   INT64_C(70)
     11 
     12 #define UINT8_ERROR UINT8_MAX
     13 
     14 STATIC int64_t binomial[12][12] = {
     15 	{1,  0,  0,   0,   0,   0,   0,   0,   0,  0,  0, 0},
     16 	{1,  1,  0,   0,   0,   0,   0,   0,   0,  0,  0, 0},
     17 	{1,  2,  1,   0,   0,   0,   0,   0,   0,  0,  0, 0},
     18 	{1,  3,  3,   1,   0,   0,   0,   0,   0,  0,  0, 0},
     19 	{1,  4,  6,   4,   1,   0,   0,   0,   0,  0,  0, 0},
     20 	{1,  5, 10,  10,   5,   1,   0,   0,   0,  0,  0, 0},
     21 	{1,  6, 15,  20,  15,   6,   1,   0,   0,  0,  0, 0},
     22 	{1,  7, 21,  35,  35,  21,   7,   1,   0,  0,  0, 0},
     23 	{1,  8, 28,  56,  70,  56,  28,   8,   1,  0,  0, 0},
     24 	{1,  9, 36,  84, 126, 126,  84,  36,   9,  1,  0, 0},
     25 	{1, 10, 45, 120, 210, 252, 210, 120,  45, 10,  1, 0},
     26 	{1, 11, 55, 165, 330, 462, 462, 330, 165, 55, 11, 1},
     27 };