aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xnissy.obin0 -> 157640 bytes
-rw-r--r--src/coord.c29
2 files changed, 28 insertions, 1 deletions
diff --git a/nissy.o b/nissy.o
new file mode 100755
index 0000000..46a1258
--- /dev/null
+++ b/nissy.o
Binary files differ
diff --git a/src/coord.c b/src/coord.c
index 8c978bc..a53dacc 100644
--- a/src/coord.c
+++ b/src/coord.c
@@ -153,7 +153,13 @@ coord_drud_eofb = {
153static Cube 153static Cube
154antindex_eofb(uint64_t ind) 154antindex_eofb(uint64_t ind)
155{ 155{
156 return (Cube){ .eofb = ind, .eorl = ind, .eoud = ind }; 156 Cube ret = {0};
157
158 ret.eofb = ind;
159 ret.eorl = ind;
160 ret.eoud = ind;
161
162 return ret;
157} 163}
158 164
159static Cube 165static Cube
@@ -161,8 +167,29 @@ antindex_eofbepos(uint64_t ind)
161{ 167{
162 Cube ret = {0}; 168 Cube ret = {0};
163 169
170 /* We need eorl for sym16 coordinate */
171 static int initialized = false;
172 static uint64_t eorl_aux[POW2TO11][BINOM12ON4];
173 static int eo_aux[12], ep_aux[12];
174 unsigned int i, j, k;
175
176 if (!initialized) {
177 for (i = 0; i < POW2TO11; i++) {
178 for (j = 0; j < BINOM12ON4; j++) {
179 int_to_sum_zero_array(i, 2, 12, eo_aux);
180 index_to_subset(j, 12, 4, ep_aux);
181 for (k = 0; k < 12; k++)
182 if (ep_aux[k])
183 eo_aux[k] = 1 - eo_aux[k];
184 }
185 }
186
187 initialized = true;
188 }
189
164 ret.eofb = ind % POW2TO11; 190 ret.eofb = ind % POW2TO11;
165 ret.epose = (ind / POW2TO11) * 24; 191 ret.epose = (ind / POW2TO11) * 24;
192 ret.eorl = eorl_aux[ret.eofb][ret.epose/24];
166 193
167 return ret; 194 return ret;
168} 195}

Generated with cgit - Back to sebastiano.tronto.net