20 #ifndef SPECIAL_CHEMPS2_H 21 #define SPECIAL_CHEMPS2_H 36 static int phase(
const int power_times_two ){
return (((( power_times_two / 2 ) % 2 ) != 0 ) ? -1 : 1 ); }
44 while ((( j + 1 ) * ( j + 2 )) <= ( 2 * global )){ j++; }
46 result[ 0 ] = global - ( j * ( j + 1 ) ) / 2;
56 while (( j * ( j + 1 )) <= ( 2 * global )){ j++; }
58 result[ 0 ] = global - ( j * ( j - 1 ) ) / 2;
68 while ((( k + 1 ) * ( k + 2 ) * ( k + 3 )) <= ( 6 * global )){ k++; }
69 const int remainder = global - ( k * ( k + 1 ) * ( k + 2 ) ) / 6;
71 while ((( j + 1 ) * ( j + 2 )) <= ( 2 * remainder )){ j++; }
74 result[ 0 ] = remainder - ( j * ( j + 1 ) ) / 2;
static void invert_lower_triangle_two(const int global, int *result)
LOWER triangle function for two variables.
static int phase(const int power_times_two)
Phase function.
static void invert_triangle_two(const int global, int *result)
Triangle function for two variables.
static void invert_triangle_three(const int global, int *result)
Triangle function for three variables.