37 int idir, ibit, ifbit;
39 for (idir = 0; idir < dim; idir++)
43 for (ibit = 0; ibit < bits; ibit++) {
44 for (idir = dim - 1; idir >= 0; idir--) {
45 x[idir] += (((h >> ifbit) & 1) << ibit);
54 int idir, ibit, ifbit;
56 for (idir = 0; idir < dim; idir++)
60 for (ibit = 0; ibit < bits; ibit++) {
61 for (idir = dim - 1; idir >= 0; idir--) {
62 x[idir] += (((h >> ifbit) & 1) << ibit);
70 int N = 2 << (b - 1), P, Q, t;
75 for (
i = n - 1;
i > 0;
i--)
80 for (Q = 2; Q != N; Q <<= 1) {
82 for (
i = n - 1;
i >= 0;
i--) {
86 t = (X[0] ^ X[
i]) & P;
94void TransposetoInt(
const int dim,
long long int *h,
int bits,
int *x) {
97 int idir, ibit, ifbit;
102 for (ibit = 0; ibit < bits; ibit++) {
103 for (idir = dim - 1; idir >= 0; idir--) {
104 *h += (((x[idir] >> ibit) & 1) << ifbit);
113 int idir, ibit, ifbit;
118 for (ibit = 0; ibit < bits; ibit++) {
119 for (idir = dim - 1; idir >= 0; idir--) {
120 *h += (((x[idir] >> ibit) & 1) << ifbit);
127 int M = 1 << (b - 1), P, Q, t;
130 for (Q = M; Q > 1; Q >>= 1) {
132 for (
i = 0;
i < n;
i++) {
136 t = (X[0] ^ X[
i]) & P;
144 for (
i = 1;
i < n;
i++)
147 for (Q = M; Q > 1; Q >>= 1)
150 for (
i = 0;
i < n;
i++)
155void FC_FUNC_(hilbert_index_to_point,
156 HILBERT_INDEX_TO_POINT)(
const int *dim,
const int *nbits,
157 const long long int *
index,
int *point) {
162void FC_FUNC_(hilbert_point_to_index,
163 HILBERT_POINT_TO_INDEX)(
const int *dim,
const int *nbits,
164 long long int *
index,
const int *point) {
166 int point_copy[*dim];
167 for (
int i = 0;
i < *dim;
i++)
168 point_copy[
i] = point[
i];
174void FC_FUNC_(hilbert_index_to_point_int,
175 HILBERT_INDEX_TO_POINT_INT)(
const int *dim,
const int *nbits,
176 const int *
index,
int *point) {
181void FC_FUNC_(hilbert_point_to_index_int,
182 HILBERT_POINT_TO_INDEX_INT)(
const int *dim,
const int *nbits,
183 int *
index,
const int *point) {
185 int point_copy[*dim];
186 for (
int i = 0;
i < *dim;
i++)
187 point_copy[
i] = point[
i];
void InttoTranspose(const int dim, const long long int h, int bits, int *x)
void TransposetoInt4(const int dim, int *h, int bits, int *x)
void AxestoTranspose(int *X, int b, int n)
void TransposetoAxes(int *X, int b, int n)
void Int4toTranspose(const int dim, const int h, int bits, int *x)
void TransposetoInt(const int dim, long long int *h, int bits, int *x)
const int *restrict index