From 4dddac9e257433a8e2f5f763d91470a7e05ff680 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 23 Dec 2021 00:31:12 +0100 Subject: Added the possibility to compress tables to 2 bits per entry. This is done similarly to nxopt: one base value is selected and entries are memorized based on that base value. Values higher than base+3 are returned as base+3 (still a valid estimate) and values lower or equal to base require a lookup on a "fallback" table, which must give a valid estimate for the larger one (e.g. nxopt31 or khuge can fallback to drud_sym16). I have also added some info to the pruning table files: base value and distribution. Unfortunately this means that everyone who has used nissy 2.0beta has to re-generate the tables. --- src/symcoord.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/symcoord.c') diff --git a/src/symcoord.c b/src/symcoord.c index 8b0eeb4..cb178b7 100644 --- a/src/symcoord.c +++ b/src/symcoord.c @@ -166,8 +166,8 @@ antindex_nxopt31(uint64_t ind) Cube c; c = antindex_eofbepos_sym16(ind/(BINOM8ON4*POW3TO7)); - c.cp = coord_cpud_separate.cube((ind/POW3TO7)%BINOM8ON4).cp; - c.coud = ind % POW3TO7; + c.cp = coord_cpud_separate.cube(ind % BINOM8ON4).cp; + c.coud = (ind / BINOM8ON4) % POW3TO7; return c; } @@ -231,9 +231,9 @@ index_nxopt31(Cube cube) t = sd_eofbepos_16.transtorep[coord_eofbepos.index(cube)]; c = apply_trans(t, cube); - a = (index_eofbepos_sym16(c)*BINOM8ON4) + coord_cpud_separate.index(c); + a = (index_eofbepos_sym16(c)*POW3TO7) + c.coud; - return a * POW3TO7 + c.coud; + return a * BINOM8ON4 + coord_cpud_separate.index(c); } static int -- cgit v1.3